diff --git a/wpilibc/athena/include/CameraServer.h b/wpilibc/athena/include/CameraServer.h deleted file mode 100644 index 0a0b50fc1c..0000000000 --- a/wpilibc/athena/include/CameraServer.h +++ /dev/null @@ -1,86 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include -#include -#include -#include -#include - -#include "ErrorBase.h" -#include "HAL/cpp/priority_mutex.h" -#include "NIIMAQdx.h" -#include "USBCamera.h" -#include "nivision.h" - -namespace frc { - -class CameraServer : public ErrorBase { - private: - static constexpr uint16_t kPort = 1180; - static constexpr uint8_t kMagicNumber[] = {0x01, 0x00, 0x00, 0x00}; - static constexpr int kSize640x480 = 0; - static constexpr int kSize320x240 = 1; - static constexpr int kSize160x120 = 2; - static constexpr int kHardwareCompression = -1; - static constexpr int kMaxImageSize = 200000; - - protected: - CameraServer(); - - std::shared_ptr m_camera; - std::thread m_serverThread; - std::thread m_captureThread; - priority_recursive_mutex m_imageMutex; - std::condition_variable_any m_newImageVariable; - std::vector m_dataPool; - int m_quality; - bool m_autoCaptureStarted; - bool m_hwClient; - std::tuple m_imageData; - - void Serve(); - void AutoCapture(); - void SetImageData(uint8_t* data, int size, int start = 0, - bool imaqData = false); - void FreeImageData(std::tuple imageData); - - struct Request { - int fps; - int compression; - int size; - }; - - public: - static CameraServer* GetInstance(); - void SetImage(Image const* image); - - void StartAutomaticCapture( - char const* cameraName = USBCamera::kDefaultCameraName); - - /** - * Start automatically capturing images to send to the dashboard. - * - * You should call this method to just see a camera feed on the - * dashboard without doing any vision processing on the roboRIO. - * {@link #SetImage} should not be called after this is called. - * - * @param camera The camera interface (eg. USBCamera) - */ - void StartAutomaticCapture(std::shared_ptr camera); - - bool IsAutoCaptureStarted(); - - void SetQuality(int quality); - int GetQuality(); - - void SetSize(int size); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/NIIMAQdx.h b/wpilibc/athena/include/NIIMAQdx.h deleted file mode 100644 index 87be7f6f25..0000000000 --- a/wpilibc/athena/include/NIIMAQdx.h +++ /dev/null @@ -1,950 +0,0 @@ -//============================================================================== -// -// Title : NIIMAQdx.h -// Created : 1403685834 seconds after 1/1/1970 12:00:00 UTC -// Copyright : © Copyright 2006, National Instruments Corporation, All rights -// reserved -// Purpose : Include file for NI-IMAQdx library support. -// -//============================================================================== -#ifndef ___niimaqdx_h___ -#define ___niimaqdx_h___ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(niimaqdx_types) -#define niimaqdx_types - -#ifdef _CVI_ -#pragma EnableLibraryRuntimeChecking -#endif - -//============================================================================== -// Typedefs -//============================================================================== -#ifndef _NI_uInt8_DEFINED_ -#define _NI_uInt8_DEFINED_ -typedef unsigned char uInt8; -#endif - -#ifndef _NI_uInt16_DEFINED_ -#define _NI_uInt16_DEFINED_ -typedef unsigned short int uInt16; -#endif - -#ifndef _NI_uInt32_DEFINED_ -#define _NI_uInt32_DEFINED_ -#if defined(_MSC_VER) -typedef unsigned long uInt32; -#elif __GNUC__ -#if __x86_64__ -typedef unsigned int uInt32; -#else -typedef unsigned long uInt32; -#endif -#endif -#endif - -#ifndef _NI_uInt64_DEFINED_ -#define _NI_uInt64_DEFINED_ -#if defined(_MSC_VER) || _CVI_ >= 700 -typedef unsigned __int64 uInt64; -#elif __GNUC__ -typedef unsigned long long uInt64; -#endif -#endif - -#ifndef _NI_Int8_DEFINED_ -#define _NI_Int8_DEFINED_ -typedef char Int8; -#endif - -#ifndef _NI_Int16_DEFINED_ -#define _NI_Int16_DEFINED_ -typedef short int Int16; -#endif - -#ifndef _NI_Int32_DEFINED_ -#define _NI_Int32_DEFINED_ -#if defined(_MSC_VER) -typedef long Int32; -#elif __GNUC__ -#if __x86_64__ -typedef int Int32; -#else -typedef long Int32; -#endif -#endif -#endif - -#ifndef _NI_Int64_DEFINED_ -#define _NI_Int64_DEFINED_ -#if defined(_MSC_VER) || _CVI_ >= 700 -typedef __int64 Int64; -#elif __GNUC__ -typedef long long int Int64; -#endif -#endif - -#ifndef _NI_float32_DEFINED_ -#define _NI_float32_DEFINED_ -typedef float float32; -#endif - -#ifndef _NI_float64_DEFINED_ -#define _NI_float64_DEFINED_ -typedef double float64; -#endif - -#ifndef TRUE -#define TRUE (1L) -#endif - -#ifndef FALSE -#define FALSE (0L) -#endif - -#ifndef _NI_GUIDHNDL_DEFINED -typedef uInt32 GUIHNDL; -#endif - -#if (defined(_MSC_VER) || defined(_CVI_)) -#ifndef _NI_FUNC_DEFINED -#define NI_FUNC __stdcall -#endif - -#ifndef _NI_FUNCC_DEFINED -#define NI_FUNCC __cdecl -#endif -#elif defined(__GNUC__) -#ifndef _NI_FUNC_DEFINED -#define NI_FUNC -#endif - -#ifndef _NI_FUNCC_DEFINED -#define NI_FUNCC -#endif -#endif - -#ifndef _NI_bool32_DEFINED_ -#define _NI_bool32_DEFINED_ -typedef uInt32 bool32; -#endif - -#ifndef _NI_IMAQdxSession_DEFINED_ -#define _NI_IMAQdxSession_DEFINED_ -typedef uInt32 IMAQdxSession; -#endif - -#define IMAQDX_MAX_API_STRING_LENGTH 512 - -//============================================================================== -// Forward Declare Data Structures -//============================================================================== -typedef struct Image_struct Image; - -//============================================================================== -// Error Codes Enumeration -//============================================================================== -typedef enum IMAQdxError_enum { - IMAQdxErrorSuccess = 0x0, // Success - IMAQdxErrorSystemMemoryFull = 0xBFF69000, // Not enough memory - IMAQdxErrorInternal, // Internal error - IMAQdxErrorInvalidParameter, // Invalid parameter - IMAQdxErrorInvalidPointer, // Invalid pointer - IMAQdxErrorInvalidInterface, // Invalid camera session - IMAQdxErrorInvalidRegistryKey, // Invalid registry key - IMAQdxErrorInvalidAddress, // Invalid address - IMAQdxErrorInvalidDeviceType, // Invalid device type - IMAQdxErrorNotImplemented, // Not implemented - IMAQdxErrorCameraNotFound, // Camera not found - IMAQdxErrorCameraInUse, // Camera is already in use. - IMAQdxErrorCameraNotInitialized, // Camera is not initialized. - IMAQdxErrorCameraRemoved, // Camera has been removed. - IMAQdxErrorCameraRunning, // Acquisition in progress. - IMAQdxErrorCameraNotRunning, // No acquisition in progress. - IMAQdxErrorAttributeNotSupported, // Attribute not supported by the camera. - IMAQdxErrorAttributeNotSettable, // Unable to set attribute. - IMAQdxErrorAttributeNotReadable, // Unable to get attribute. - IMAQdxErrorAttributeOutOfRange, // Attribute value is out of range. - IMAQdxErrorBufferNotAvailable, // Requested buffer is unavailable. - IMAQdxErrorBufferListEmpty, // Buffer list is empty. Add one or more buffers. - IMAQdxErrorBufferListLocked, // Buffer list is already locked. Reconfigure - // acquisition and try again. - IMAQdxErrorBufferListNotLocked, // No buffer list. Reconfigure acquisition - // and try again. - IMAQdxErrorResourcesAllocated, // Transfer engine resources already - // allocated. Reconfigure acquisition and try - // again. - IMAQdxErrorResourcesUnavailable, // Insufficient transfer engine resources. - IMAQdxErrorAsyncWrite, // Unable to perform asychronous register write. - IMAQdxErrorAsyncRead, // Unable to perform asychronous register read. - IMAQdxErrorTimeout, // Timeout. - IMAQdxErrorBusReset, // Bus reset occurred during a transaction. - IMAQdxErrorInvalidXML, // Unable to load camera's XML file. - IMAQdxErrorFileAccess, // Unable to read/write to file. - IMAQdxErrorInvalidCameraURLString, // Camera has malformed URL string. - IMAQdxErrorInvalidCameraFile, // Invalid camera file. - IMAQdxErrorGenICamError, // Unknown Genicam error. - IMAQdxErrorFormat7Parameters, // For format 7: The combination of speed, - // image position, image size, and color coding - // is incorrect. - IMAQdxErrorInvalidAttributeType, // The attribute type is not compatible with - // the passed variable type. - IMAQdxErrorDLLNotFound, // The DLL could not be found. - IMAQdxErrorFunctionNotFound, // The function could not be found. - IMAQdxErrorLicenseNotActivated, // License not activated. - IMAQdxErrorCameraNotConfiguredForListener, // The camera is not configured - // properly to support a listener. - IMAQdxErrorCameraMulticastNotAvailable, // Unable to configure the system for - // multicast support. - IMAQdxErrorBufferHasLostPackets, // The requested buffer has lost packets and - // the user requested an error to be - // generated. - IMAQdxErrorGiGEVisionError, // Unknown GiGE Vision error. - IMAQdxErrorNetworkError, // Unknown network error. - IMAQdxErrorCameraUnreachable, // Unable to connect to the camera. - IMAQdxErrorHighPerformanceNotSupported, // High performance acquisition is - // not supported on the specified - // network interface. Connect the - // camera to a network interface - // running the high performance - // driver. - IMAQdxErrorInterfaceNotRenamed, // Unable to rename interface. Invalid or - // duplicate name specified. - IMAQdxErrorNoSupportedVideoModes, // The camera does not have any video modes - // which are supported. - IMAQdxErrorSoftwareTriggerOverrun, // Software trigger overrun. - IMAQdxErrorTestPacketNotReceived, // The system did not receive a test packet - // from the camera. The packet size may be - // too large for the network configuration - // or a firewall may be enabled. - IMAQdxErrorCorruptedImageReceived, // The camera returned a corrupted image. - IMAQdxErrorCameraConfigurationHasChanged, // The camera did not return an - // image of the correct type it was - // configured for previously. - IMAQdxErrorCameraInvalidAuthentication, // The camera is configured with - // password authentication and either - // the user name and password were - // not configured or they are - // incorrect. - IMAQdxErrorUnknownHTTPError, // The camera returned an unknown HTTP error. - IMAQdxErrorKernelDriverUnavailable, // Unable to attach to the kernel mode - // driver. - IMAQdxErrorPixelFormatDecoderUnavailable, // No decoder available for - // selected pixel format. - IMAQdxErrorFirmwareUpdateNeeded, // The acquisition hardware needs a firmware - // update before it can be used. - IMAQdxErrorFirmwareUpdateRebootNeeded, // The firmware on the acquisition - // hardware has been updated and the - // system must be rebooted before use. - IMAQdxErrorLightingCurrentOutOfRange, // The requested current level from the - // lighting controller is not possible. - IMAQdxErrorUSB3VisionError, // Unknown USB3 Vision error. - IMAQdxErrorInvalidU3VUSBDescriptor, // The camera has a USB descriptor that - // is incompatible with the USB3 Vision - // specification. - IMAQdxErrorU3VInvalidControlInterface, // The USB3 Vision control interface - // is not implemented or is invalid on - // this camera. - IMAQdxErrorU3VControlInterfaceError, // There was an error from the control - // interface of the USB3 Vision camera. - IMAQdxErrorU3VInvalidEventInterface, // The USB3 Vision event interface is - // not implemented or is invalid on this - // camera. - IMAQdxErrorU3VEventInterfaceError, // There was an error from the event - // interface of the USB3 Vision camera. - IMAQdxErrorU3VInvalidStreamInterface, // The USB3 Vision stream interface is - // not implemented or is invalid on - // this camera. - IMAQdxErrorU3VStreamInterfaceError, // There was an error from the stream - // interface of the USB3 Vision camera. - IMAQdxErrorU3VUnsupportedConnectionSpeed, // The USB connection speed is not - // supported by the camera. Check - // whether the camera is plugged - // into a USB 2.0 port instead of a - // USB 3.0 port. If so, verify - // that the camera supports this - // use case. - IMAQdxErrorU3VInsufficientPower, // The USB3 Vision camera requires more - // current than can be supplied by the USB - // port in use. - IMAQdxErrorU3VInvalidMaxCurrent, // The U3V_MaximumCurrentUSB20_mA registry - // value is not valid for the connected USB3 - // Vision camera. - IMAQdxErrorBufferIncompleteData, // The requested buffer has incomplete data - // and the user requested an error to be - // generated. - IMAQdxErrorCameraAcquisitionConfigFailed, // The camera returned an error - // starting the acquisition. - IMAQdxErrorCameraClosePending, // The camera still has outstanding references - // and will be closed when these operations - // complete. - IMAQdxErrorSoftwareFault, // An unexpected software error occurred. - IMAQdxErrorCameraPropertyInvalid, // The value for an invalid camera property - // was requested. - IMAQdxErrorJumboFramesNotEnabled, // Jumbo frames are not enabled on the - // host. Maximum packet size is 1500 - // bytes. - IMAQdxErrorBayerPixelFormatNotSelected, // This operation requires that the - // camera has a Bayer pixel format - // selected. - IMAQdxErrorGuard = 0xFFFFFFFF, -} IMAQdxError; - -//============================================================================== -// Bus Type Enumeration -//============================================================================== -typedef enum IMAQdxBusType_enum { - IMAQdxBusTypeFireWire = 0x31333934, - IMAQdxBusTypeEthernet = 0x69707634, - IMAQdxBusTypeSimulator = 0x2073696D, - IMAQdxBusTypeDirectShow = 0x64736877, - IMAQdxBusTypeIP = 0x4950636D, - IMAQdxBusTypeSmartCam2 = 0x53436132, - IMAQdxBusTypeUSB3Vision = 0x55534233, - IMAQdxBusTypeUVC = 0x55564320, - IMAQdxBusTypeGuard = 0xFFFFFFFF, -} IMAQdxBusType; - -//============================================================================== -// Camera Control Mode Enumeration -//============================================================================== -typedef enum IMAQdxCameraControlMode_enum { - IMAQdxCameraControlModeController, - IMAQdxCameraControlModeListener, - IMAQdxCameraControlModeGuard = 0xFFFFFFFF, -} IMAQdxCameraControlMode; - -//============================================================================== -// Buffer Number Mode Enumeration -//============================================================================== -typedef enum IMAQdxBufferNumberMode_enum { - IMAQdxBufferNumberModeNext, - IMAQdxBufferNumberModeLast, - IMAQdxBufferNumberModeBufferNumber, - IMAQdxBufferNumberModeGuard = 0xFFFFFFFF, -} IMAQdxBufferNumberMode; - -//============================================================================== -// Plug n Play Event Enumeration -//============================================================================== -typedef enum IMAQdxPnpEvent_enum { - IMAQdxPnpEventCameraAttached, - IMAQdxPnpEventCameraDetached, - IMAQdxPnpEventBusReset, - IMAQdxPnpEventGuard = 0xFFFFFFFF, -} IMAQdxPnpEvent; - -//============================================================================== -// Bayer Pattern Enumeration -//============================================================================== -typedef enum IMAQdxBayerPattern_enum { - IMAQdxBayerPatternNone, - IMAQdxBayerPatternGB, - IMAQdxBayerPatternGR, - IMAQdxBayerPatternBG, - IMAQdxBayerPatternRG, - IMAQdxBayerPatternHardware, - IMAQdxBayerPatternGuard = 0xFFFFFFFF, -} IMAQdxBayerPattern; - -//============================================================================== -// Bayer Decode Algorithm Enumeration -//============================================================================== -typedef enum IMAQdxBayerAlgorithm_enum { - IMAQdxBayerAlgorithmBilinear, - IMAQdxBayerAlgorithmVNG, - IMAQdxBayerAlgorithmGuard = 0xFFFFFFFF, -} IMAQdxBayerAlgorithm; - -//============================================================================== -// Output Image Types -- Values match Vision Development Module image types -//============================================================================== -typedef enum IMAQdxOutputImageType_enum { - IMAQdxOutputImageTypeU8 = 0, - IMAQdxOutputImageTypeI16 = 1, - IMAQdxOutputImageTypeU16 = 7, - IMAQdxOutputImageTypeRGB32 = 4, - IMAQdxOutputImageTypeRGB64 = 6, - IMAQdxOutputImageTypeAuto = 0x7FFFFFFF, - IMAQdxOutputImageTypeGuard = 0xFFFFFFFF, -} IMAQdxOutputImageType; - -//============================================================================== -// Controller Destination Mode Enumeration -//============================================================================== -typedef enum IMAQdxDestinationMode_enum { - IMAQdxDestinationModeUnicast, - IMAQdxDestinationModeBroadcast, - IMAQdxDestinationModeMulticast, - IMAQdxDestinationModeGuard = 0xFFFFFFFF, -} IMAQdxDestinationMode; - -//============================================================================== -// Attribute Type Enumeration -//============================================================================== -typedef enum IMAQdxAttributeType_enum { - IMAQdxAttributeTypeU32, - IMAQdxAttributeTypeI64, - IMAQdxAttributeTypeF64, - IMAQdxAttributeTypeString, - IMAQdxAttributeTypeEnum, - IMAQdxAttributeTypeBool, - IMAQdxAttributeTypeCommand, - IMAQdxAttributeTypeBlob, - IMAQdxAttributeTypeGuard = 0xFFFFFFFF, -} IMAQdxAttributeType; - -//============================================================================== -// Value Type Enumeration -//============================================================================== -typedef enum IMAQdxValueType_enum { - IMAQdxValueTypeU32, - IMAQdxValueTypeI64, - IMAQdxValueTypeF64, - IMAQdxValueTypeString, - IMAQdxValueTypeEnumItem, - IMAQdxValueTypeBool, - IMAQdxValueTypeDisposableString, - IMAQdxValueTypeGuard = 0xFFFFFFFF, -} IMAQdxValueType; - -//============================================================================== -// Interface File Flags Enumeration -//============================================================================== -typedef enum IMAQdxInterfaceFileFlags_enum { - IMAQdxInterfaceFileFlagsConnected = 0x1, - IMAQdxInterfaceFileFlagsDirty = 0x2, - IMAQdxInterfaceFileFlagsGuard = 0xFFFFFFFF, -} IMAQdxInterfaceFileFlags; - -//============================================================================== -// Overwrite Mode Enumeration -//============================================================================== -typedef enum IMAQdxOverwriteMode_enum { - IMAQdxOverwriteModeGetOldest = 0x0, - IMAQdxOverwriteModeFail = 0x2, - IMAQdxOverwriteModeGetNewest = 0x3, - IMAQdxOverwriteModeGuard = 0xFFFFFFFF, -} IMAQdxOverwriteMode; - -//============================================================================== -// Incomplete Buffer Mode Enumeration -//============================================================================== -typedef enum IMAQdxIncompleteBufferMode_enum { - IMAQdxIncompleteBufferModeIgnore, - IMAQdxIncompleteBufferModeFail, - IMAQdxIncompleteBufferModeGuard = 0xFFFFFFFF, -} IMAQdxIncompleteBufferMode; - -//============================================================================== -// Lost Packet Mode Enumeration -//============================================================================== -typedef enum IMAQdxLostPacketMode_enum { - IMAQdxLostPacketModeIgnore, - IMAQdxLostPacketModeFail, - IMAQdxLostPacketModeGuard = 0xFFFFFFFF, -} IMAQdxLostPacketMode; - -//============================================================================== -// Attribute Visibility Enumeration -//============================================================================== -typedef enum IMAQdxAttributeVisibility_enum { - IMAQdxAttributeVisibilitySimple = 0x00001000, - IMAQdxAttributeVisibilityIntermediate = 0x00002000, - IMAQdxAttributeVisibilityAdvanced = 0x00004000, - IMAQdxAttributeVisibilityGuard = 0xFFFFFFFF, -} IMAQdxAttributeVisibility; - -//============================================================================== -// Stream Channel Mode Enumeration -//============================================================================== -typedef enum IMAQdxStreamChannelMode_enum { - IMAQdxStreamChannelModeAutomatic, - IMAQdxStreamChannelModeManual, - IMAQdxStreamChannelModeGuard = 0xFFFFFFFF, -} IMAQdxStreamChannelMode; - -//============================================================================== -// Pixel Signedness Enumeration -//============================================================================== -typedef enum IMAQdxPixelSignedness_enum { - IMAQdxPixelSignednessUnsigned, - IMAQdxPixelSignednessSigned, - IMAQdxPixelSignednessHardware, - IMAQdxPixelSignednessGuard = 0xFFFFFFFF, -} IMAQdxPixelSignedness; - -//============================================================================== -// USB Connection Speed Enumeration -//============================================================================== -typedef enum IMAQdxUSBConnectionSpeed_enum { - IMAQdxUSBConnectionSpeedLow = 1, - IMAQdxUSBConnectionSpeedFull = 2, - IMAQdxUSBConnectionSpeedHigh = 4, - IMAQdxUSBConnectionSpeedSuper = 8, - IMAQdxUSBConnectionSpeedGuard = 0xFFFFFFFF, -} IMAQdxUSBConnectionSpeed; - -//============================================================================== -// CVI Structures -//============================================================================== -#pragma pack(push, 4) - -//============================================================================== -// Camera Information Structure -//============================================================================== -typedef struct IMAQdxCameraInformation_struct { - uInt32 Type; - uInt32 Version; - uInt32 Flags; - uInt32 SerialNumberHi; - uInt32 SerialNumberLo; - IMAQdxBusType BusType; - char InterfaceName[IMAQDX_MAX_API_STRING_LENGTH]; - char VendorName[IMAQDX_MAX_API_STRING_LENGTH]; - char ModelName[IMAQDX_MAX_API_STRING_LENGTH]; - char CameraFileName[IMAQDX_MAX_API_STRING_LENGTH]; - char CameraAttributeURL[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxCameraInformation; - -//============================================================================== -// Camera File Structure -//============================================================================== -typedef struct IMAQdxCameraFile_struct { - uInt32 Type; - uInt32 Version; - char FileName[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxCameraFile; - -//============================================================================== -// Attribute Information Structure -//============================================================================== -typedef struct IMAQdxAttributeInformation_struct { - IMAQdxAttributeType Type; - bool32 Readable; - bool32 Writable; - char Name[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxAttributeInformation; - -//============================================================================== -// Enumeration Item Structure -//============================================================================== -typedef struct IMAQdxEnumItem_struct { - uInt32 Value; - uInt32 Reserved; - char Name[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxEnumItem; - -//============================================================================== -// Camera Information Structure -//============================================================================== -typedef IMAQdxEnumItem IMAQdxVideoMode; - -#pragma pack(pop) - -//============================================================================== -// Callbacks -//============================================================================== -typedef uInt32(NI_FUNC* FrameDoneEventCallbackPtr)(IMAQdxSession id, - uInt32 bufferNumber, - void* callbackData); -typedef uInt32(NI_FUNC* PnpEventCallbackPtr)(IMAQdxSession id, - IMAQdxPnpEvent pnpEvent, - void* callbackData); -typedef void(NI_FUNC* AttributeUpdatedEventCallbackPtr)(IMAQdxSession id, - const char* name, - void* callbackData); - -#endif // niimaqdx_types -//============================================================================== -// Attributes -//============================================================================== -#define IMAQdxAttributeBaseAddress \ - "CameraInformation::BaseAddress" // Read only. Gets the base address of the - // camera registers. -#define IMAQdxAttributeBusType \ - "CameraInformation::BusType" // Read only. Gets the bus type of the camera. -#define IMAQdxAttributeModelName \ - "CameraInformation::ModelName" // Read only. Returns the model name. -#define IMAQdxAttributeSerialNumberHigh \ - "CameraInformation::SerialNumberHigh" // Read only. Gets the upper 32-bits of - // the camera 64-bit serial number. -#define IMAQdxAttributeSerialNumberLow \ - "CameraInformation::SerialNumberLow" // Read only. Gets the lower 32-bits of - // the camera 64-bit serial number. -#define IMAQdxAttributeVendorName \ - "CameraInformation::VendorName" // Read only. Returns the vendor name. -#define IMAQdxAttributeHostIPAddress \ - "CameraInformation::HostIPAddress" // Read only. Returns the host adapter IP - // address. -#define IMAQdxAttributeIPAddress \ - "CameraInformation::IPAddress" // Read only. Returns the IP address. -#define IMAQdxAttributePrimaryURLString \ - "CameraInformation::PrimaryURLString" // Read only. Gets the camera's primary - // URL string. -#define IMAQdxAttributeSecondaryURLString \ - "CameraInformation::SecondaryURLString" // Read only. Gets the camera's - // secondary URL string. -#define IMAQdxAttributeAcqInProgress \ - "StatusInformation::AcqInProgress" // Read only. Gets the current state of - // the acquisition. TRUE if acquiring; - // otherwise FALSE. -#define IMAQdxAttributeLastBufferCount \ - "StatusInformation::LastBufferCount" // Read only. Gets the number of - // transferred buffers. -#define IMAQdxAttributeLastBufferNumber \ - "StatusInformation::LastBufferNumber" // Read only. Gets the last cumulative - // buffer number transferred. -#define IMAQdxAttributeLostBufferCount \ - "StatusInformation::LostBufferCount" // Read only. Gets the number of lost - // buffers during an acquisition - // session. -#define IMAQdxAttributeLostPacketCount \ - "StatusInformation::LostPacketCount" // Read only. Gets the number of lost - // packets during an acquisition - // session. -#define IMAQdxAttributeRequestedResendPackets \ - "StatusInformation::RequestedResendPacketCount" // Read only. Gets the number - // of packets requested to be - // resent during an - // acquisition session. -#define IMAQdxAttributeReceivedResendPackets \ - "StatusInformation::ReceivedResendPackets" // Read only. Gets the number of - // packets that were requested to - // be resent during an acquisition - // session and were completed. -#define IMAQdxAttributeHandledEventCount \ - "StatusInformation::HandledEventCount" // Read only. Gets the number of - // handled events during an - // acquisition session. -#define IMAQdxAttributeLostEventCount \ - "StatusInformation::LostEventCount" // Read only. Gets the number of lost - // events during an acquisition session. -#define IMAQdxAttributeBayerGainB \ - "AcquisitionAttributes::Bayer::GainB" // Sets/gets the white balance gain for - // the blue component of the Bayer - // conversion. -#define IMAQdxAttributeBayerGainG \ - "AcquisitionAttributes::Bayer::GainG" // Sets/gets the white balance gain for - // the green component of the Bayer - // conversion. -#define IMAQdxAttributeBayerGainR \ - "AcquisitionAttributes::Bayer::GainR" // Sets/gets the white balance gain for - // the red component of the Bayer - // conversion. -#define IMAQdxAttributeBayerPattern \ - "AcquisitionAttributes::Bayer::Pattern" // Sets/gets the Bayer pattern to - // use. -#define IMAQdxAttributeStreamChannelMode \ - "AcquisitionAttributes::Controller::StreamChannelMode" // Gets/sets the mode - // for allocating a - // FireWire stream - // channel. -#define IMAQdxAttributeDesiredStreamChannel \ - "AcquisitionAttributes::Controller::DesiredStreamChannel" // Gets/sets the - // stream channel - // to manually - // allocate. -#define IMAQdxAttributeFrameInterval \ - "AcquisitionAttributes::FrameInterval" // Read only. Gets the duration in - // milliseconds between successive - // frames. -#define IMAQdxAttributeIgnoreFirstFrame \ - "AcquisitionAttributes::IgnoreFirstFrame" // Gets/sets the video delay of one - // frame between starting the - // camera and receiving the video - // feed. -#define IMAQdxAttributeOffsetX \ - "OffsetX" // Gets/sets the left offset of the image. -#define IMAQdxAttributeOffsetY \ - "OffsetY" // Gets/sets the top offset of the image. -#define IMAQdxAttributeWidth "Width" // Gets/sets the width of the image. -#define IMAQdxAttributeHeight "Height" // Gets/sets the height of the image. -#define IMAQdxAttributePixelFormat \ - "PixelFormat" // Gets/sets the pixel format of the source sensor. -#define IMAQdxAttributePacketSize \ - "PacketSize" // Gets/sets the packet size in bytes. -#define IMAQdxAttributePayloadSize \ - "PayloadSize" // Gets/sets the frame size in bytes. -#define IMAQdxAttributeSpeed \ - "AcquisitionAttributes::Speed" // Gets/sets the transfer speed in Mbps for a - // FireWire packet. -#define IMAQdxAttributeShiftPixelBits \ - "AcquisitionAttributes::ShiftPixelBits" // Gets/sets the alignment of 16-bit - // cameras. Downshift the pixel bits - // if the camera returns most - // significant bit-aligned data. -#define IMAQdxAttributeSwapPixelBytes \ - "AcquisitionAttributes::SwapPixelBytes" // Gets/sets the endianness of 16-bit - // cameras. Swap the pixel bytes if - // the camera returns little endian - // data. -#define IMAQdxAttributeOverwriteMode \ - "AcquisitionAttributes::OverwriteMode" // Gets/sets the overwrite mode, used - // to determine acquisition when an - // image transfer cannot be completed - // due to an overwritten internal - // buffer. -#define IMAQdxAttributeTimeout \ - "AcquisitionAttributes::Timeout" // Gets/sets the timeout value in - // milliseconds, used to abort an - // acquisition when the image transfer - // cannot be completed within the delay. -#define IMAQdxAttributeVideoMode \ - "AcquisitionAttributes::VideoMode" // Gets/sets the video mode for a camera. -#define IMAQdxAttributeBitsPerPixel \ - "AcquisitionAttributes::BitsPerPixel" // Gets/sets the actual bits per pixel. - // For 16-bit components, this - // represents the actual bit depth - // (10-, 12-, 14-, or 16-bit). -#define IMAQdxAttributePixelSignedness \ - "AcquisitionAttributes::PixelSignedness" // Gets/sets the signedness of the - // pixel. For 16-bit components, - // this represents the actual pixel - // signedness (Signed, or Unsigned). -#define IMAQdxAttributeReserveDualPackets \ - "AcquisitionAttributes::ReserveDualPackets" // Gets/sets if dual packets will - // be reserved for a very large - // FireWire packet. -#define IMAQdxAttributeReceiveTimestampMode \ - "AcquisitionAttributes::ReceiveTimestampMode" // Gets/sets the mode for - // timestamping images received - // by the driver. -#define IMAQdxAttributeActualPeakBandwidth \ - "AcquisitionAttributes::AdvancedEthernet::BandwidthControl::" \ - "ActualPeakBandwidth" // Read only. Returns the actual maximum peak bandwidth - // the camera will be configured to use. -#define IMAQdxAttributeDesiredPeakBandwidth \ - "AcquisitionAttributes::AdvancedEthernet::BandwidthControl::" \ - "DesiredPeakBandwidth" // Gets/sets the desired maximum peak bandwidth the - // camera should use. -#define IMAQdxAttributeDestinationMode \ - "AcquisitionAttributes::AdvancedEthernet::Controller::DestinationMode" // Gets/Sets - // where - // the - // camera - // is - // instructed - // to - // send - // the - // image - // stream. -#define IMAQdxAttributeDestinationMulticastAddress \ - "AcquisitionAttributes::AdvancedEthernet::Controller::" \ - "DestinationMulticastAddress" // Gets/Sets the multicast address the camera - // should send data in multicast mode. -#define IMAQdxAttributeEventsEnabled \ - "AcquisitionAttributes::AdvancedEthernet::EventParameters::EventsEnabled" // Gets/Sets if events will be handled. -#define IMAQdxAttributeMaxOutstandingEvents \ - "AcquisitionAttributes::AdvancedEthernet::EventParameters::" \ - "MaxOutstandingEvents" // Gets/Sets the maximum number of outstanding events - // to queue. -#define IMAQdxAttributeTestPacketEnabled \ - "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::" \ - "TestPacketEnabled" // Gets/Sets whether the driver will validate the image - // streaming settings using test packets prior to an - // acquisition -#define IMAQdxAttributeTestPacketTimeout \ - "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::" \ - "TestPacketTimeout" // Gets/Sets the timeout for validating test packet - // reception (if enabled) -#define IMAQdxAttributeMaxTestPacketRetries \ - "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::" \ - "MaxTestPacketRetries" // Gets/Sets the number of retries for validating test - // packet reception (if enabled) -#define IMAQdxAttributeChunkDataDecodingEnabled \ - "AcquisitionAttributes::ChunkDataDecoding::ChunkDataDecodingEnabled" // Gets/Sets - // whether - // the - // driver - // will - // decode - // any - // chunk - // data - // in - // the - // image - // stream -#define IMAQdxAttributeChunkDataDecodingMaxElementSize \ - "AcquisitionAttributes::ChunkDataDecoding::MaximumChunkCopySize" // Gets/Sets - // the - // maximum - // size of - // any - // single - // chunk - // data - // element - // that will - // be made - // available -#define IMAQdxAttributeLostPacketMode \ - "AcquisitionAttributes::AdvancedEthernet::LostPacketMode" // Gets/sets the - // behavior when - // the user - // extracts a - // buffer that has - // missing packets. -#define IMAQdxAttributeMemoryWindowSize \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "MemoryWindowSize" // Gets/sets the size of the memory window of the camera - // in kilobytes. Should match the camera's internal buffer - // size. -#define IMAQdxAttributeResendsEnabled \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendsEnabled" // Gets/sets if resends will be issued for missing packets. -#define IMAQdxAttributeResendThresholdPercentage \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "ResendThresholdPercentage" // Gets/sets the threshold of the packet - // processing window that will trigger packets to - // be resent. -#define IMAQdxAttributeResendBatchingPercentage \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "ResendBatchingPercentage" // Gets/sets the percent of the packet resend - // threshold that will be issued as one group past - // the initial threshold sent in a single request. -#define IMAQdxAttributeMaxResendsPerPacket \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "MaxResendsPerPacket" // Gets/sets the maximum number of resend requests that - // will be issued for a missing packet. -#define IMAQdxAttributeResendResponseTimeout \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "ResendResponseTimeout" // Gets/sets the time to wait for a resend request to - // be satisfied before sending another. -#define IMAQdxAttributeNewPacketTimeout \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "NewPacketTimeout" // Gets/sets the time to wait for new packets to arrive in - // a partially completed image before assuming the rest of - // the image was lost. -#define IMAQdxAttributeMissingPacketTimeout \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "MissingPacketTimeout" // Gets/sets the time to wait for a missing packet - // before issuing a resend. -#define IMAQdxAttributeResendTimerResolution \ - "AcquisitionAttributes::AdvancedEthernet::ResendParameters::" \ - "ResendTimerResolution" // Gets/sets the resolution of the packet processing - // system that is used for all packet-related - // timeouts. - -//============================================================================== -// Functions -//============================================================================== -IMAQdxError NI_FUNC IMAQdxSnap(IMAQdxSession id, Image* image); -IMAQdxError NI_FUNC IMAQdxConfigureGrab(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxGrab(IMAQdxSession id, Image* image, - bool32 waitForNextBuffer, - uInt32* actualBufferNumber); -IMAQdxError NI_FUNC -IMAQdxSequence(IMAQdxSession id, Image* images[], uInt32 count); -IMAQdxError NI_FUNC -IMAQdxDiscoverEthernetCameras(const char* address, uInt32 timeout); -IMAQdxError NI_FUNC -IMAQdxEnumerateCameras(IMAQdxCameraInformation cameraInformationArray[], - uInt32* count, bool32 connectedOnly); -IMAQdxError NI_FUNC IMAQdxResetCamera(const char* name, bool32 resetAll); -IMAQdxError NI_FUNC IMAQdxOpenCamera(const char* name, - IMAQdxCameraControlMode mode, - IMAQdxSession* id); -IMAQdxError NI_FUNC IMAQdxCloseCamera(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxConfigureAcquisition(IMAQdxSession id, - bool32 continuous, - uInt32 bufferCount); -IMAQdxError NI_FUNC IMAQdxStartAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC -IMAQdxGetImage(IMAQdxSession id, Image* image, IMAQdxBufferNumberMode mode, - uInt32 desiredBufferNumber, uInt32* actualBufferNumber); -IMAQdxError NI_FUNC -IMAQdxGetImageData(IMAQdxSession id, void* buffer, uInt32 bufferSize, - IMAQdxBufferNumberMode mode, uInt32 desiredBufferNumber, - uInt32* actualBufferNumber); -IMAQdxError NI_FUNC IMAQdxStopAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxUnconfigureAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC -IMAQdxEnumerateVideoModes(IMAQdxSession id, IMAQdxVideoMode videoModeArray[], - uInt32* count, uInt32* currentMode); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes( - IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], - uInt32* count, const char* root); -IMAQdxError NI_FUNC IMAQdxGetAttribute(IMAQdxSession id, const char* name, - IMAQdxValueType type, void* value); -IMAQdxError NI_FUNCC IMAQdxSetAttribute(IMAQdxSession id, const char* name, - IMAQdxValueType type, ...); -IMAQdxError NI_FUNC -IMAQdxGetAttributeMinimum(IMAQdxSession id, const char* name, - IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC -IMAQdxGetAttributeMaximum(IMAQdxSession id, const char* name, - IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC -IMAQdxGetAttributeIncrement(IMAQdxSession id, const char* name, - IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeType(IMAQdxSession id, const char* name, - IMAQdxAttributeType* type); -IMAQdxError NI_FUNC -IMAQdxIsAttributeReadable(IMAQdxSession id, const char* name, bool32* readable); -IMAQdxError NI_FUNC -IMAQdxIsAttributeWritable(IMAQdxSession id, const char* name, bool32* writable); -IMAQdxError NI_FUNC -IMAQdxEnumerateAttributeValues(IMAQdxSession id, const char* name, - IMAQdxEnumItem list[], uInt32* size); -IMAQdxError NI_FUNC IMAQdxGetAttributeTooltip(IMAQdxSession id, - const char* name, char* tooltip, - uInt32 length); -IMAQdxError NI_FUNC IMAQdxGetAttributeUnits(IMAQdxSession id, const char* name, - char* units, uInt32 length); -IMAQdxError NI_FUNC -IMAQdxRegisterFrameDoneEvent(IMAQdxSession id, uInt32 bufferInterval, - FrameDoneEventCallbackPtr callbackFunction, - void* callbackData); -IMAQdxError NI_FUNC IMAQdxRegisterPnpEvent(IMAQdxSession id, - IMAQdxPnpEvent event, - PnpEventCallbackPtr callbackFunction, - void* callbackData); -IMAQdxError NI_FUNC -IMAQdxWriteRegister(IMAQdxSession id, uInt32 offset, uInt32 value); -IMAQdxError NI_FUNC -IMAQdxReadRegister(IMAQdxSession id, uInt32 offset, uInt32* value); -IMAQdxError NI_FUNC IMAQdxWriteMemory(IMAQdxSession id, uInt32 offset, - const char* values, uInt32 count); -IMAQdxError NI_FUNC -IMAQdxReadMemory(IMAQdxSession id, uInt32 offset, char* values, uInt32 count); -IMAQdxError NI_FUNC -IMAQdxGetErrorString(IMAQdxError error, char* message, uInt32 messageLength); -IMAQdxError NI_FUNC -IMAQdxWriteAttributes(IMAQdxSession id, const char* filename); -IMAQdxError NI_FUNC -IMAQdxReadAttributes(IMAQdxSession id, const char* filename); -IMAQdxError NI_FUNC -IMAQdxResetEthernetCameraAddress(const char* name, const char* address, - const char* subnet, const char* gateway, - uInt32 timeout); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes2( - IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], - uInt32* count, const char* root, IMAQdxAttributeVisibility visibility); -IMAQdxError NI_FUNC -IMAQdxGetAttributeVisibility(IMAQdxSession id, const char* name, - IMAQdxAttributeVisibility* visibility); -IMAQdxError NI_FUNC -IMAQdxGetAttributeDescription(IMAQdxSession id, const char* name, - char* description, uInt32 length); -IMAQdxError NI_FUNC -IMAQdxGetAttributeDisplayName(IMAQdxSession id, const char* name, - char* displayName, uInt32 length); -IMAQdxError NI_FUNC IMAQdxDispose(void* buffer); -IMAQdxError NI_FUNC IMAQdxRegisterAttributeUpdatedEvent( - IMAQdxSession id, const char* name, - AttributeUpdatedEventCallbackPtr callbackFunction, void* callbackData); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes3( - IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], - uInt32* count, const char* root, IMAQdxAttributeVisibility visibility); - -#ifdef __cplusplus -} -#endif - -#endif // ___niimaqdx_h___ diff --git a/wpilibc/athena/include/USBCamera.h b/wpilibc/athena/include/USBCamera.h deleted file mode 100644 index 0149b420d1..0000000000 --- a/wpilibc/athena/include/USBCamera.h +++ /dev/null @@ -1,126 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -#include "ErrorBase.h" -#include "HAL/cpp/priority_mutex.h" -#include "NIIMAQdx.h" -#include "nivision.h" - -namespace frc { - -typedef enum whiteBalance_enum { - kFixedIndoor = 3000, - kFixedOutdoor1 = 4000, - kFixedOutdoor2 = 5000, - kFixedFluorescent1 = 5100, - kFixedFlourescent2 = 5200 -} whiteBalance; - -class USBCamera : public ErrorBase { - private: - static constexpr char const* ATTR_WB_MODE = - "CameraAttributes::WhiteBalance::Mode"; - static constexpr char const* ATTR_WB_VALUE = - "CameraAttributes::WhiteBalance::Value"; - static constexpr char const* ATTR_EX_MODE = - "CameraAttributes::Exposure::Mode"; - static constexpr char const* ATTR_EX_VALUE = - "CameraAttributes::Exposure::Value"; - static constexpr char const* ATTR_BR_MODE = - "CameraAttributes::Brightness::Mode"; - static constexpr char const* ATTR_BR_VALUE = - "CameraAttributes::Brightness::Value"; - - // Constants for the manual and auto types - static constexpr char const* AUTO = "Auto"; - static constexpr char const* MANUAL = "Manual"; - - protected: - IMAQdxSession m_id = 0; - std::string m_name; - bool m_useJpeg; - bool m_active = false; - bool m_open = false; - - priority_recursive_mutex m_mutex; - - int m_width = 320; - int m_height = 240; - double m_fps = 30; - std::string m_whiteBalance = AUTO; - int m_whiteBalanceValue = 0; - bool m_whiteBalanceValuePresent = false; - std::string m_exposure = MANUAL; - int m_exposureValue = 50; - bool m_exposureValuePresent = false; - int m_brightness = 80; - bool m_needSettingsUpdate = true; - - int GetJpegSize(void* buffer, int buffSize); - - public: - static constexpr char const* kDefaultCameraName = "cam0"; - - USBCamera(std::string name, bool useJpeg); - - void OpenCamera(); - void CloseCamera(); - void StartCapture(); - void StopCapture(); - void SetFPS(double fps); - void SetSize(int width, int height); - - void UpdateSettings(); - /** - * Set the brightness, as a percentage (0-100). - */ - void SetBrightness(int brightness); - - /** - * Get the brightness, as a percentage (0-100). - */ - int GetBrightness(); - - /** - * Set the white balance to auto - */ - void SetWhiteBalanceAuto(); - - /** - * Set the white balance to hold current - */ - void SetWhiteBalanceHoldCurrent(); - - /** - * Set the white balance to manual, with specified color temperature - */ - void SetWhiteBalanceManual(int wbValue); - - /** - * Set the exposure to auto exposure - */ - void SetExposureAuto(); - - /** - * Set the exposure to hold current - */ - void SetExposureHoldCurrent(); - - /** - * Set the exposure to manual, with a given percentage (0-100) - */ - void SetExposureManual(int expValue); - - void GetImage(Image* image); - int GetImageData(void* buffer, int bufferSize); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/AxisCamera.h b/wpilibc/athena/include/Vision/AxisCamera.h deleted file mode 100644 index 67a2fc85fc..0000000000 --- a/wpilibc/athena/include/Vision/AxisCamera.h +++ /dev/null @@ -1,127 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include -#include -#include - -#include "ErrorBase.h" -#include "HAL/cpp/priority_mutex.h" -#include "Vision/ColorImage.h" -#include "Vision/HSLImage.h" -#include "nivision.h" - -namespace frc { - -/** - * Axis M1011 network camera - */ -class AxisCamera : public ErrorBase { - public: - enum WhiteBalance { - kWhiteBalance_Automatic, - kWhiteBalance_Hold, - kWhiteBalance_FixedOutdoor1, - kWhiteBalance_FixedOutdoor2, - kWhiteBalance_FixedIndoor, - kWhiteBalance_FixedFluorescent1, - kWhiteBalance_FixedFluorescent2 - }; - - enum ExposureControl { - kExposureControl_Automatic, - kExposureControl_Hold, - kExposureControl_FlickerFree50Hz, - kExposureControl_FlickerFree60Hz - }; - - enum Resolution { - kResolution_640x480, - kResolution_480x360, - kResolution_320x240, - kResolution_240x180, - kResolution_176x144, - kResolution_160x120, - }; - - enum Rotation { kRotation_0, kRotation_180 }; - - explicit AxisCamera(std::string const& cameraHost); - virtual ~AxisCamera(); - - AxisCamera(const AxisCamera&) = delete; - AxisCamera& operator=(const AxisCamera&) = delete; - - bool IsFreshImage() const; - - int GetImage(Image* image); - int GetImage(ColorImage* image); - HSLImage* GetImage(); - int CopyJPEG(char** destImage, int& destImageSize, int& destImageBufferSize); - - void WriteBrightness(int brightness); - int GetBrightness(); - - void WriteWhiteBalance(WhiteBalance whiteBalance); - WhiteBalance GetWhiteBalance(); - - void WriteColorLevel(int colorLevel); - int GetColorLevel(); - - void WriteExposureControl(ExposureControl exposureControl); - ExposureControl GetExposureControl(); - - void WriteExposurePriority(int exposurePriority); - int GetExposurePriority(); - - void WriteMaxFPS(int maxFPS); - int GetMaxFPS(); - - void WriteResolution(Resolution resolution); - Resolution GetResolution(); - - void WriteCompression(int compression); - int GetCompression(); - - void WriteRotation(Rotation rotation); - Rotation GetRotation(); - - private: - std::thread m_captureThread; - std::string m_cameraHost; - int m_cameraSocket = -1; - priority_mutex m_captureMutex; - - priority_mutex m_imageDataMutex; - std::vector m_imageData; - bool m_freshImage = false; - - int m_brightness = 50; - WhiteBalance m_whiteBalance = kWhiteBalance_Automatic; - int m_colorLevel = 50; - ExposureControl m_exposureControl = kExposureControl_Automatic; - int m_exposurePriority = 50; - int m_maxFPS = 0; - Resolution m_resolution = kResolution_640x480; - int m_compression = 50; - Rotation m_rotation = kRotation_0; - bool m_parametersDirty = true; - bool m_streamDirty = true; - priority_mutex m_parametersMutex; - - bool m_done = false; - - void Capture(); - void ReadImagesFromCamera(); - bool WriteParameters(); - - int CreateCameraSocket(std::string const& requestString, bool setError); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/BaeUtilities.h b/wpilibc/athena/include/Vision/BaeUtilities.h deleted file mode 100644 index a90d2ebbda..0000000000 --- a/wpilibc/athena/include/Vision/BaeUtilities.h +++ /dev/null @@ -1,75 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -#include - -/* Constants */ -#define LOG_DEBUG __FILE__, __FUNCTION__, __LINE__, DEBUG_TYPE -#define LOG_INFO __FILE__, __FUNCTION__, __LINE__, INFO_TYPE -#define LOG_ERROR __FILE__, __FUNCTION__, __LINE__, ERROR_TYPE -#define LOG_CRITICAL __FILE__, __FUNCTION__, __LINE__, CRITICAL_TYPE -#define LOG_FATAL __FILE__, __FUNCTION__, __LINE__, FATAL_TYPE -#define LOG_DEBUG __FILE__, __FUNCTION__, __LINE__, DEBUG_TYPE - -namespace frc { - -/* Enumerated Types */ - -/** debug levels */ -enum dprint_type { - DEBUG_TYPE, - INFO_TYPE, - ERROR_TYPE, - CRITICAL_TYPE, - FATAL_TYPE -}; - -/** debug output setting */ -typedef enum DebugOutputType_enum { - DEBUG_OFF, - DEBUG_MOSTLY_OFF, - DEBUG_SCREEN_ONLY, - DEBUG_FILE_ONLY, - DEBUG_SCREEN_AND_FILE -} DebugOutputType; - -/* Enumerated Types */ - -/* Utility functions */ - -/* debug */ -void SetDebugFlag(DebugOutputType flag); -void dprintf(const char* tempString, ...); /* Variable argument list */ - -/* set FRC ranges for drive */ -double RangeToNormalized(double pixel, int range); -/* change normalized value to any range - used for servo */ -float NormalizeToRange(float normalizedValue, float minRange, float maxRange); -float NormalizeToRange(float normalizedValue); - -/* system utilities */ -void ShowActivity(char* fmt, ...); -double ElapsedTime(double startTime); - -/* servo panning utilities */ -class Servo; -double SinPosition(double* period, double sinStart); -void panInit(); -void panInit(double period); -void panForTarget(Servo* panServo); -void panForTarget(Servo* panServo, double sinStart); - -/* config file read utilities */ -int processFile(char* inputFile, char* outputString, int lineNumber); -int emptyString(char* string); -void stripString(char* string); - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/BinaryImage.h b/wpilibc/athena/include/Vision/BinaryImage.h deleted file mode 100644 index a1f98408dd..0000000000 --- a/wpilibc/athena/include/Vision/BinaryImage.h +++ /dev/null @@ -1,48 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include -#include - -#include "MonoImage.h" - -/** - * Included for ParticleAnalysisReport definition - * TODO: Eliminate this dependency! - */ -#include "Vision/VisionAPI.h" - -namespace frc { - -class BinaryImage : public MonoImage { - public: - virtual ~BinaryImage() = default; - int GetNumberParticles(); - ParticleAnalysisReport GetParticleAnalysisReport(int particleNumber); - void GetParticleAnalysisReport(int particleNumber, - ParticleAnalysisReport* par); - std::vector* GetOrderedParticleAnalysisReports(); - BinaryImage* RemoveSmallObjects(bool connectivity8, int erosions); - BinaryImage* RemoveLargeObjects(bool connectivity8, int erosions); - BinaryImage* ConvexHull(bool connectivity8); - BinaryImage* ParticleFilter(ParticleFilterCriteria2* criteria, - int criteriaCount); - virtual void Write(const char* fileName); - - private: - bool ParticleMeasurement(int particleNumber, MeasurementType whatToMeasure, - int* result); - bool ParticleMeasurement(int particleNumber, MeasurementType whatToMeasure, - double* result); - static double NormalizeFromRange(double position, int range); - static bool CompareParticleSizes(ParticleAnalysisReport particle1, - ParticleAnalysisReport particle2); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/ColorImage.h b/wpilibc/athena/include/Vision/ColorImage.h deleted file mode 100644 index 04b936e759..0000000000 --- a/wpilibc/athena/include/Vision/ColorImage.h +++ /dev/null @@ -1,75 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include "BinaryImage.h" -#include "ImageBase.h" -#include "Threshold.h" - -namespace frc { - -class ColorImage : public ImageBase { - public: - explicit ColorImage(ImageType type); - virtual ~ColorImage() = default; - BinaryImage* ThresholdRGB(int redLow, int redHigh, int greenLow, - int greenHigh, int blueLow, int blueHigh); - BinaryImage* ThresholdHSL(int hueLow, int hueHigh, int saturationLow, - int saturationHigh, int luminenceLow, - int luminenceHigh); - BinaryImage* ThresholdHSV(int hueLow, int hueHigh, int saturationLow, - int saturationHigh, int valueHigh, int valueLow); - BinaryImage* ThresholdHSI(int hueLow, int hueHigh, int saturationLow, - int saturationHigh, int intensityLow, - int intensityHigh); - BinaryImage* ThresholdRGB(Threshold& threshold); - BinaryImage* ThresholdHSL(Threshold& threshold); - BinaryImage* ThresholdHSV(Threshold& threshold); - BinaryImage* ThresholdHSI(Threshold& threshold); - MonoImage* GetRedPlane(); - MonoImage* GetGreenPlane(); - MonoImage* GetBluePlane(); - MonoImage* GetHSLHuePlane(); - MonoImage* GetHSVHuePlane(); - MonoImage* GetHSIHuePlane(); - MonoImage* GetHSLSaturationPlane(); - MonoImage* GetHSVSaturationPlane(); - MonoImage* GetHSISaturationPlane(); - MonoImage* GetLuminancePlane(); - MonoImage* GetValuePlane(); - MonoImage* GetIntensityPlane(); - void ReplaceRedPlane(MonoImage* plane); - void ReplaceGreenPlane(MonoImage* plane); - void ReplaceBluePlane(MonoImage* plane); - void ReplaceHSLHuePlane(MonoImage* plane); - void ReplaceHSVHuePlane(MonoImage* plane); - void ReplaceHSIHuePlane(MonoImage* plane); - void ReplaceHSLSaturationPlane(MonoImage* plane); - void ReplaceHSVSaturationPlane(MonoImage* plane); - void ReplaceHSISaturationPlane(MonoImage* plane); - void ReplaceLuminancePlane(MonoImage* plane); - void ReplaceValuePlane(MonoImage* plane); - void ReplaceIntensityPlane(MonoImage* plane); - void ColorEqualize(); - void LuminanceEqualize(); - - private: - BinaryImage* ComputeThreshold(ColorMode colorMode, int low1, int high1, - int low2, int high2, int low3, int high3); - void Equalize(bool allPlanes); - MonoImage* ExtractColorPlane(ColorMode mode, int planeNumber); - MonoImage* ExtractFirstColorPlane(ColorMode mode); - MonoImage* ExtractSecondColorPlane(ColorMode mode); - MonoImage* ExtractThirdColorPlane(ColorMode mode); - void ReplacePlane(ColorMode mode, MonoImage* plane, int planeNumber); - void ReplaceFirstColorPlane(ColorMode mode, MonoImage* plane); - void ReplaceSecondColorPlane(ColorMode mode, MonoImage* plane); - void ReplaceThirdColorPlane(ColorMode mode, MonoImage* plane); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/FrcError.h b/wpilibc/athena/include/Vision/FrcError.h deleted file mode 100644 index aa1dad2e55..0000000000 --- a/wpilibc/athena/include/Vision/FrcError.h +++ /dev/null @@ -1,36 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -/* Error Codes */ -#define ERR_VISION_GENERAL_ERROR 166000 // -#define ERR_COLOR_NOT_FOUND 166100 // TrackAPI.cpp -#define ERR_PARTICLE_TOO_SMALL 166101 // TrackAPI.cpp - -#define ERR_CAMERA_FAILURE 166200 // AxisCamera.cpp -#define ERR_CAMERA_SOCKET_CREATE_FAILED 166201 // AxisCamera.cpp -#define ERR_CAMERA_CONNECT_FAILED 166202 // AxisCamera.cpp -#define ERR_CAMERA_STALE_IMAGE 166203 // AxisCamera.cpp -#define ERR_CAMERA_NOT_INITIALIZED 166204 // AxisCamera.cpp -#define ERR_CAMERA_NO_BUFFER_AVAILABLE 166205 // AxisCamera.cpp -#define ERR_CAMERA_HEADER_ERROR 166206 // AxisCamera.cpp -#define ERR_CAMERA_BLOCKING_TIMEOUT 166207 // AxisCamera.cpp -#define ERR_CAMERA_AUTHORIZATION_FAILED 166208 // AxisCamera.cpp -#define ERR_CAMERA_TASK_SPAWN_FAILED 166209 // AxisCamera.cpp -#define ERR_CAMERA_TASK_INPUT_OUT_OF_RANGE 166210 // AxisCamera.cpp -#define ERR_CAMERA_COMMAND_FAILURE 166211 // AxisCamera.cpp - -namespace frc { - -/* error handling functions */ -int GetLastVisionError(); -const char* GetVisionErrorText(int errorCode); - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/HSLImage.h b/wpilibc/athena/include/Vision/HSLImage.h deleted file mode 100644 index 3dcc7a9aad..0000000000 --- a/wpilibc/athena/include/Vision/HSLImage.h +++ /dev/null @@ -1,24 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include "ColorImage.h" - -namespace frc { - -/** - * A color image represented in HSL color space at 3 bytes per pixel. - */ -class HSLImage : public ColorImage { - public: - HSLImage(); - explicit HSLImage(const char* fileName); - virtual ~HSLImage() = default; -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/ImageBase.h b/wpilibc/athena/include/Vision/ImageBase.h deleted file mode 100644 index dc1398cef8..0000000000 --- a/wpilibc/athena/include/Vision/ImageBase.h +++ /dev/null @@ -1,30 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include "ErrorBase.h" -#include "nivision.h" - -#define DEFAULT_BORDER_SIZE 3 - -namespace frc { - -class ImageBase : public ErrorBase { - public: - explicit ImageBase(ImageType type); - virtual ~ImageBase(); - virtual void Write(const char* fileName); - int GetHeight(); - int GetWidth(); - Image* GetImaqImage(); - - protected: - Image* m_imaqImage; -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/MonoImage.h b/wpilibc/athena/include/Vision/MonoImage.h deleted file mode 100644 index 7d1623647b..0000000000 --- a/wpilibc/athena/include/Vision/MonoImage.h +++ /dev/null @@ -1,28 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -#include "ImageBase.h" - -namespace frc { - -class MonoImage : public ImageBase { - public: - MonoImage(); - virtual ~MonoImage() = default; - - std::vector* DetectEllipses( - EllipseDescriptor* ellipseDescriptor, CurveOptions* curveOptions, - ShapeDetectionOptions* shapeDetectionOptions, ROI* roi); - std::vector* DetectEllipses( - EllipseDescriptor* ellipseDescriptor); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/RGBImage.h b/wpilibc/athena/include/Vision/RGBImage.h deleted file mode 100644 index 34e2b852f6..0000000000 --- a/wpilibc/athena/include/Vision/RGBImage.h +++ /dev/null @@ -1,24 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include "ColorImage.h" - -namespace frc { - -/** - * A color image represented in RGB color space at 3 bytes per pixel. - */ -class RGBImage : public ColorImage { - public: - RGBImage(); - explicit RGBImage(const char* fileName); - virtual ~RGBImage() = default; -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/Threshold.h b/wpilibc/athena/include/Vision/Threshold.h deleted file mode 100644 index 5e99293c67..0000000000 --- a/wpilibc/athena/include/Vision/Threshold.h +++ /dev/null @@ -1,32 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -namespace frc { - -/** - * Color threshold values. - * This object represnts the threshold values for any type of color object - * that is used in a threshhold operation. It simplifies passing values - * around in a program for color detection. - */ -class Threshold { - public: - int plane1Low; - int plane1High; - int plane2Low; - int plane2High; - int plane3Low; - int plane3High; - Threshold(int plane1Low, int plane1High, int plane2Low, int plane2High, - int plane3Low, int plane3High); -}; - -} // namespace frc diff --git a/wpilibc/athena/include/Vision/VisionAPI.h b/wpilibc/athena/include/Vision/VisionAPI.h deleted file mode 100644 index 0e1f514c1a..0000000000 --- a/wpilibc/athena/include/Vision/VisionAPI.h +++ /dev/null @@ -1,180 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#pragma once - -#include - -#include "nivision.h" - -/* Constants */ - -#define DEFAULT_BORDER_SIZE 3 // VisionAPI.frcCreateImage -#define DEFAULT_SATURATION_THRESHOLD 40 // TrackAPI.FindColor - -namespace frc { - -/* Forward Declare Data Structures */ -typedef struct FindEdgeOptions_struct FindEdgeOptions; -typedef struct CircularEdgeReport_struct CircularEdgeReport; - -/* Data Structures */ - -/** frcParticleAnalysis returns this structure */ -typedef struct ParticleAnalysisReport_struct { - int imageHeight; - int imageWidth; - double imageTimestamp; - int particleIndex; // the particle index analyzed - /* X-coordinate of the point representing the average position of the - * total particle mass, assuming every point in the particle has a constant - * density - */ - int center_mass_x; // MeasurementType: IMAQ_MT_CENTER_OF_MASS_X - /* Y-coordinate of the point representing the average position of the - * total particle mass, assuming every point in the particle has a constant - * density - */ - int center_mass_y; // MeasurementType: IMAQ_MT_CENTER_OF_MASS_Y - double center_mass_x_normalized; // Center of mass x value normalized to -1.0 - // to +1.0 range - double center_mass_y_normalized; // Center of mass y value normalized to -1.0 - // to +1.0 range - /* Area of the particle */ - double particleArea; // MeasurementType: IMAQ_MT_AREA - /* Bounding Rectangle */ - Rect boundingRect; // left/top/width/height - /* Percentage of the particle Area covering the Image Area. */ - double particleToImagePercent; // MeasurementType: IMAQ_MT_AREA_BY_IMAGE_AREA - /* Percentage of the particle Area in relation to its Particle and Holes Area - */ - double particleQuality; // MeasurementType: - // IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA -} ParticleAnalysisReport; - -/** Tracking functions return this structure */ -typedef struct ColorReport_struct { - int numberParticlesFound; // Number of particles found for this color - int largestParticleNumber; // The particle index of the largest particle - /* Color information */ - float particleHueMax; // HistogramReport: hue max - float particleHueMin; // HistogramReport: hue max - float particleHueMean; // HistogramReport: hue mean - float particleSatMax; // HistogramReport: saturation max - float particleSatMin; // HistogramReport: saturation max - float particleSatMean; // HistogramReport: saturation mean - float particleLumMax; // HistogramReport: luminance max - float particleLumMin; // HistogramReport: luminance max - float particleLumMean; // HistogramReport: luminance mean -} ColorReport; - -/* Image Management functions */ - -/* Create: calls imaqCreateImage. Border size is set to some default value */ -Image* frcCreateImage(ImageType type); - -/* Dispose: calls imaqDispose */ -int frcDispose(void* object); -int frcDispose(const char* filename, ...); - -/* Copy: calls imaqDuplicateImage */ -int frcCopyImage(Image* dest, const Image* source); - -/* Image Extraction: Crop: calls imaqScale */ -int frcCrop(Image* dest, const Image* source, Rect rect); - -/* Image Extraction: Scale: calls imaqScale. Scales entire image */ -int frcScale(Image* dest, const Image* source, int xScale, int yScale, - ScalingMode scaleMode); - -/* Read Image : calls imaqReadFile */ -int frcReadImage(Image* image, const char* fileName); -/* Write Image : calls imaqWriteFile */ -int frcWriteImage(const Image* image, const char* fileName); - -/* Measure Intensity functions */ - -/* Histogram: calls imaqHistogram */ -HistogramReport* frcHistogram(const Image* image, int numClasses, float min, - float max, Rect rect); -/* Color Histogram: calls imaqColorHistogram2 */ -ColorHistogramReport* frcColorHistogram(const Image* image, int numClasses, - ColorMode mode, Image* mask); - -/* Get Pixel Value: calls imaqGetPixel */ -int frcGetPixelValue(const Image* image, Point pixel, PixelValue* value); - -/* Particle Analysis functions */ - -/* Particle Filter: calls imaqParticleFilter3 */ -int frcParticleFilter(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, - int criteriaCount, const ParticleFilterOptions* options, - Rect rect, int* numParticles); -int frcParticleFilter(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, - int criteriaCount, const ParticleFilterOptions* options, - int* numParticles); -/* Morphology: calls imaqMorphology */ -int frcMorphology(Image* dest, Image* source, MorphologyMethod method); -int frcMorphology(Image* dest, Image* source, MorphologyMethod method, - const StructuringElement* structuringElement); -/* Reject Border: calls imaqRejectBorder */ -int frcRejectBorder(Image* dest, Image* source); -int frcRejectBorder(Image* dest, Image* source, int connectivity8); -/* Count Particles: calls imaqCountParticles */ -int frcCountParticles(Image* image, int* numParticles); -/* Particle Analysis Report: calls imaqMeasureParticle */ -int frcParticleAnalysis(Image* image, int particleNumber, - ParticleAnalysisReport* par); - -/* Image Enhancement functions */ - -/* Equalize: calls imaqEqualize */ -int frcEqualize(Image* dest, const Image* source, float min, float max); -int frcEqualize(Image* dest, const Image* source, float min, float max, - const Image* mask); - -/* Color Equalize: calls imaqColorEqualize */ -int frcColorEqualize(Image* dest, const Image* source); -int frcColorEqualize(Image* dest, const Image* source, int colorEqualization); - -/* Image Thresholding & Conversion functions */ - -/* Smart Threshold: calls imaqLocalThreshold */ -int frcSmartThreshold(Image* dest, const Image* source, int windowWidth, - int windowHeight, LocalThresholdMethod method, - double deviationWeight, ObjectType type); -int frcSmartThreshold(Image* dest, const Image* source, int windowWidth, - int windowHeight, LocalThresholdMethod method, - double deviationWeight, ObjectType type, - float replaceValue); - -/* Simple Threshold: calls imaqThreshold */ -int frcSimpleThreshold(Image* dest, const Image* source, float rangeMin, - float rangeMax, float newValue); -int frcSimpleThreshold(Image* dest, const Image* source, float rangeMin, - float rangeMax); - -/* Color/Hue Threshold: calls imaqColorThreshold */ -int frcColorThreshold(Image* dest, const Image* source, ColorMode mode, - const Range* plane1Range, const Range* plane2Range, - const Range* plane3Range); -int frcColorThreshold(Image* dest, const Image* source, int replaceValue, - ColorMode mode, const Range* plane1Range, - const Range* plane2Range, const Range* plane3Range); -int frcHueThreshold(Image* dest, const Image* source, const Range* hueRange); -int frcHueThreshold(Image* dest, const Image* source, const Range* hueRange, - int minSaturation); - -/* Extract ColorHue Plane: calls imaqExtractColorPlanes */ -int frcExtractColorPlanes(const Image* image, ColorMode mode, Image* plane1, - Image* plane2, Image* plane3); -int frcExtractHuePlane(const Image* image, Image* huePlane); -int frcExtractHuePlane(const Image* image, Image* huePlane, int minSaturation); - -} // namespace frc diff --git a/wpilibc/athena/include/WPILib.h b/wpilibc/athena/include/WPILib.h index c0483d85fa..907c6401f1 100644 --- a/wpilibc/athena/include/WPILib.h +++ b/wpilibc/athena/include/WPILib.h @@ -22,7 +22,6 @@ #include "Buttons/InternalButton.h" #include "Buttons/JoystickButton.h" #include "Buttons/NetworkButton.h" -#include "CameraServer.h" #include "Commands/Command.h" #include "Commands/CommandGroup.h" #include "Commands/PIDCommand.h" @@ -81,14 +80,6 @@ #include "Utility.h" #include "Victor.h" #include "VictorSP.h" -#include "Vision/AxisCamera.h" -#include "Vision/BinaryImage.h" -#include "Vision/ColorImage.h" -#include "Vision/HSLImage.h" -#include "Vision/ImageBase.h" -#include "Vision/MonoImage.h" -#include "Vision/RGBImage.h" -#include "Vision/Threshold.h" #include "WPIErrors.h" #include "interfaces/Accelerometer.h" #include "interfaces/Gyro.h" diff --git a/wpilibc/athena/include/nivision.h b/wpilibc/athena/include/nivision.h deleted file mode 100644 index 5c569622b2..0000000000 --- a/wpilibc/athena/include/nivision.h +++ /dev/null @@ -1,8829 +0,0 @@ -/*============================================================================*/ -/* IMAQ Vision */ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) National Instruments 2001. All Rights Reserved. */ -/*----------------------------------------------------------------------------*/ -/* */ -/* Title: NIVision.h */ -/* */ -/*============================================================================*/ -#if !defined(NiVision_h) -#define NiVision_h - -//============================================================================ -// Includes -//============================================================================ -#include - -//============================================================================ -// Control Defines -//============================================================================ -#if !defined(IMAQ_IMPORT) -#ifndef __GNUC__ -#define IMAQ_IMPORT __declspec(dllimport) -#else -#define IMAQ_IMPORT -#endif -#endif - -#if !defined(IMAQ_FUNC) -#if !defined(__cplusplus) -#define IMAQ_FUNC IMAQ_IMPORT -#else -#define IMAQ_FUNC extern "C" IMAQ_IMPORT -#endif -#endif - -#if !defined(IMAQ_STDCALL) -#ifndef __GNUC__ -#define IMAQ_STDCALL __stdcall -#else -#define IMAQ_STDCALL -#endif -#endif - -#ifdef _CVI_ -#pragma EnableLibraryRuntimeChecking -#include -#endif - -#define IMAQ_CALLBACK __cdecl - -//============================================================================ -// Manifest Constants -//============================================================================ -#ifndef NULL -#ifdef __cplusplus -#define NULL ((void*)0) -#else -#define NULL 0 -#endif -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#define IMAQ_DEFAULT_SHOW_COORDINATES TRUE -#define IMAQ_DEFAULT_MAX_ICONS_PER_LINE 4 -#define IMAQ_DEFAULT_LEARNING_MODE IMAQ_LEARN_SHIFT_INFORMATION -#define IMAQ_DEFAULT_BMP_COMPRESS FALSE -#define IMAQ_DEFAULT_PNG_QUALITY 750 -#define IMAQ_DEFAULT_JPEG_QUALITY 750 -#define IMAQ_ALL_CONTOURS -1 -#define IMAQ_ALL_WINDOWS -1 -#define IMAQ_SHIFT 1 -#define IMAQ_ALT 2 -#define IMAQ_CTRL 4 -#define IMAQ_CAPS_LOCK 8 -#define IMAQ_MODAL_DIALOG -1 -#define IMAQ_INIT_RGB_TRANSPARENT \ - { 0, 0, 0, 1 } -#define IMAQ_INIT_RGB_RED \ - { 0, 0, 255, 0 } -#define IMAQ_INIT_RGB_BLUE \ - { 255, 0, 0, 0 } -#define IMAQ_INIT_RGB_GREEN \ - { 0, 255, 0, 0 } -#define IMAQ_INIT_RGB_YELLOW \ - { 0, 255, 255, 0 } -#define IMAQ_INIT_RGB_WHITE \ - { 255, 255, 255, 0 } -#define IMAQ_INIT_RGB_BLACK \ - { 0, 0, 0, 0 } -#define IMAQ_USE_DEFAULT_QUALITY -1 -#define IMAQ_ALL_SAMPLES -1 -#define IMAQ_ALL_OBJECTS -1 -#define IMAQ_ALL_CHARACTERS -1 - -//============================================================================ -// Predefined Valid Characters -//============================================================================ -#define IMAQ_ANY_CHARACTER "" // Any Character -#define IMAQ_ALPHABETIC \ - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" // Alphabetic -#define IMAQ_ALPHANUMERIC \ - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" // Alphanumeric -#define IMAQ_UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // Uppercase - // Letters -#define IMAQ_LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" // Lowercase - // Letters -#define IMAQ_DECIMAL_DIGITS "0123456789" // Decimal Digits -#define IMAQ_HEXADECIMAL_DIGITS "0123456789ABCDEFabcdef" // Hexadecimal Digits -#define IMAQ_PATTERN \ - "\xFF" // Pattern (A single character string with the character value set to - // 255) -#define IMAQ_FORCE_SPACE " " // Force Space - -//============================================================================ -// Macros -//============================================================================ -#define IMAQ_NO_RECT imaqMakeRect(0, 0, 0x7FFFFFFF, 0x7FFFFFFF) -#define IMAQ_NO_ROTATED_RECT \ - imaqMakeRotatedRect(0, 0, 0x7FFFFFFF, 0x7FFFFFFF, 0) -#define IMAQ_NO_POINT imaqMakePoint(-1, -1) -#define IMAQ_NO_POINT_FLOAT imaqMakePointFloat(-1.0, -1.0) -#define IMAQ_NO_OFFSET imaqMakePointFloat(0.0, 0.0) - -//============================================================================ -// When in Borland, some functions must be mapped to different names. -// This accomplishes said task. -//============================================================================ -#if defined(__BORLANDC__) || (defined(_CVI_) && defined(_NI_BC_)) -#define imaqMakePoint imaqMakePoint_BC -#define imaqMakePointFloat imaqMakePointFloat_BC -#endif - -//============================================================================ -// When in Watcom, some functions must be mapped to different names. -// This accomplishes said task. -//============================================================================ -#if defined(__WATCOMC__) || (defined(_CVI_) && defined(_NI_WC_)) -#define imaqMakePoint imaqMakePoint_BC -#define imaqMakePointFloat imaqMakePointFloat_BC -#endif - -//============================================================================ -// If using Visual C++, force startup & shutdown code to run. -//============================================================================ -#if defined(_MSC_VER) && !defined(_CVI_) && !defined(__BORLANDC__) -#pragma comment(linker, "/INCLUDE:_nivision_startup_shutdown") -#pragma comment(linker, "/DEFAULTLIB:nivision.lib") -#endif - -//============================================================================ -// Error Codes -//============================================================================ -#define ERR_SUCCESS 0 // No error. -#define ERR_SYSTEM_ERROR -1074396160 // System error. -#define ERR_OUT_OF_MEMORY \ - -1074396159 // Not enough memory for requested operation. -#define ERR_MEMORY_ERROR -1074396158 // Memory error. -#define ERR_UNREGISTERED -1074396157 // Unlicensed copy of NI Vision. -#define ERR_NEED_FULL_VERSION \ - -1074396156 // The function requires an NI Vision 5.0 Advanced license. -#define ERR_UNINIT -1074396155 // NI Vision did not initialize properly. -#define ERR_IMAGE_TOO_SMALL \ - -1074396154 // The image is not large enough for the operation. -#define ERR_BARCODE_CODABAR \ - -1074396153 // The barcode is not a valid Codabar barcode. -#define ERR_BARCODE_CODE39 \ - -1074396152 // The barcode is not a valid Code 3 of 9 barcode. -#define ERR_BARCODE_CODE93 \ - -1074396151 // The barcode is not a valid Code93 barcode. -#define ERR_BARCODE_CODE128 \ - -1074396150 // The barcode is not a valid Code128 barcode. -#define ERR_BARCODE_EAN8 \ - -1074396149 // The barcode is not a valid EAN8 barcode. -#define ERR_BARCODE_EAN13 \ - -1074396148 // The barcode is not a valid EAN13 barcode. -#define ERR_BARCODE_I25 \ - -1074396147 // The barcode is not a valid Interleaved 2 of 5 barcode. -#define ERR_BARCODE_MSI -1074396146 // The barcode is not a valid MSI barcode. -#define ERR_BARCODE_UPCA \ - -1074396145 // The barcode is not a valid UPCA barcode. -#define ERR_BARCODE_CODE93_SHIFT \ - -1074396144 // The Code93 barcode contains invalid shift encoding. -#define ERR_BARCODE_TYPE -1074396143 // The barcode type is invalid. -#define ERR_BARCODE_INVALID \ - -1074396142 // The image does not represent a valid linear barcode. -#define ERR_BARCODE_CODE128_FNC \ - -1074396141 // The FNC value in the Code128 barcode is not located before the - // first data value. -#define ERR_BARCODE_CODE128_SET \ - -1074396140 // The starting code set in the Code128 barcode is not valid. -#define ERR_ROLLBACK_RESOURCE_OUT_OF_MEMORY \ - -1074396139 // Not enough reserved memory in the timed environment for the - // requested operation. -#define ERR_ROLLBACK_NOT_SUPPORTED \ - -1074396138 // The function is not supported when a time limit is active. -#define ERR_DIRECTX_DLL_NOT_FOUND \ - -1074396137 // Quartz.dll not found. Install DirectX 8.1 or later. -#define ERR_DIRECTX_INVALID_FILTER_QUALITY \ - -1074396136 // The filter quality you provided is invalid. Valid quality - // values range from -1 to 1000. -#define ERR_INVALID_BUTTON_LABEL -1074396135 // Invalid button label. -#define ERR_THREAD_INITIALIZING \ - -1074396134 // Could not execute the function in the separate thread because - // the thread has not completed initialization. -#define ERR_THREAD_COULD_NOT_INITIALIZE \ - -1074396133 // Could not execute the function in the separate thread because - // the thread could not initialize. -#define ERR_MASK_NOT_TEMPLATE_SIZE \ - -1074396132 // The mask must be the same size as the template. -#define ERR_NOT_RECT_OR_ROTATED_RECT \ - -1074396130 // The ROI must only have either a single Rectangle contour or a - // single Rotated Rectangle contour. -#define ERR_ROLLBACK_UNBOUNDED_INTERFACE \ - -1074396129 // During timed execution, you must use the preallocated version - // of this operation. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_3 \ - -1074396128 // An image being modified by one process cannot be requested by - // another process while a time limit is active. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_2 \ - -1074396127 // An image with pattern matching, calibration, or overlay - // information cannot be manipulated while a time limit is - // active. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_1 \ - -1074396126 // An image created before a time limit is started cannot be - // resized while a time limit is active. -#define ERR_INVALID_CONTRAST_THRESHOLD \ - -1074396125 // Invalid contrast threshold. The threshold value must be - // greater than 0. -#define ERR_INVALID_CALIBRATION_ROI_MODE \ - -1074396124 // NI Vision does not support the calibration ROI mode you - // supplied. -#define ERR_INVALID_CALIBRATION_MODE \ - -1074396123 // NI Vision does not support the calibration mode you supplied. -#define ERR_DRAWTEXT_COLOR_MUST_BE_GRAYSCALE \ - -1074396122 // Set the foreground and background text colors to grayscale to - // draw on a U8 image. -#define ERR_SATURATION_THRESHOLD_OUT_OF_RANGE \ - -1074396121 // The value of the saturation threshold must be from 0 to 255. -#define ERR_NOT_IMAGE -1074396120 // Not an image. -#define ERR_CUSTOMDATA_INVALID_KEY \ - -1074396119 // They custom data key you supplied is invalid. The only valid - // character values are decimal 32-126 and 161-255. There must - // also be no repeated, leading, or trailing spaces. -#define ERR_INVALID_STEP_SIZE \ - -1074396118 // Step size must be greater than zero and less than Image size -#define ERR_MATRIX_SIZE \ - -1074396117 // Invalid matrix size in the structuring element. -#define ERR_CALIBRATION_INSF_POINTS \ - -1074396116 // Insufficient number of calibration feature points. -#define ERR_CALIBRATION_IMAGE_CORRECTED \ - -1074396115 // The operation is invalid in a corrected image. -#define ERR_CALIBRATION_INVALID_ROI \ - -1074396114 // The ROI contains an invalid contour type or is not contained - // in the ROI learned for calibration. -#define ERR_CALIBRATION_IMAGE_UNCALIBRATED \ - -1074396113 // The source/input image has not been calibrated. -#define ERR_INCOMP_MATRIX_SIZE \ - -1074396112 // The number of pixel and real-world coordinates must be equal. -#define ERR_CALIBRATION_FAILED_TO_FIND_GRID \ - -1074396111 // Unable to automatically detect grid because the image is too - // distorted. -#define ERR_CALIBRATION_INFO_VERSION \ - -1074396110 // Invalid calibration information version. -#define ERR_CALIBRATION_INVALID_SCALING_FACTOR \ - -1074396109 // Invalid calibration scaling factor. -#define ERR_CALIBRATION_ERRORMAP \ - -1074396108 // The calibration error map cannot be computed. -#define ERR_CALIBRATION_INFO_1 \ - -1074396107 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_2 \ - -1074396106 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_3 \ - -1074396105 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_4 \ - -1074396104 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_5 \ - -1074396103 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_6 \ - -1074396102 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_MICRO_PLANE \ - -1074396101 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_PERSPECTIVE_PROJECTION \ - -1074396100 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_SIMPLE_TRANSFORM \ - -1074396099 // Invalid calibration template image. -#define ERR_RESERVED_MUST_BE_NULL \ - -1074396098 // You must pass NULL for the reserved parameter. -#define ERR_INVALID_PARTICLE_PARAMETER_VALUE \ - -1074396097 // You entered an invalid selection in the particle parameter. -#define ERR_NOT_AN_OBJECT -1074396096 // Not an object. -#define ERR_CALIBRATION_DUPLICATE_REFERENCE_POINT \ - -1074396095 // The reference points passed are inconsistent. At least two - // similar pixel coordinates correspond to different real-world - // coordinates. -#define ERR_ROLLBACK_RESOURCE_CANNOT_UNLOCK \ - -1074396094 // A resource conflict occurred in the timed environment. Two - // processes cannot manage the same resource and be time bounded. -#define ERR_ROLLBACK_RESOURCE_LOCKED \ - -1074396093 // A resource conflict occurred in the timed environment. Two - // processes cannot access the same resource and be time bounded. -#define ERR_ROLLBACK_RESOURCE_NON_EMPTY_INITIALIZE \ - -1074396092 // Multiple timed environments are not supported. -#define ERR_ROLLBACK_RESOURCE_UNINITIALIZED_ENABLE \ - -1074396091 // A time limit cannot be started until the timed environment is - // initialized. -#define ERR_ROLLBACK_RESOURCE_ENABLED \ - -1074396090 // Multiple timed environments are not supported. -#define ERR_ROLLBACK_RESOURCE_REINITIALIZE \ - -1074396089 // The timed environment is already initialized. -#define ERR_ROLLBACK_RESIZE \ - -1074396088 // The results of the operation exceeded the size limits on the - // output data arrays. -#define ERR_ROLLBACK_STOP_TIMER \ - -1074396087 // No time limit is available to stop. -#define ERR_ROLLBACK_START_TIMER -1074396086 // A time limit could not be set. -#define ERR_ROLLBACK_INIT_TIMER \ - -1074396085 // The timed environment could not be initialized. -#define ERR_ROLLBACK_DELETE_TIMER \ - -1074396084 // No initialized timed environment is available to close. -#define ERR_ROLLBACK_TIMEOUT -1074396083 // The time limit has expired. -#define ERR_PALETTE_NOT_SUPPORTED \ - -1074396082 // Only 8-bit images support the use of palettes. Either do not - // use a palette, or convert your image to an 8-bit image before - // using a palette. -#define ERR_BAD_PASSWORD -1074396081 // Incorrect password. -#define ERR_INVALID_IMAGE_TYPE -1074396080 // Invalid image type. -#define ERR_INVALID_METAFILE_HANDLE -1074396079 // Invalid metafile handle. -#define ERR_INCOMP_TYPE -1074396077 // Incompatible image type. -#define ERR_COORD_SYS_FIRST_AXIS \ - -1074396076 // Unable to fit a line for the primary axis. -#define ERR_COORD_SYS_SECOND_AXIS \ - -1074396075 // Unable to fit a line for the secondary axis. -#define ERR_INCOMP_SIZE -1074396074 // Incompatible image size. -#define ERR_MASK_OUTSIDE_IMAGE \ - -1074396073 // When the mask's offset was applied, the mask was entirely - // outside of the image. -#define ERR_INVALID_BORDER -1074396072 // Invalid image border. -#define ERR_INVALID_SCAN_DIRECTION -1074396071 // Invalid scan direction. -#define ERR_INVALID_FUNCTION -1074396070 // Unsupported function. -#define ERR_INVALID_COLOR_MODE \ - -1074396069 // NI Vision does not support the color mode you specified. -#define ERR_INVALID_ACTION \ - -1074396068 // The function does not support the requested action. -#define ERR_IMAGES_NOT_DIFF \ - -1074396067 // The source image and destination image must be different. -#define ERR_INVALID_POINTSYMBOL -1074396066 // Invalid point symbol. -#define ERR_CANT_RESIZE_EXTERNAL \ - -1074396065 // Cannot resize an image in an acquisition buffer. -#define ERR_EXTERNAL_NOT_SUPPORTED \ - -1074396064 // This operation is not supported for images in an acquisition - // buffer. -#define ERR_EXTERNAL_ALIGNMENT \ - -1074396063 // The external buffer must be aligned on a 4-byte boundary. The - // line width and border pixels must be 4-byte aligned, as well. -#define ERR_INVALID_TOLERANCE \ - -1074396062 // The tolerance parameter must be greater than or equal to 0. -#define ERR_INVALID_WINDOW_SIZE \ - -1074396061 // The size of each dimension of the window must be greater than - // 2 and less than or equal to the size of the image in the - // corresponding dimension. -#define ERR_JPEG2000_LOSSLESS_WITH_FLOATING_POINT \ - -1074396060 // Lossless compression cannot be used with the floating point - // wavelet transform mode. Either set the wavelet transform mode - // to integer, or use lossy compression. -#define ERR_INVALID_MAX_ITERATIONS \ - -1074396059 // Invalid maximum number of iterations. Maximum number of - // iterations must be greater than zero. -#define ERR_INVALID_ROTATION_MODE -1074396058 // Invalid rotation mode. -#define ERR_INVALID_SEARCH_VECTOR_WIDTH \ - -1074396057 // Invalid search vector width. The width must be an odd number - // greater than zero. -#define ERR_INVALID_MATRIX_MIRROR_MODE \ - -1074396056 // Invalid matrix mirror mode. -#define ERR_INVALID_ASPECT_RATIO \ - -1074396055 // Invalid aspect ratio. Valid aspect ratios must be greater than - // or equal to zero. -#define ERR_INVALID_CELL_FILL_TYPE -1074396054 // Invalid cell fill type. -#define ERR_INVALID_BORDER_INTEGRITY \ - -1074396053 // Invalid border integrity. Valid values range from 0 to 100. -#define ERR_INVALID_DEMODULATION_MODE -1074396052 // Invalid demodulation mode. -#define ERR_INVALID_CELL_FILTER_MODE -1074396051 // Invalid cell filter mode. -#define ERR_INVALID_ECC_TYPE -1074396050 // Invalid ECC type. -#define ERR_INVALID_MATRIX_POLARITY -1074396049 // Invalid matrix polarity. -#define ERR_INVALID_CELL_SAMPLE_SIZE -1074396048 // Invalid cell sample size. -#define ERR_INVALID_LINEAR_AVERAGE_MODE \ - -1074396047 // Invalid linear average mode. -#define ERR_INVALID_2D_BARCODE_CONTRAST_FOR_ROI \ - -1074396046 // When using a region of interest that is not a rectangle, you - // must specify the contrast mode of the barcode as either black - // on white or white on black. -#define ERR_INVALID_2D_BARCODE_SUBTYPE \ - -1074396045 // Invalid 2-D barcode Data Matrix subtype. -#define ERR_INVALID_2D_BARCODE_SHAPE -1074396044 // Invalid 2-D barcode shape. -#define ERR_INVALID_2D_BARCODE_CELL_SHAPE \ - -1074396043 // Invalid 2-D barcode cell shape. -#define ERR_INVALID_2D_BARCODE_CONTRAST \ - -1074396042 // Invalid 2-D barcode contrast. -#define ERR_INVALID_2D_BARCODE_TYPE -1074396041 // Invalid 2-D barcode type. -#define ERR_DRIVER -1074396040 // Cannot access NI-IMAQ driver. -#define ERR_IO_ERROR -1074396039 // I/O error. -#define ERR_FIND_COORDSYS_MORE_THAN_ONE_EDGE \ - -1074396038 // When searching for a coordinate system, the number of lines to - // fit must be 1. -#define ERR_TIMEOUT -1074396037 // Trigger timeout. -#define ERR_INVALID_SKELETONMODE \ - -1074396036 // The Skeleton mode you specified is invalid. -#define ERR_TEMPLATEIMAGE_NOCIRCLE \ - -1074396035 // The template image does not contain enough information for - // learning the aggressive search strategy. -#define ERR_TEMPLATEIMAGE_EDGEINFO \ - -1074396034 // The template image does not contain enough edge information - // for the sample size(s) requested. -#define ERR_TEMPLATEDESCRIPTOR_LEARNSETUPDATA \ - -1074396033 // Invalid template descriptor. -#define ERR_TEMPLATEDESCRIPTOR_ROTATION_SEARCHSTRATEGY \ - -1074396032 // The template descriptor does not contain data required for the - // requested search strategy in rotation-invariant matching. -#define ERR_INVALID_TETRAGON \ - -1074396031 // The input tetragon must have four points. The points are - // specified clockwise starting with the top left point. -#define ERR_TOO_MANY_CLASSIFICATION_SESSIONS \ - -1074396030 // There are too many classification sessions open. You must - // close a session before you can open another one. -#define ERR_TIME_BOUNDED_EXECUTION_NOT_SUPPORTED \ - -1074396028 // NI Vision no longer supports time-bounded execution. -#define ERR_INVALID_COLOR_RESOLUTION \ - -1074396027 // Invalid Color Resolution for the Color Classifier -#define ERR_INVALID_PROCESS_TYPE_FOR_EDGE_DETECTION \ - -1074396026 // Invalid process type for edge detection. -#define ERR_INVALID_ANGLE_RANGE_FOR_STRAIGHT_EDGE \ - -1074396025 // Angle range value should be equal to or greater than zero. -#define ERR_INVALID_MIN_COVERAGE_FOR_STRAIGHT_EDGE \ - -1074396024 // Minimum coverage value should be greater than zero. -#define ERR_INVALID_ANGLE_TOL_FOR_STRAIGHT_EDGE \ - -1074396023 // The angle tolerance should be equal to or greater than 0.001. -#define ERR_INVALID_SEARCH_MODE_FOR_STRAIGHT_EDGE \ - -1074396022 // Invalid search mode for detecting straight edges -#define ERR_INVALID_KERNEL_SIZE_FOR_EDGE_DETECTION \ - -1074396021 // Invalid kernel size for edge detection. The minimum kernel - // size is 3, the maximum kernel size is 1073741823 and the - // kernel size must be odd. -#define ERR_INVALID_GRADING_MODE -1074396020 // Invalid grading mode. -#define ERR_INVALID_THRESHOLD_PERCENTAGE \ - -1074396019 // Invalid threshold percentage. Valid values range from 0 to - // 100. -#define ERR_INVALID_EDGE_POLARITY_SEARCH_MODE \ - -1074396018 // Invalid edge polarity search mode. -#define ERR_OPENING_NEWER_AIM_GRADING_DATA \ - -1074396017 // The AIM grading data attached to the image you tried to open - // was created with a newer version of NI Vision. Upgrade to the - // latest version of NI Vision to read this file. -#define ERR_NO_VIDEO_DRIVER -1074396016 // No video driver is installed. -#define ERR_RPC_EXECUTE_IVB \ - -1074396015 // Unable to establish network connection with remote system. -#define ERR_INVALID_VIDEO_BLIT \ - -1074396014 // RT Video Out does not support displaying the supplied image - // type at the selected color depth. -#define ERR_INVALID_VIDEO_MODE -1074396013 // Invalid video mode. -#define ERR_RPC_EXECUTE \ - -1074396012 // Unable to display remote image on network connection. -#define ERR_RPC_BIND -1074396011 // Unable to establish network connection. -#define ERR_INVALID_FRAME_NUMBER -1074396010 // Invalid frame number. -#define ERR_DIRECTX \ - -1074396009 // An internal DirectX error has occurred. Try upgrading to the - // latest version of DirectX. -#define ERR_DIRECTX_NO_FILTER \ - -1074396008 // An appropriate DirectX filter to process this file could not - // be found. Install the filter that was used to create this - // AVI. Upgrading to the latest version of DirectX may correct - // this error. NI Vision requires DirectX 8.1 or higher. -#define ERR_DIRECTX_INCOMPATIBLE_COMPRESSION_FILTER \ - -1074396007 // Incompatible compression filter. -#define ERR_DIRECTX_UNKNOWN_COMPRESSION_FILTER \ - -1074396006 // Unknown compression filter. -#define ERR_INVALID_AVI_SESSION -1074396005 // Invalid AVI session. -#define ERR_DIRECTX_CERTIFICATION_FAILURE \ - -1074396004 // A software key is restricting the use of this compression - // filter. -#define ERR_AVI_DATA_EXCEEDS_BUFFER_SIZE \ - -1074396003 // The data for this frame exceeds the data buffer size specified - // when creating the AVI file. -#define ERR_INVALID_LINEGAUGEMETHOD -1074396002 // Invalid line gauge method. -#define ERR_TOO_MANY_AVI_SESSIONS \ - -1074396001 // There are too many AVI sessions open. You must close a - // session before you can open another one. -#define ERR_FILE_FILE_HEADER -1074396000 // Invalid file header. -#define ERR_FILE_FILE_TYPE -1074395999 // Invalid file type. -#define ERR_FILE_COLOR_TABLE -1074395998 // Invalid color table. -#define ERR_FILE_ARGERR -1074395997 // Invalid parameter. -#define ERR_FILE_OPEN -1074395996 // File is already open for writing. -#define ERR_FILE_NOT_FOUND -1074395995 // File not found. -#define ERR_FILE_TOO_MANY_OPEN -1074395994 // Too many files open. -#define ERR_FILE_IO_ERR -1074395993 // File I/O error. -#define ERR_FILE_PERMISSION -1074395992 // File access denied. -#define ERR_FILE_INVALID_TYPE \ - -1074395991 // NI Vision does not support the file type you specified. -#define ERR_FILE_GET_INFO -1074395990 // Could not read Vision info from file. -#define ERR_FILE_READ -1074395989 // Unable to read data. -#define ERR_FILE_WRITE -1074395988 // Unable to write data. -#define ERR_FILE_EOF -1074395987 // Premature end of file. -#define ERR_FILE_FORMAT -1074395986 // Invalid file format. -#define ERR_FILE_OPERATION -1074395985 // Invalid file operation. -#define ERR_FILE_INVALID_DATA_TYPE \ - -1074395984 // NI Vision does not support the file data type you specified. -#define ERR_FILE_NO_SPACE -1074395983 // Disk full. -#define ERR_INVALID_FRAMES_PER_SECOND \ - -1074395982 // The frames per second in an AVI must be greater than zero. -#define ERR_INSUFFICIENT_BUFFER_SIZE \ - -1074395981 // The buffer that was passed in is not big enough to hold all of - // the data. -#define ERR_COM_INITIALIZE -1074395980 // Error initializing COM. -#define ERR_INVALID_PARTICLE_INFO \ - -1074395979 // The image has invalid particle information. Call - // imaqCountParticles on the image to create particle - // information. -#define ERR_INVALID_PARTICLE_NUMBER -1074395978 // Invalid particle number. -#define ERR_AVI_VERSION \ - -1074395977 // The AVI file was created in a newer version of NI Vision. - // Upgrade to the latest version of NI Vision to read this AVI - // file. -#define ERR_NUMBER_OF_PALETTE_COLORS \ - -1074395976 // The color palette must have exactly 0 or 256 entries. -#define ERR_AVI_TIMEOUT \ - -1074395975 // DirectX has timed out reading or writing the AVI file. When - // closing an AVI file, try adding an additional delay. When - // reading an AVI file, try reducing CPU and disk load. -#define ERR_UNSUPPORTED_JPEG2000_COLORSPACE_METHOD \ - -1074395974 // NI Vision does not support reading JPEG2000 files with this - // colorspace method. -#define ERR_JPEG2000_UNSUPPORTED_MULTIPLE_LAYERS \ - -1074395973 // NI Vision does not support reading JPEG2000 files with more - // than one layer. -#define ERR_DIRECTX_ENUMERATE_FILTERS \ - -1074395972 // DirectX is unable to enumerate the compression filters. This - // is caused by a third-party compression filter that is either - // improperly installed or is preventing itself from being - // enumerated. Remove any recently installed compression filters - // and try again. -#define ERR_INVALID_OFFSET \ - -1074395971 // The offset you specified must be size 2. -#define ERR_INIT -1074395960 // Initialization error. -#define ERR_CREATE_WINDOW -1074395959 // Unable to create window. -#define ERR_WINDOW_ID -1074395958 // Invalid window ID. -#define ERR_ARRAY_SIZE_MISMATCH \ - -1074395957 // The array sizes are not compatible. -#define ERR_INVALID_QUALITY \ - -1074395956 // The quality you provided is invalid. Valid quality values - // range from -1 to 1000. -#define ERR_INVALID_MAX_WAVELET_TRANSFORM_LEVEL \ - -1074395955 // Invalid maximum wavelet transform level. Valid values range - // from 0 to 255. -#define ERR_INVALID_QUANTIZATION_STEP_SIZE \ - -1074395954 // The quantization step size must be greater than or equal to 0. -#define ERR_INVALID_WAVELET_TRANSFORM_MODE \ - -1074395953 // Invalid wavelet transform mode. -#define ERR_ROI_NOT_POINT \ - -1074395952 // The ROI must only have a single Point contour. -#define ERR_ROI_NOT_POINTS \ - -1074395951 // The ROI must only have Point contours. -#define ERR_ROI_NOT_LINE \ - -1074395950 // The ROI must only have a single Line contour. -#define ERR_ROI_NOT_ANNULUS \ - -1074395949 // The ROI must only have a single Annulus contour. -#define ERR_INVALID_MEASURE_PARTICLES_CALIBRATION_MODE \ - -1074395948 // Invalid measure particles calibration mode. -#define ERR_INVALID_PARTICLE_CLASSIFIER_THRESHOLD_TYPE \ - -1074395947 // Invalid particle classifier threshold type. -#define ERR_INVALID_DISTANCE -1074395946 // Invalid Color Segmentation Distance -#define ERR_INVALID_PARTICLE_AREA \ - -1074395945 // Invalid Color Segmenation Particle Area -#define ERR_CLASS_NAME_NOT_FOUND \ - -1074395944 // Required Class name is not found in trained labels/Class names -#define ERR_NUMBER_LABEL_LIMIT_EXCEEDED \ - -1074395943 // Number of Labels exceeded limit of label Image type -#define ERR_INVALID_DISTANCE_LEVEL \ - -1074395942 // Invalid Color Segmentation distance level -#define ERR_INVALID_SVM_TYPE -1074395941 // Invalid SVM model type -#define ERR_INVALID_SVM_KERNEL -1074395940 // Invalid SVM kernel type -#define ERR_NO_SUPPORT_VECTOR_FOUND \ - -1074395939 // No Support Vector is found at SVM training -#define ERR_COST_LABEL_NOT_FOUND \ - -1074395938 // Label name is not found in added samples -#define ERR_EXCEEDED_SVM_MAX_ITERATION \ - -1074395937 // SVM training exceeded maximim Iteration limit -#define ERR_INVALID_SVM_PARAMETER -1074395936 // Invalid SVM Parameter -#define ERR_INVALID_IDENTIFICATION_SCORE \ - -1074395935 // Invalid Identification score. Must be between 0-1000. -#define ERR_INVALID_TEXTURE_FEATURE \ - -1074395934 // Requested for invalid texture feature -#define ERR_INVALID_COOCCURRENCE_LEVEL \ - -1074395933 // The coOccurrence Level must lie between 1 and the maximum - // pixel value of an image (255 for U8 image) -#define ERR_INVALID_WAVELET_SUBBAND \ - -1074395932 // Request for invalid wavelet subBand -#define ERR_INVALID_FINAL_STEP_SIZE \ - -1074395931 // The final step size must be lesser than the initial step size -#define ERR_INVALID_ENERGY \ - -1074395930 // Minimum Energy should lie between 0 and 100 -#define ERR_INVALID_TEXTURE_LABEL \ - -1074395929 // The classification label must be texture or defect for texture - // defect classifier -#define ERR_INVALID_WAVELET_TYPE -1074395928 // The wavelet type is invalid -#define ERR_SAME_WAVELET_BANDS_SELECTED \ - -1074395927 // Same Wavelet band is selected multiple times -#define ERR_IMAGE_SIZE_MISMATCH \ - -1074395926 // The two input image sizes are different -#define ERR_NUMBER_CLASS -1074395920 // Invalid number of classes. -#define ERR_INVALID_LUCAS_KANADE_WINDOW_SIZE \ - -1074395888 // Both dimensions of the window size should be odd, greater than - // 2 and less than 16. -#define ERR_INVALID_MATRIX_TYPE \ - -1074395887 // The type of matrix supplied to the function is not supported. -#define ERR_INVALID_OPTICAL_FLOW_TERMINATION_CRITERIA_TYPE \ - -1074395886 // An invalid termination criteria was specified for the optical - // flow computation. -#define ERR_LKP_NULL_PYRAMID \ - -1074395885 // The pyramid levels where not properly allocated. -#define ERR_INVALID_PYRAMID_LEVEL \ - -1074395884 // The pyramid level specified cannot be negative -#define ERR_INVALID_LKP_KERNEL \ - -1074395883 // The kernel must be symmetric with non-zero coefficients and - // of odd size -#define ERR_INVALID_HORN_SCHUNCK_LAMBDA \ - -1074395882 // Invalid smoothing parameter in Horn Schunck operation. -#define ERR_INVALID_HORN_SCHUNCK_TYPE \ - -1074395881 // Invalid stopping criteria type for Horn Schunck optical flow. -#define ERR_PARTICLE -1074395880 // Invalid particle. -#define ERR_BAD_MEASURE -1074395879 // Invalid measure number. -#define ERR_PROP_NODE_WRITE_NOT_SUPPORTED \ - -1074395878 // The Image Display control does not support writing this - // property node. -#define ERR_COLORMODE_REQUIRES_CHANGECOLORSPACE2 \ - -1074395877 // The specified color mode requires the use of - // imaqChangeColorSpace2. -#define ERR_UNSUPPORTED_COLOR_MODE \ - -1074395876 // This function does not currently support the color mode you - // specified. -#define ERR_BARCODE_PHARMACODE \ - -1074395875 // The barcode is not a valid Pharmacode symbol -#define ERR_BAD_INDEX -1074395840 // Invalid handle table index. -#define ERR_INVALID_COMPRESSION_RATIO \ - -1074395837 // The compression ratio must be greater than or equal to 1. -#define ERR_TOO_MANY_CONTOURS \ - -1074395801 // The ROI contains too many contours. -#define ERR_PROTECTION -1074395800 // Protection error. -#define ERR_INTERNAL -1074395799 // Internal error. -#define ERR_INVALID_CUSTOM_SAMPLE \ - -1074395798 // The size of the feature vector in the custom sample must match - // the size of those you have already added. -#define ERR_INVALID_CLASSIFIER_SESSION \ - -1074395797 // Not a valid classifier session. -#define ERR_INVALID_KNN_METHOD \ - -1074395796 // You requested an invalid Nearest Neighbor classifier method. -#define ERR_K_TOO_LOW -1074395795 // The k parameter must be greater than two. -#define ERR_K_TOO_HIGH \ - -1074395794 // The k parameter must be <= the number of samples in each - // class. -#define ERR_INVALID_OPERATION_ON_COMPACT_SESSION_ATTEMPTED \ - -1074395793 // This classifier session is compact. Only the Classify and - // Dispose functions may be called on a compact classifier - // session. -#define ERR_CLASSIFIER_SESSION_NOT_TRAINED \ - -1074395792 // This classifier session is not trained. You may only call this - // function on a trained classifier session. -#define ERR_CLASSIFIER_INVALID_SESSION_TYPE \ - -1074395791 // This classifier function cannot be called on this type of - // classifier session. -#define ERR_INVALID_DISTANCE_METRIC \ - -1074395790 // You requested an invalid distance metric. -#define ERR_OPENING_NEWER_CLASSIFIER_SESSION \ - -1074395789 // The classifier session you tried to open was created with a - // newer version of NI Vision. Upgrade to the latest version of - // NI Vision to read this file. -#define ERR_NO_SAMPLES \ - -1074395788 // This operation cannot be performed because you have not added - // any samples. -#define ERR_INVALID_CLASSIFIER_TYPE \ - -1074395787 // You requested an invalid classifier type. -#define ERR_INVALID_PARTICLE_OPTIONS \ - -1074395786 // The sum of Scale Dependence and Symmetry Dependence must be - // less than 1000. -#define ERR_NO_PARTICLE -1074395785 // The image yielded no particles. -#define ERR_INVALID_LIMITS \ - -1074395784 // The limits you supplied are not valid. -#define ERR_BAD_SAMPLE_INDEX \ - -1074395783 // The Sample Index fell outside the range of Samples. -#define ERR_DESCRIPTION_TOO_LONG \ - -1074395782 // The description must be <= 255 characters. -#define ERR_CLASSIFIER_INVALID_ENGINE_TYPE \ - -1074395781 // The engine for this classifier session does not support this - // operation. -#define ERR_INVALID_PARTICLE_TYPE \ - -1074395780 // You requested an invalid particle type. -#define ERR_CANNOT_COMPACT_UNTRAINED \ - -1074395779 // You may only save a session in compact form if it is trained. -#define ERR_INVALID_KERNEL_SIZE \ - -1074395778 // The Kernel size must be smaller than the image size. -#define ERR_INCOMPATIBLE_CLASSIFIER_TYPES \ - -1074395777 // The session you read from file must be the same type as the - // session you passed in. -#define ERR_INVALID_USE_OF_COMPACT_SESSION_FILE \ - -1074395776 // You can not use a compact classification file with read - // options other than Read All. -#define ERR_ROI_HAS_OPEN_CONTOURS \ - -1074395775 // The ROI you passed in may only contain closed contours. -#define ERR_NO_LABEL -1074395774 // You must pass in a label. -#define ERR_NO_DEST_IMAGE -1074395773 // You must provide a destination image. -#define ERR_INVALID_REGISTRATION_METHOD \ - -1074395772 // You provided an invalid registration method. -#define ERR_OPENING_NEWER_INSPECTION_TEMPLATE \ - -1074395771 // The golden template you tried to open was created with a newer - // version of NI Vision. Upgrade to the latest version of NI - // Vision to read this file. -#define ERR_INVALID_INSPECTION_TEMPLATE -1074395770 // Invalid golden template. -#define ERR_INVALID_EDGE_THICKNESS \ - -1074395769 // Edge Thickness to Ignore must be greater than zero. -#define ERR_INVALID_SCALE -1074395768 // Scale must be greater than zero. -#define ERR_INVALID_ALIGNMENT \ - -1074395767 // The supplied scale is invalid for your template. -#define ERR_DEPRECATED_FUNCTION \ - -1074395766 // This backwards-compatibility function can not be used with - // this session. Use newer, supported functions instead. -#define ERR_INVALID_NORMALIZATION_METHOD \ - -1074395763 // You must provide a valid normalization method. -#define ERR_INVALID_NIBLACK_DEVIATION_FACTOR \ - -1074395762 // The deviation factor for Niblack local threshold must be - // between 0 and 1. -#define ERR_BOARD_NOT_FOUND -1074395760 // Board not found. -#define ERR_BOARD_NOT_OPEN -1074395758 // Board not opened. -#define ERR_DLL_NOT_FOUND -1074395757 // DLL not found. -#define ERR_DLL_FUNCTION_NOT_FOUND -1074395756 // DLL function not found. -#define ERR_TRIG_TIMEOUT -1074395754 // Trigger timeout. -#define ERR_CONTOUR_INVALID_REFINEMENTS \ - -1074395746 // Invalid number specified for maximum contour refinements. -#define ERR_TOO_MANY_CURVES \ - -1074395745 // Too many curves extracted from image. Raise the edge threshold - // or reduce the ROI. -#define ERR_CONTOUR_INVALID_KERNEL_FOR_SMOOTHING \ - -1074395744 // Invalid kernel for contour smoothing. Zero indicates no - // smoothing, otherwise value must be odd. -#define ERR_CONTOUR_LINE_INVALID \ - -1074395743 // The contour line fit is invalid. Line segment start and stop - // must differ. -#define ERR_CONTOUR_TEMPLATE_IMAGE_INVALID \ - -1074395742 // The template image must be trained with IMAQ Learn Contour - // Pattern or be the same size as the target image. -#define ERR_CONTOUR_GPM_FAIL \ - -1074395741 // Matching failed to align the template and target contours. -#define ERR_CONTOUR_OPENING_NEWER_VERSION \ - -1074395740 // The contour you tried to open was created with a newer version - // of NI Vision. Upgrade to the latest version of NI Vision to - // read this file. -#define ERR_CONTOUR_CONNECT_DUPLICATE \ - -1074395739 // Only one range is allowed per curve connection constraint - // type. -#define ERR_CONTOUR_CONNECT_TYPE \ - -1074395738 // Invalid contour connection constraint type. -#define ERR_CONTOUR_MATCH_STR_NOT_APPLICABLE \ - -1074395737 // In order to use contour matching, you must provide a template - // image that has been trained with IMAQ Learn Contour Pattern -#define ERR_CONTOUR_CURVATURE_KERNEL \ - -1074395736 // Invalid kernel width for curvature calculation. Must be an odd - // value greater than 1. -#define ERR_CONTOUR_EXTRACT_SELECTION \ - -1074395735 // Invalid Contour Selection method for contour extraction. -#define ERR_CONTOUR_EXTRACT_DIRECTION \ - -1074395734 // Invalid Search Direction for contour extraction. -#define ERR_CONTOUR_EXTRACT_ROI \ - -1074395733 // Invalid ROI for contour extraction. The ROI must contain an - // annulus, rectangle or rotated rectangle. -#define ERR_CONTOUR_NO_CURVES -1074395732 // No curves were found in the image. -#define ERR_CONTOUR_COMPARE_KERNEL \ - -1074395731 // Invalid Smoothing Kernel width for contour comparison. Must be - // zero or an odd positive integer. -#define ERR_CONTOUR_COMPARE_SINGLE_IMAGE \ - -1074395730 // If no template image is provided, the target image must - // contain both a contour with extracted points and a fitted - // equation. -#define ERR_CONTOUR_INVALID -1074395729 // Invalid contour image. -#define ERR_INVALID_2D_BARCODE_SEARCH_MODE \ - -1074395728 // NI Vision does not support the search mode you provided. -#define ERR_UNSUPPORTED_2D_BARCODE_SEARCH_MODE \ - -1074395727 // NI Vision does not support the search mode you provided for - // the type of 2D barcode for which you are searching. -#define ERR_MATCHFACTOR_OBSOLETE \ - -1074395726 // matchFactor has been obsoleted. Instead, set the - // initialMatchListLength and matchListReductionFactor in the - // MatchPatternAdvancedOptions structure. -#define ERR_DATA_VERSION \ - -1074395725 // The data was stored with a newer version of NI Vision. Upgrade - // to the latest version of NI Vision to read this data. -#define ERR_CUSTOMDATA_INVALID_SIZE \ - -1074395724 // The size you specified is out of the valid range. -#define ERR_CUSTOMDATA_KEY_NOT_FOUND \ - -1074395723 // The key you specified cannot be found in the image. -#define ERR_CLASSIFIER_CLASSIFY_IMAGE_WITH_CUSTOM_SESSION \ - -1074395722 // Custom classifier sessions only classify feature vectors. They - // do not support classifying images. -#define ERR_INVALID_BIT_DEPTH \ - -1074395721 // NI Vision does not support the bit depth you supplied for the - // image you supplied. -#define ERR_BAD_ROI -1074395720 // Invalid ROI. -#define ERR_BAD_ROI_BOX -1074395719 // Invalid ROI global rectangle. -#define ERR_LAB_VERSION \ - -1074395718 // The version of LabVIEW or BridgeVIEW you are running does not - // support this operation. -#define ERR_INVALID_RANGE -1074395717 // The range you supplied is invalid. -#define ERR_INVALID_SCALING_METHOD \ - -1074395716 // NI Vision does not support the scaling method you provided. -#define ERR_INVALID_CALIBRATION_UNIT \ - -1074395715 // NI Vision does not support the calibration unit you supplied. -#define ERR_INVALID_AXIS_ORIENTATION \ - -1074395714 // NI Vision does not support the axis orientation you supplied. -#define ERR_VALUE_NOT_IN_ENUM -1074395713 // Value not in enumeration. -#define ERR_WRONG_REGION_TYPE \ - -1074395712 // You selected a region that is not of the right type. -#define ERR_NOT_ENOUGH_REGIONS \ - -1074395711 // You specified a viewer that does not contain enough regions. -#define ERR_TOO_MANY_PARTICLES \ - -1074395710 // The image has too many particles for this process. -#define ERR_AVI_UNOPENED_SESSION \ - -1074395709 // The AVI session has not been opened. -#define ERR_AVI_READ_SESSION_REQUIRED \ - -1074395708 // The AVI session is a write session, but this operation - // requires a read session. -#define ERR_AVI_WRITE_SESSION_REQUIRED \ - -1074395707 // The AVI session is a read session, but this operation requires - // a write session. -#define ERR_AVI_SESSION_ALREADY_OPEN \ - -1074395706 // This AVI session is already open. You must close it before - // calling the Create or Open functions. -#define ERR_DATA_CORRUPTED \ - -1074395705 // The data is corrupted and cannot be read. -#define ERR_INVALID_COMPRESSION_TYPE -1074395704 // Invalid compression type. -#define ERR_INVALID_TYPE_OF_FLATTEN -1074395703 // Invalid type of flatten. -#define ERR_INVALID_LENGTH \ - -1074395702 // The length of the edge detection line must be greater than - // zero. -#define ERR_INVALID_MATRIX_SIZE_RANGE \ - -1074395701 // The maximum Data Matrix barcode size must be equal to or - // greater than the minimum Data Matrix barcode size. -#define ERR_REQUIRES_WIN2000_OR_NEWER \ - -1074395700 // The function requires the operating system to be Microsoft - // Windows 2000 or newer. -#define ERR_INVALID_CALIBRATION_METHOD \ - -1074395662 // Invalid calibration method requested -#define ERR_INVALID_OPERATION_ON_COMPACT_CALIBRATION_ATTEMPTED \ - -1074395661 // This calibration is compact. Re-Learning calibration and - // retrieving thumbnails are not possible with this calibration -#define ERR_INVALID_POLYNOMIAL_MODEL_K_COUNT \ - -1074395660 // Invalid number of K values -#define ERR_INVALID_DISTORTION_MODEL \ - -1074395659 // Invalid distortion model type -#define ERR_CAMERA_MODEL_NOT_AVAILABLE \ - -1074395658 // Camera Model is not learned -#define ERR_INVALID_THUMBNAIL_INDEX \ - -1074395657 // Supplied thumbnail index is invalid -#define ERR_SMOOTH_CONTOURS_MUST_BE_SAME \ - -1074395656 // You must specify the same value for the smooth contours - // advanced match option for all templates you want to match. -#define ERR_ENABLE_CALIBRATION_SUPPORT_MUST_BE_SAME \ - -1074395655 // You must specify the same value for the enable calibration - // support advanced match option for all templates you want to - // match. -#define ERR_GRADING_INFORMATION_NOT_FOUND \ - -1074395654 // The source image does not contain grading information. You - // must prepare the source image for grading when reading the - // Data Matrix, and you cannot change the contents of the source - // image between reading and grading the Data Matrix. -#define ERR_OPENING_NEWER_MULTIPLE_GEOMETRIC_TEMPLATE \ - -1074395653 // The multiple geometric matching template you tried to open was - // created with a newer version of NI Vision. Upgrade to the - // latest version of NI Vision to read this file. -#define ERR_OPENING_NEWER_GEOMETRIC_MATCHING_TEMPLATE \ - -1074395652 // The geometric matching template you tried to open was created - // with a newer version of NI Vision. Upgrade to the latest - // version of NI Vision to read this file. -#define ERR_EDGE_FILTER_SIZE_MUST_BE_SAME \ - -1074395651 // You must specify the same edge filter size for all the - // templates you want to match. -#define ERR_CURVE_EXTRACTION_MODE_MUST_BE_SAME \ - -1074395650 // You must specify the same curve extraction mode for all the - // templates you want to match. -#define ERR_INVALID_GEOMETRIC_FEATURE_TYPE \ - -1074395649 // The geometric feature type specified is invalid. -#define ERR_TEMPLATE_NOT_LEARNED \ - -1074395648 // You supplied a template that was not learned. -#define ERR_INVALID_MULTIPLE_GEOMETRIC_TEMPLATE \ - -1074395647 // Invalid multiple geometric template. -#define ERR_NO_TEMPLATE_TO_LEARN \ - -1074395646 // Need at least one template to learn. -#define ERR_INVALID_NUMBER_OF_LABELS \ - -1074395645 // You supplied an invalid number of labels. -#define ERR_LABEL_TOO_LONG -1074395644 // Labels must be <= 255 characters. -#define ERR_INVALID_NUMBER_OF_MATCH_OPTIONS \ - -1074395643 // You supplied an invalid number of match options. -#define ERR_LABEL_NOT_FOUND \ - -1074395642 // Cannot find a label that matches the one you specified. -#define ERR_DUPLICATE_LABEL -1074395641 // Duplicate labels are not allowed. -#define ERR_TOO_MANY_ZONES \ - -1074395640 // The number of zones found exceeded the capacity of the - // algorithm. -#define ERR_INVALID_HATCH_STYLE \ - -1074395639 // The hatch style for the window background is invalid. -#define ERR_INVALID_FILL_STYLE \ - -1074395638 // The fill style for the window background is invalid. -#define ERR_HARDWARE_DOESNT_SUPPORT_NONTEARING \ - -1074395637 // Your hardware is not supported by DirectX and cannot be put - // into NonTearing mode. -#define ERR_DIRECTX_NOT_FOUND \ - -1074395636 // DirectX is required for this feature. Please install the - // latest version.. -#define ERR_INVALID_SHAPE_DESCRIPTOR \ - -1074395635 // The passed shape descriptor is invalid. -#define ERR_INVALID_MAX_MATCH_OVERLAP \ - -1074395634 // Invalid max match overlap. Values must be between -1 and 100. -#define ERR_INVALID_MIN_MATCH_SEPARATION_SCALE \ - -1074395633 // Invalid minimum match separation scale. Values must be - // greater than or equal to -1. -#define ERR_INVALID_MIN_MATCH_SEPARATION_ANGLE \ - -1074395632 // Invalid minimum match separation angle. Values must be - // between -1 and 360. -#define ERR_INVALID_MIN_MATCH_SEPARATION_DISTANCE \ - -1074395631 // Invalid minimum match separation distance. Values must be - // greater than or equal to -1. -#define ERR_INVALID_MAXIMUM_FEATURES_LEARNED \ - -1074395630 // Invalid maximum number of features learn. Values must be - // integers greater than zero. -#define ERR_INVALID_MAXIMUM_PIXEL_DISTANCE_FROM_LINE \ - -1074395629 // Invalid maximum pixel distance from line. Values must be - // positive real numbers. -#define ERR_INVALID_GEOMETRIC_MATCHING_TEMPLATE \ - -1074395628 // Invalid geometric matching template image. -#define ERR_NOT_ENOUGH_TEMPLATE_FEATURES_1 \ - -1074395627 // The template does not contain enough features for geometric - // matching. -#define ERR_NOT_ENOUGH_TEMPLATE_FEATURES \ - -1074395626 // The template does not contain enough features for geometric - // matching. -#define ERR_INVALID_MATCH_CONSTRAINT_TYPE \ - -1074395625 // You specified an invalid value for the match constraint value - // of the range settings. -#define ERR_INVALID_OCCLUSION_RANGE \ - -1074395624 // Invalid occlusion range. Valid values for the bounds range - // from 0 to 100 and the upper bound must be greater than or - // equal to the lower bound. -#define ERR_INVALID_SCALE_RANGE \ - -1074395623 // Invalid scale range. Values for the lower bound must be a - // positive real numbers and the upper bound must be greater than - // or equal to the lower bound. -#define ERR_INVALID_MATCH_GEOMETRIC_PATTERN_SETUP_DATA \ - -1074395622 // Invalid match geometric pattern setup data. -#define ERR_INVALID_LEARN_GEOMETRIC_PATTERN_SETUP_DATA \ - -1074395621 // Invalid learn geometric pattern setup data. -#define ERR_INVALID_CURVE_EXTRACTION_MODE \ - -1074395620 // Invalid curve extraction mode. -#define ERR_TOO_MANY_OCCLUSION_RANGES \ - -1074395619 // You can specify only one occlusion range. -#define ERR_TOO_MANY_SCALE_RANGES \ - -1074395618 // You can specify only one scale range. -#define ERR_INVALID_NUMBER_OF_FEATURES_RANGE \ - -1074395617 // The minimum number of features must be less than or equal to - // the maximum number of features. -#define ERR_INVALID_EDGE_FILTER_SIZE -1074395616 // Invalid edge filter size. -#define ERR_INVALID_MINIMUM_FEATURE_STRENGTH \ - -1074395615 // Invalid minimum strength for features. Values must be positive - // real numbers. -#define ERR_INVALID_MINIMUM_FEATURE_ASPECT_RATIO \ - -1074395614 // Invalid aspect ratio for rectangular features. Values must be - // positive real numbers in the range 0.01 to 1.0. -#define ERR_INVALID_MINIMUM_FEATURE_LENGTH \ - -1074395613 // Invalid minimum length for linear features. Values must be - // integers greater than 0. -#define ERR_INVALID_MINIMUM_FEATURE_RADIUS \ - -1074395612 // Invalid minimum radius for circular features. Values must be - // integers greater than 0. -#define ERR_INVALID_MINIMUM_RECTANGLE_DIMENSION \ - -1074395611 // Invalid minimum rectangle dimension. Values must be integers - // greater than 0. -#define ERR_INVALID_INITIAL_MATCH_LIST_LENGTH \ - -1074395610 // Invalid initial match list length. Values must be integers - // greater than 5. -#define ERR_INVALID_SUBPIXEL_TOLERANCE \ - -1074395609 // Invalid subpixel tolerance. Values must be positive real - // numbers. -#define ERR_INVALID_SUBPIXEL_ITERATIONS \ - -1074395608 // Invalid number of subpixel iterations. Values must be integers - // greater 10. -#define ERR_INVALID_MAXIMUM_FEATURES_PER_MATCH \ - -1074395607 // Invalid maximum number of features used per match. Values must - // be integers greater than or equal to zero. -#define ERR_INVALID_MINIMUM_FEATURES_TO_MATCH \ - -1074395606 // Invalid minimum number of features used for matching. Values - // must be integers greater than zero. -#define ERR_INVALID_MAXIMUM_END_POINT_GAP \ - -1074395605 // Invalid maximum end point gap. Valid values range from 0 to - // 32767. -#define ERR_INVALID_COLUMN_STEP \ - -1074395604 // Invalid column step. Valid range is 1 to 255. -#define ERR_INVALID_ROW_STEP \ - -1074395603 // Invalid row step. Valid range is 1 to 255. -#define ERR_INVALID_MINIMUM_CURVE_LENGTH \ - -1074395602 // Invalid minimum length. Valid values must be greater than or - // equal to zero. -#define ERR_INVALID_EDGE_THRESHOLD \ - -1074395601 // Invalid edge threshold. Valid values range from 1 to 360. -#define ERR_INFO_NOT_FOUND \ - -1074395600 // You must provide information about the subimage within the - // browser. -#define ERR_NIOCR_INVALID_ACCEPTANCE_LEVEL \ - -1074395598 // The acceptance level is outside the valid range of 0 to 1000. -#define ERR_NIOCR_NOT_A_VALID_SESSION -1074395597 // Not a valid OCR session. -#define ERR_NIOCR_INVALID_CHARACTER_SIZE \ - -1074395596 // Invalid character size. Character size must be >= 1. -#define ERR_NIOCR_INVALID_THRESHOLD_MODE \ - -1074395595 // Invalid threshold mode value. -#define ERR_NIOCR_INVALID_SUBSTITUTION_CHARACTER \ - -1074395594 // Invalid substitution character. Valid substitution characters - // are ASCII values that range from 1 to 254. -#define ERR_NIOCR_INVALID_NUMBER_OF_BLOCKS \ - -1074395593 // Invalid number of blocks. Number of blocks must be >= 4 and <= - // 50. -#define ERR_NIOCR_INVALID_READ_STRATEGY -1074395592 // Invalid read strategy. -#define ERR_NIOCR_INVALID_CHARACTER_INDEX \ - -1074395591 // Invalid character index. -#define ERR_NIOCR_INVALID_NUMBER_OF_VALID_CHARACTER_POSITIONS \ - -1074395590 // Invalid number of character positions. Valid values range from - // 0 to 255. -#define ERR_NIOCR_INVALID_LOW_THRESHOLD_VALUE \ - -1074395589 // Invalid low threshold value. Valid threshold values range from - // 0 to 255. -#define ERR_NIOCR_INVALID_HIGH_THRESHOLD_VALUE \ - -1074395588 // Invalid high threshold value. Valid threshold values range - // from 0 to 255. -#define ERR_NIOCR_INVALID_THRESHOLD_RANGE \ - -1074395587 // The low threshold must be less than the high threshold. -#define ERR_NIOCR_INVALID_LOWER_THRESHOLD_LIMIT \ - -1074395586 // Invalid lower threshold limit. Valid lower threshold limits - // range from 0 to 255. -#define ERR_NIOCR_INVALID_UPPER_THRESHOLD_LIMIT \ - -1074395585 // Invalid upper threshold limit. Valid upper threshold limits - // range from 0 to 255. -#define ERR_NIOCR_INVALID_THRESHOLD_LIMITS \ - -1074395584 // The lower threshold limit must be less than the upper - // threshold limit. -#define ERR_NIOCR_INVALID_MIN_CHAR_SPACING \ - -1074395583 // Invalid minimum character spacing value. Character spacing - // must be >= 1 pixel. -#define ERR_NIOCR_INVALID_MAX_HORIZ_ELEMENT_SPACING \ - -1074395582 // Invalid maximum horizontal element spacing value. Maximum - // horizontal element spacing must be >= 0. -#define ERR_NIOCR_INVALID_MAX_VERT_ELEMENT_SPACING \ - -1074395581 // Invalid maximum vertical element spacing value. Maximum - // vertical element spacing must be >= 0. -#define ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_WIDTH \ - -1074395580 // Invalid minimum bounding rectangle width. Minimum bounding - // rectangle width must be >= 1. -#define ERR_NIOCR_INVALID_ASPECT_RATIO \ - -1074395579 // Invalid aspect ratio value. The aspect ratio must be zero or - // >= 100. -#define ERR_NIOCR_INVALID_CHARACTER_SET_FILE \ - -1074395578 // Invalid or corrupt character set file. -#define ERR_NIOCR_CHARACTER_VALUE_CANNOT_BE_EMPTYSTRING \ - -1074395577 // The character value must not be an empty string. -#define ERR_NIOCR_CHARACTER_VALUE_TOO_LONG \ - -1074395576 // Character values must be <=255 characters. -#define ERR_NIOCR_INVALID_NUMBER_OF_EROSIONS \ - -1074395575 // Invalid number of erosions. The number of erosions must be >= - // 0. -#define ERR_NIOCR_CHARACTER_SET_DESCRIPTION_TOO_LONG \ - -1074395574 // The character set description must be <=255 characters. -#define ERR_NIOCR_INVALID_CHARACTER_SET_FILE_VERSION \ - -1074395573 // The character set file was created by a newer version of NI - // Vision. Upgrade to the latest version of NI Vision to read the - // character set file. -#define ERR_NIOCR_INTEGER_VALUE_FOR_STRING_ATTRIBUTE \ - -1074395572 // You must specify characters for a string. A string cannot - // contain integers. -#define ERR_NIOCR_GET_ONLY_ATTRIBUTE \ - -1074395571 // This attribute is read-only. -#define ERR_NIOCR_INTEGER_VALUE_FOR_BOOLEAN_ATTRIBUTE \ - -1074395570 // This attribute requires a Boolean value. -#define ERR_NIOCR_INVALID_ATTRIBUTE -1074395569 // Invalid attribute. -#define ERR_NIOCR_STRING_VALUE_FOR_INTEGER_ATTRIBUTE \ - -1074395568 // This attribute requires integer values. -#define ERR_NIOCR_STRING_VALUE_FOR_BOOLEAN_ATTRIBUTE \ - -1074395567 // String values are invalid for this attribute. Enter a boolean - // value. -#define ERR_NIOCR_BOOLEAN_VALUE_FOR_INTEGER_ATTRIBUTE \ - -1074395566 // Boolean values are not valid for this attribute. Enter an - // integer value. -#define ERR_NIOCR_MUST_BE_SINGLE_CHARACTER \ - -1074395565 // Requires a single-character string. -#define ERR_NIOCR_INVALID_PREDEFINED_CHARACTER \ - -1074395564 // Invalid predefined character value. -#define ERR_NIOCR_UNLICENSED -1074395563 // This copy of NI OCR is unlicensed. -#define ERR_NIOCR_BOOLEAN_VALUE_FOR_STRING_ATTRIBUTE \ - -1074395562 // String values are not valid for this attribute. Enter a - // Boolean value. -#define ERR_NIOCR_INVALID_NUMBER_OF_CHARACTERS \ - -1074395561 // The number of characters in the character value must match the - // number of objects in the image. -#define ERR_NIOCR_INVALID_OBJECT_INDEX -1074395560 // Invalid object index. -#define ERR_NIOCR_INVALID_READ_OPTION -1074395559 // Invalid read option. -#define ERR_NIOCR_INVALID_CHARACTER_SIZE_RANGE \ - -1074395558 // The minimum character size must be less than the maximum - // character size. -#define ERR_NIOCR_INVALID_BOUNDING_RECT_WIDTH_RANGE \ - -1074395557 // The minimum character bounding rectangle width must be less - // than the maximum character bounding rectangle width. -#define ERR_NIOCR_INVALID_BOUNDING_RECT_HEIGHT_RANGE \ - -1074395556 // The minimum character bounding rectangle height must be less - // than the maximum character bounding rectangle height. -#define ERR_NIOCR_INVALID_SPACING_RANGE \ - -1074395555 // The maximum horizontal element spacing value must not exceed - // the minimum character spacing value. -#define ERR_NIOCR_INVALID_READ_RESOLUTION \ - -1074395554 // Invalid read resolution. -#define ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_HEIGHT \ - -1074395553 // Invalid minimum bounding rectangle height. The minimum - // bounding rectangle height must be >= 1. -#define ERR_NIOCR_NOT_A_VALID_CHARACTER_SET \ - -1074395552 // Not a valid character set. -#define ERR_NIOCR_RENAME_REFCHAR \ - -1074395551 // A trained OCR character cannot be renamed while it is a - // reference character. -#define ERR_NIOCR_INVALID_CHARACTER_VALUE \ - -1074395550 // A character cannot have an ASCII value of 255. -#define ERR_NIOCR_INVALID_NUMBER_OF_OBJECTS_TO_VERIFY \ - -1074395549 // The number of objects found does not match the number of - // expected characters or patterns to verify. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_CAP \ - -1074395421 // The specified value for the filter cap for block matching is - // invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_SIZE \ - -1074395420 // The specified prefilter size for block matching is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_TYPE \ - -1074395419 // The specified prefilter type for block matching is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_NUMDISPARITIES \ - -1074395418 // The specifed value for number of disparities is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_WINDOW_SIZE \ - -1074395417 // The specified window size for block matching is invalid. -#define ERR_3DVISION_INVALID_SESSION_TYPE \ - -1074395416 // This 3D vision function cannot be called on this type of 3d - // vision session. -#define ERR_TOO_MANY_3DVISION_SESSIONS \ - -1074395415 // There are too many 3D vision sessions open. You must close a - // session before you can open another one. -#define ERR_OPENING_NEWER_3DVISION_SESSION \ - -1074395414 // The 3D vision session you tried to open was created with a - // newer version of NI Vision. Upgrade to the latest version of - // NI Vision to read this file. -#define ERR_INVALID_STEREO_BLOCKMATCHING_FILTERTYPE \ - -1074395413 // You have specified an invalid filter type for block matching. -#define ERR_INVALID_STEREO_CAMERA_POSITION \ - -1074395412 // You have requested results at an invalid camera position in - // the stereo setup. -#define ERR_INVALID_3DVISION_SESSION \ - -1074395411 // Not a valid 3D Vision session. -#define ERR_INVALID_ICONS_PER_LINE \ - -1074395410 // NI Vision does not support less than one icon per line. -#define ERR_INVALID_SUBPIXEL_DIVISIONS \ - -1074395409 // Invalid subpixel divisions. -#define ERR_INVALID_DETECTION_MODE -1074395408 // Invalid detection mode. -#define ERR_INVALID_CONTRAST \ - -1074395407 // Invalid contrast value. Valid contrast values range from 0 to - // 255. -#define ERR_COORDSYS_NOT_FOUND \ - -1074395406 // The coordinate system could not be found on this image. -#define ERR_INVALID_TEXTORIENTATION \ - -1074395405 // NI Vision does not support the text orientation value you - // supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_FOR_UNWRAP \ - -1074395404 // UnwrapImage does not support the interpolation method value - // you supplied. Valid interpolation methods are zero order and - // bilinear. -#define ERR_EXTRAINFO_VERSION \ - -1074395403 // The image was created in a newer version of NI Vision. Upgrade - // to the latest version of NI Vision to use this image. -#define ERR_INVALID_MAXPOINTS \ - -1074395402 // The function does not support the maximum number of points - // that you specified. -#define ERR_INVALID_MATCHFACTOR \ - -1074395401 // The function does not support the matchFactor that you - // specified. -#define ERR_MULTICORE_OPERATION \ - -1074395400 // The operation you have given Multicore Options is invalid. - // Please see the available enumeration values for Multicore - // Operation. -#define ERR_MULTICORE_INVALID_ARGUMENT \ - -1074395399 // You have given Multicore Options an invalid argument. -#define ERR_COMPLEX_IMAGE_REQUIRED -1074395397 // A complex image is required. -#define ERR_COLOR_IMAGE_REQUIRED \ - -1074395395 // The input image must be a color image. -#define ERR_COLOR_SPECTRUM_MASK \ - -1074395394 // The color mask removes too much color information. -#define ERR_COLOR_TEMPLATE_IMAGE_TOO_SMALL \ - -1074395393 // The color template image is too small. -#define ERR_COLOR_TEMPLATE_IMAGE_TOO_LARGE \ - -1074395392 // The color template image is too large. -#define ERR_COLOR_TEMPLATE_IMAGE_HUE_CONTRAST_TOO_LOW \ - -1074395391 // The contrast in the hue plane of the image is too low for - // learning shape features. -#define ERR_COLOR_TEMPLATE_IMAGE_LUMINANCE_CONTRAST_TOO_LOW \ - -1074395390 // The contrast in the luminance plane of the image is too low to - // learn shape features. -#define ERR_COLOR_LEARN_SETUP_DATA \ - -1074395389 // Invalid color learn setup data. -#define ERR_COLOR_LEARN_SETUP_DATA_SHAPE \ - -1074395388 // Invalid color learn setup data. -#define ERR_COLOR_MATCH_SETUP_DATA \ - -1074395387 // Invalid color match setup data. -#define ERR_COLOR_MATCH_SETUP_DATA_SHAPE \ - -1074395386 // Invalid color match setup data. -#define ERR_COLOR_ROTATION_REQUIRES_SHAPE_FEATURE \ - -1074395385 // Rotation-invariant color pattern matching requires a feature - // mode including shape. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR \ - -1074395384 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_1 \ - -1074395383 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_2 \ - -1074395382 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_3 \ - -1074395381 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_4 \ - -1074395380 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_5 \ - -1074395379 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_6 \ - -1074395378 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT \ - -1074395377 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHIFT \ - -1074395376 // The color template image does not contain data required for - // shift-invariant color matching. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_1 \ - -1074395375 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_2 \ - -1074395374 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION \ - -1074395373 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOROTATION \ - -1074395372 // The color template image does not contain data required for - // rotation-invariant color matching. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_1 \ - -1074395371 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_2 \ - -1074395370 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_3 \ - -1074395369 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_4 \ - -1074395368 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_5 \ - -1074395367 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHAPE \ - -1074395366 // The color template image does not contain data required for - // color matching in shape feature mode. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSPECTRUM \ - -1074395365 // The color template image does not contain data required for - // color matching in color feature mode. -#define ERR_IGNORE_COLOR_SPECTRUM_SET \ - -1074395364 // The ignore color spectra array is invalid. -#define ERR_INVALID_SUBSAMPLING_RATIO -1074395363 // Invalid subsampling ratio. -#define ERR_INVALID_WIDTH -1074395362 // Invalid pixel width. -#define ERR_INVALID_STEEPNESS -1074395361 // Invalid steepness. -#define ERR_COMPLEX_PLANE -1074395360 // Invalid complex plane. -#define ERR_INVALID_COLOR_IGNORE_MODE -1074395357 // Invalid color ignore mode. -#define ERR_INVALID_MIN_MATCH_SCORE \ - -1074395356 // Invalid minimum match score. Acceptable values range from 0 to - // 1000. -#define ERR_INVALID_NUM_MATCHES_REQUESTED \ - -1074395355 // Invalid number of matches requested. You must request a - // minimum of one match. -#define ERR_INVALID_COLOR_WEIGHT \ - -1074395354 // Invalid color weight. Acceptable values range from 0 to 1000. -#define ERR_INVALID_SEARCH_STRATEGY -1074395353 // Invalid search strategy. -#define ERR_INVALID_FEATURE_MODE -1074395352 // Invalid feature mode. -#define ERR_INVALID_RECT \ - -1074395351 // NI Vision does not support rectangles with negative widths or - // negative heights. -#define ERR_INVALID_VISION_INFO \ - -1074395350 // NI Vision does not support the vision information type you - // supplied. -#define ERR_INVALID_SKELETONMETHOD \ - -1074395349 // NI Vision does not support the SkeletonMethod value you - // supplied. -#define ERR_INVALID_3DPLANE \ - -1074395348 // NI Vision does not support the 3DPlane value you supplied. -#define ERR_INVALID_3DDIRECTION \ - -1074395347 // NI Vision does not support the 3DDirection value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_FOR_ROTATE \ - -1074395346 // imaqRotate does not support the InterpolationMethod value you - // supplied. -#define ERR_INVALID_FLIPAXIS \ - -1074395345 // NI Vision does not support the axis of symmetry you supplied. -#define ERR_FILE_FILENAME_NULL \ - -1074395343 // You must pass a valid file name. Do not pass in NULL. -#define ERR_INVALID_SIZETYPE \ - -1074395340 // NI Vision does not support the SizeType value you supplied. -#define ERR_UNKNOWN_ALGORITHM \ - -1074395336 // You specified the dispatch status of an unknown algorithm. -#define ERR_DISPATCH_STATUS_CONFLICT \ - -1074395335 // You are attempting to set the same algorithm to dispatch and - // to not dispatch. Remove one of the conflicting settings. -#define ERR_INVALID_CONVERSIONSTYLE \ - -1074395334 // NI Vision does not support the Conversion Method value you - // supplied. -#define ERR_INVALID_VERTICAL_TEXT_ALIGNMENT \ - -1074395333 // NI Vision does not support the VerticalTextAlignment value you - // supplied. -#define ERR_INVALID_COMPAREFUNCTION \ - -1074395332 // NI Vision does not support the CompareFunction value you - // supplied. -#define ERR_INVALID_BORDERMETHOD \ - -1074395331 // NI Vision does not support the BorderMethod value you - // supplied. -#define ERR_INVALID_BORDER_SIZE \ - -1074395330 // Invalid border size. Acceptable values range from 0 to 50. -#define ERR_INVALID_OUTLINEMETHOD \ - -1074395329 // NI Vision does not support the OutlineMethod value you - // supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD \ - -1074395328 // NI Vision does not support the InterpolationMethod value you - // supplied. -#define ERR_INVALID_SCALINGMODE \ - -1074395327 // NI Vision does not support the ScalingMode value you supplied. -#define ERR_INVALID_DRAWMODE_FOR_LINE \ - -1074395326 // imaqDrawLineOnImage does not support the DrawMode value you - // supplied. -#define ERR_INVALID_DRAWMODE \ - -1074395325 // NI Vision does not support the DrawMode value you supplied. -#define ERR_INVALID_SHAPEMODE \ - -1074395324 // NI Vision does not support the ShapeMode value you supplied. -#define ERR_INVALID_FONTCOLOR \ - -1074395323 // NI Vision does not support the FontColor value you supplied. -#define ERR_INVALID_TEXTALIGNMENT \ - -1074395322 // NI Vision does not support the TextAlignment value you - // supplied. -#define ERR_INVALID_MORPHOLOGYMETHOD \ - -1074395321 // NI Vision does not support the MorphologyMethod value you - // supplied. -#define ERR_TEMPLATE_EMPTY -1074395320 // The template image is empty. -#define ERR_INVALID_SUBPIX_TYPE \ - -1074395319 // NI Vision does not support the interpolation type you - // supplied. -#define ERR_INSF_POINTS \ - -1074395318 // You supplied an insufficient number of points to perform this - // operation. -#define ERR_UNDEF_POINT \ - -1074395317 // You specified a point that lies outside the image. -#define ERR_INVALID_KERNEL_CODE -1074395316 // Invalid kernel code. -#define ERR_INEFFICIENT_POINTS \ - -1074395315 // You supplied an inefficient set of points to match the minimum - // score. -#define ERR_WRITE_FILE_NOT_SUPPORTED \ - -1074395313 // Writing files is not supported on this device. -#define ERR_LCD_CALIBRATE \ - -1074395312 // The input image does not seem to be a valid LCD or LED - // calibration image. -#define ERR_INVALID_COLOR_SPECTRUM \ - -1074395311 // The color spectrum array you provided has an invalid number of - // elements or contains an element set to not-a-number (NaN). -#define ERR_INVALID_PALETTE_TYPE \ - -1074395310 // NI Vision does not support the PaletteType value you supplied. -#define ERR_INVALID_WINDOW_THREAD_POLICY \ - -1074395309 // NI Vision does not support the WindowThreadPolicy value you - // supplied. -#define ERR_INVALID_COLORSENSITIVITY \ - -1074395308 // NI Vision does not support the ColorSensitivity value you - // supplied. -#define ERR_PRECISION_NOT_GTR_THAN_0 \ - -1074395307 // The precision parameter must be greater than 0. -#define ERR_INVALID_TOOL \ - -1074395306 // NI Vision does not support the Tool value you supplied. -#define ERR_INVALID_REFERENCEMODE \ - -1074395305 // NI Vision does not support the ReferenceMode value you - // supplied. -#define ERR_INVALID_MATHTRANSFORMMETHOD \ - -1074395304 // NI Vision does not support the MathTransformMethod value you - // supplied. -#define ERR_INVALID_NUM_OF_CLASSES \ - -1074395303 // Invalid number of classes for auto threshold. Acceptable - // values range from 2 to 256. -#define ERR_INVALID_THRESHOLDMETHOD \ - -1074395302 // NI Vision does not support the threshold method value you - // supplied. -#define ERR_ROI_NOT_2_LINES \ - -1074395301 // The ROI you passed into imaqGetMeterArc must consist of two - // lines. -#define ERR_INVALID_METERARCMODE \ - -1074395300 // NI Vision does not support the MeterArcMode value you - // supplied. -#define ERR_INVALID_COMPLEXPLANE \ - -1074395299 // NI Vision does not support the ComplexPlane value you - // supplied. -#define ERR_COMPLEXPLANE_NOT_REAL_OR_IMAGINARY \ - -1074395298 // You can perform this operation on a real or an imaginary - // ComplexPlane only. -#define ERR_INVALID_PARTICLEINFOMODE \ - -1074395297 // NI Vision does not support the ParticleInfoMode value you - // supplied. -#define ERR_INVALID_BARCODETYPE \ - -1074395296 // NI Vision does not support the BarcodeType value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_INTERPOLATEPOINTS \ - -1074395295 // imaqInterpolatePoints does not support the InterpolationMethod - // value you supplied. -#define ERR_CONTOUR_INDEX_OUT_OF_RANGE \ - -1074395294 // The contour index you supplied is larger than the number of - // contours in the ROI. -#define ERR_CONTOURID_NOT_FOUND \ - -1074395293 // The supplied ContourID did not correlate to a contour inside - // the ROI. -#define ERR_POINTS_ARE_COLLINEAR \ - -1074395292 // Do not supply collinear points for this operation. -#define ERR_SHAPEMATCH_BADIMAGEDATA \ - -1074395291 // Shape Match requires the image to contain only pixel values of - // 0 or 1. -#define ERR_SHAPEMATCH_BADTEMPLATE \ - -1074395290 // The template you supplied for ShapeMatch contains no shape - // information. -#define ERR_CONTAINER_CAPACITY_EXCEEDED_UINT_MAX \ - -1074395289 // The operation would have exceeded the capacity of an internal - // container, which is limited to 4294967296 unique elements. -#define ERR_CONTAINER_CAPACITY_EXCEEDED_INT_MAX \ - -1074395288 // The operation would have exceeded the capacity of an internal - // container, which is limited to 2147483648 unique elements. -#define ERR_INVALID_LINE \ - -1074395287 // The line you provided contains two identical points, or one of - // the coordinate locations for the line is not a number (NaN). -#define ERR_INVALID_CONCENTRIC_RAKE_DIRECTION \ - -1074395286 // Invalid concentric rake direction. -#define ERR_INVALID_SPOKE_DIRECTION -1074395285 // Invalid spoke direction. -#define ERR_INVALID_EDGE_PROCESS -1074395284 // Invalid edge process. -#define ERR_INVALID_RAKE_DIRECTION -1074395283 // Invalid rake direction. -#define ERR_CANT_DRAW_INTO_VIEWER \ - -1074395282 // Unable to draw to viewer. You must have the latest version of - // the control. -#define ERR_IMAGE_SMALLER_THAN_BORDER \ - -1074395281 // Your image must be larger than its border size for this - // operation. -#define ERR_ROI_NOT_RECT \ - -1074395280 // The ROI must only have a single Rectangle contour. -#define ERR_ROI_NOT_POLYGON -1074395279 // ROI is not a polygon. -#define ERR_LCD_NOT_NUMERIC -1074395278 // LCD image is not a number. -#define ERR_BARCODE_CHECKSUM \ - -1074395277 // The decoded barcode information did not pass the checksum - // test. -#define ERR_LINES_PARALLEL \ - -1074395276 // You specified parallel lines for the meter ROI. -#define ERR_INVALID_BROWSER_IMAGE -1074395275 // Invalid browser image. -#define ERR_DIV_BY_ZERO -1074395270 // Cannot divide by zero. -#define ERR_NULL_POINTER -1074395269 // Null pointer. -#define ERR_LINEAR_COEFF \ - -1074395268 // The linear equations are not independent. -#define ERR_COMPLEX_ROOT -1074395267 // The roots of the equation are complex. -#define ERR_BARCODE \ - -1074395265 // The barcode does not match the type you specified. -#define ERR_LCD_NO_SEGMENTS -1074395263 // No lit segment. -#define ERR_LCD_BAD_MATCH -1074395262 // The LCD does not form a known digit. -#define ERR_GIP_RANGE \ - -1074395261 // An internal error occurred while attempting to access an - // invalid coordinate on an image. -#define ERR_HEAP_TRASHED -1074395260 // An internal memory error occurred. -#define ERR_BAD_FILTER_WIDTH \ - -1074395258 // The filter width must be odd for the Canny operator. -#define ERR_INVALID_EDGE_DIR \ - -1074395257 // You supplied an invalid edge direction in the Canny operator. -#define ERR_EVEN_WINDOW_SIZE \ - -1074395256 // The window size must be odd for the Canny operator. -#define ERR_INVALID_LEARN_MODE -1074395253 // Invalid learn mode. -#define ERR_LEARN_SETUP_DATA -1074395252 // Invalid learn setup data. -#define ERR_INVALID_MATCH_MODE -1074395251 // Invalid match mode. -#define ERR_MATCH_SETUP_DATA -1074395250 // Invalid match setup data. -#define ERR_ROTATION_ANGLE_RANGE_TOO_LARGE \ - -1074395249 // At least one range in the array of rotation angle ranges - // exceeds 360 degrees. -#define ERR_TOO_MANY_ROTATION_ANGLE_RANGES \ - -1074395248 // The array of rotation angle ranges contains too many ranges. -#define ERR_TEMPLATE_DESCRIPTOR -1074395247 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_1 -1074395246 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_2 -1074395245 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_3 -1074395244 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_4 \ - -1074395243 // The template descriptor was created with a newer version of NI - // Vision. Upgrade to the latest version of NI Vision to use this - // template. -#define ERR_TEMPLATE_DESCRIPTOR_ROTATION \ - -1074395242 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOROTATION \ - -1074395241 // The template descriptor does not contain data required for - // rotation-invariant matching. -#define ERR_TEMPLATE_DESCRIPTOR_ROTATION_1 \ - -1074395240 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_SHIFT \ - -1074395239 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOSHIFT \ - -1074395238 // The template descriptor does not contain data required for - // shift-invariant matching. -#define ERR_TEMPLATE_DESCRIPTOR_SHIFT_1 \ - -1074395237 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOSCALE \ - -1074395236 // The template descriptor does not contain data required for - // scale-invariant matching. -#define ERR_TEMPLATE_IMAGE_CONTRAST_TOO_LOW \ - -1074395235 // The template image does not contain enough contrast. -#define ERR_TEMPLATE_IMAGE_TOO_SMALL \ - -1074395234 // The template image is too small. -#define ERR_TEMPLATE_IMAGE_TOO_LARGE \ - -1074395233 // The template image is too large. -#define ERR_TOO_MANY_OCR_SESSIONS \ - -1074395214 // There are too many OCR sessions open. You must close a - // session before you can open another one. -#define ERR_OCR_TEMPLATE_WRONG_SIZE \ - -1074395212 // The size of the template string must match the size of the - // string you are trying to correct. -#define ERR_OCR_BAD_TEXT_TEMPLATE \ - -1074395211 // The supplied text template contains nonstandard characters - // that cannot be generated by OCR. -#define ERR_OCR_CANNOT_MATCH_TEXT_TEMPLATE \ - -1074395210 // At least one character in the text template was of a lexical - // class that did not match the supplied character reports. -#define ERR_OCR_LIB_INIT \ - -1074395203 // The OCR library cannot be initialized correctly. -#define ERR_OCR_LOAD_LIBRARY \ - -1074395201 // There was a failure when loading one of the internal OCR - // engine or LabView libraries. -#define ERR_OCR_INVALID_PARAMETER \ - -1074395200 // One of the parameters supplied to the OCR function that - // generated this error is invalid. -#define ERR_MARKER_INFORMATION_NOT_SUPPLIED \ - -1074395199 // Marker image and points are not supplied -#define ERR_INCOMPATIBLE_MARKER_IMAGE_SIZE \ - -1074395198 // Source Image and Marker Image should be of same size. -#define ERR_BOTH_MARKER_INPUTS_SUPPLIED \ - -1074395197 // Both Marker Image and Points are supplied. -#define ERR_INVALID_MORPHOLOGICAL_OPERATION \ - -1074395196 // Invalid Morphological Operation. -#define ERR_IMAGE_CONTAINS_NAN_VALUES \ - -1074395195 // Float image contains NaN values -#define ERR_OVERLAY_EXTRAINFO_OPENING_NEW_VERSION \ - -1074395194 // The overlay information you tried to open was created with a - // newer version of NI Vision. Upgrade to the latest version of - // NI Vision to read this file. -#define ERR_NO_CLAMP_FOUND \ - -1074395193 // No valid clamp was found with the current configuration -#define ERR_NO_CLAMP_WITHIN_ANGLE_RANGE \ - -1074395192 // Supplied angle range for clamp is insufficient -#define ERR_GHT_INVALID_USE_ALL_CURVES_VALUE \ - -1074395188 // The use all curves advanced option specified during learn is - // not supported -#define ERR_INVALID_GAUSS_SIGMA_VALUE \ - -1074395187 // The sigma value specified for the Gaussian filter is too - // small. -#define ERR_INVALID_GAUSS_FILTER_TYPE \ - -1074395186 // The specified Gaussian filter type is not supported. -#define ERR_INVALID_CONTRAST_REVERSAL_MODE \ - -1074395185 // The contrast reversal mode specified during matching is - // invalid. -#define ERR_INVALID_ROTATION_RANGE \ - -1074395184 // Invalid roation angle range. The upper bound must be greater - // than or equal to the lower bound. -#define ERR_GHT_INVALID_MINIMUM_LEARN_ANGLE_VALUE \ - -1074395183 // The minimum rotation angle value specifed during learning of - // the template is not supported. -#define ERR_GHT_INVALID_MAXIMUM_LEARN_ANGLE_VALUE \ - -1074395182 // The maximum rotation angle value specifed during learning of - // the template is not supported. -#define ERR_GHT_INVALID_MAXIMUM_LEARN_SCALE_FACTOR \ - -1074395181 // The maximum scale factor specifed during learning of the - // template is not supported. -#define ERR_GHT_INVALID_MINIMUM_LEARN_SCALE_FACTOR \ - -1074395180 // The minimum scale factor specifed during learning of the - // template is not supported. -#define ERR_OCR_PREPROCESSING_FAILED \ - -1074395179 // The OCR engine failed during the preprocessing stage. -#define ERR_OCR_RECOGNITION_FAILED \ - -1074395178 // The OCR engine failed during the recognition stage. -#define ERR_OCR_BAD_USER_DICTIONARY \ - -1074395175 // The provided filename is not valid user dictionary filename. -#define ERR_OCR_INVALID_AUTOORIENTMODE \ - -1074395174 // NI Vision does not support the AutoOrientMode value you - // supplied. -#define ERR_OCR_INVALID_LANGUAGE \ - -1074395173 // NI Vision does not support the Language value you supplied. -#define ERR_OCR_INVALID_CHARACTERSET \ - -1074395172 // NI Vision does not support the CharacterSet value you - // supplied. -#define ERR_OCR_INI_FILE_NOT_FOUND \ - -1074395171 // The system could not locate the initialization file required - // for OCR initialization. -#define ERR_OCR_INVALID_CHARACTERTYPE \ - -1074395170 // NI Vision does not support the CharacterType value you - // supplied. -#define ERR_OCR_INVALID_RECOGNITIONMODE \ - -1074395169 // NI Vision does not support the RecognitionMode value you - // supplied. -#define ERR_OCR_INVALID_AUTOCORRECTIONMODE \ - -1074395168 // NI Vision does not support the AutoCorrectionMode value you - // supplied. -#define ERR_OCR_INVALID_OUTPUTDELIMITER \ - -1074395167 // NI Vision does not support the OutputDelimiter value you - // supplied. -#define ERR_OCR_BIN_DIR_NOT_FOUND \ - -1074395166 // The system could not locate the OCR binary directory required - // for OCR initialization. -#define ERR_OCR_WTS_DIR_NOT_FOUND \ - -1074395165 // The system could not locate the OCR weights directory required - // for OCR initialization. -#define ERR_OCR_ADD_WORD_FAILED \ - -1074395164 // The supplied word could not be added to the user dictionary. -#define ERR_OCR_INVALID_CHARACTERPREFERENCE \ - -1074395163 // NI Vision does not support the CharacterPreference value you - // supplied. -#define ERR_OCR_INVALID_CORRECTIONMODE \ - -1074395162 // NI Vision does not support the CorrectionMethod value you - // supplied. -#define ERR_OCR_INVALID_CORRECTIONLEVEL \ - -1074395161 // NI Vision does not support the CorrectionLevel value you - // supplied. -#define ERR_OCR_INVALID_MAXPOINTSIZE \ - -1074395160 // NI Vision does not support the maximum point size you - // supplied. Valid values range from 4 to 72. -#define ERR_OCR_INVALID_TOLERANCE \ - -1074395159 // NI Vision does not support the tolerance value you supplied. - // Valid values are non-negative. -#define ERR_OCR_INVALID_CONTRASTMODE \ - -1074395158 // NI Vision does not support the ContrastMode value you - // supplied. -#define ERR_OCR_SKEW_DETECT_FAILED \ - -1074395156 // The OCR attempted to detected the text skew and failed. -#define ERR_OCR_ORIENT_DETECT_FAILED \ - -1074395155 // The OCR attempted to detected the text orientation and failed. -#define ERR_FONT_FILE_FORMAT -1074395153 // Invalid font file format. -#define ERR_FONT_FILE_NOT_FOUND -1074395152 // Font file not found. -#define ERR_OCR_CORRECTION_FAILED \ - -1074395151 // The OCR engine failed during the correction stage. -#define ERR_INVALID_ROUNDING_MODE \ - -1074395150 // NI Vision does not support the RoundingMode value you - // supplied. -#define ERR_DUPLICATE_TRANSFORM_TYPE \ - -1074395149 // Found a duplicate transform type in the properties array. Each - // properties array may only contain one behavior for each - // transform type. -#define ERR_OVERLAY_GROUP_NOT_FOUND -1074395148 // Overlay Group Not Found. -#define ERR_BARCODE_RSSLIMITED \ - -1074395147 // The barcode is not a valid RSS Limited symbol -#define ERR_QR_DETECTION_VERSION \ - -1074395146 // Couldn't determine the correct version of the QR code. -#define ERR_QR_INVALID_READ -1074395145 // Invalid read of the QR code. -#define ERR_QR_INVALID_BARCODE \ - -1074395144 // The barcode that was read contains invalid parameters. -#define ERR_QR_DETECTION_MODE \ - -1074395143 // The data stream that was demodulated could not be read because - // the mode was not detected. -#define ERR_QR_DETECTION_MODELTYPE \ - -1074395142 // Couldn't determine the correct model of the QR code. -#define ERR_OCR_NO_TEXT_FOUND \ - -1074395141 // The OCR engine could not find any text in the supplied region. -#define ERR_OCR_CHAR_REPORT_CORRUPTED \ - -1074395140 // One of the character reports is no longer usable by the - // system. -#define ERR_IMAQ_QR_DIMENSION_INVALID -1074395139 // Invalid Dimensions. -#define ERR_OCR_REGION_TOO_SMALL \ - -1074395138 // The OCR region provided was too small to have contained any - // characters. -#define _FIRST_ERR ERR_SYSTEM_ERROR -#define _LAST_ERR ERR_OCR_REGION_TOO_SMALL - -//============================================================================ -// Enumerated Types -//============================================================================ -typedef enum PointSymbol_enum { - IMAQ_POINT_AS_PIXEL = 0, // A single pixel represents a point in the overlay. - IMAQ_POINT_AS_CROSS = 1, // A cross represents a point in the overlay. - IMAQ_POINT_USER_DEFINED = - 2, // The pattern supplied by the user represents a point in the overlay. - IMAQ_POINT_SYMBOL_SIZE_GUARD = 0xFFFFFFFF -} PointSymbol; - -typedef enum MeasurementValue_enum { - IMAQ_AREA = 0, // Surface area of the particle in pixels. - IMAQ_AREA_CALIBRATED = - 1, // Surface area of the particle in calibrated units. - IMAQ_NUM_HOLES = 2, // Number of holes in the particle. - IMAQ_AREA_OF_HOLES = 3, // Surface area of the holes in calibrated units. - IMAQ_TOTAL_AREA = - 4, // Total surface area (holes and particle) in calibrated units. - IMAQ_IMAGE_AREA = 5, // Surface area of the entire image in calibrated units. - IMAQ_PARTICLE_TO_IMAGE = 6, // Ratio, expressed as a percentage, of the - // surface area of a particle in relation to the - // total area of the particle. - IMAQ_PARTICLE_TO_TOTAL = 7, // Ratio, expressed as a percentage, of the - // surface area of a particle in relation to the - // total area of the particle. - IMAQ_CENTER_MASS_X = 8, // X-coordinate of the center of mass. - IMAQ_CENTER_MASS_Y = 9, // Y-coordinate of the center of mass. - IMAQ_LEFT_COLUMN = 10, // Left edge of the bounding rectangle. - IMAQ_TOP_ROW = 11, // Top edge of the bounding rectangle. - IMAQ_RIGHT_COLUMN = 12, // Right edge of the bounding rectangle. - IMAQ_BOTTOM_ROW = 13, // Bottom edge of bounding rectangle. - IMAQ_WIDTH = 14, // Width of bounding rectangle in calibrated units. - IMAQ_HEIGHT = 15, // Height of bounding rectangle in calibrated units. - IMAQ_MAX_SEGMENT_LENGTH = 16, // Length of longest horizontal line segment. - IMAQ_MAX_SEGMENT_LEFT_COLUMN = - 17, // Leftmost x-coordinate of longest horizontal line segment. - IMAQ_MAX_SEGMENT_TOP_ROW = - 18, // Y-coordinate of longest horizontal line segment. - IMAQ_PERIMETER = 19, // Outer perimeter of the particle. - IMAQ_PERIMETER_OF_HOLES = 20, // Perimeter of all holes within the particle. - IMAQ_SIGMA_X = 21, // Sum of the particle pixels on the x-axis. - IMAQ_SIGMA_Y = 22, // Sum of the particle pixels on the y-axis. - IMAQ_SIGMA_XX = 23, // Sum of the particle pixels on the x-axis squared. - IMAQ_SIGMA_YY = 24, // Sum of the particle pixels on the y-axis squared. - IMAQ_SIGMA_XY = 25, // Sum of the particle pixels on the x-axis and y-axis. - IMAQ_PROJ_X = 26, // Projection corrected in X. - IMAQ_PROJ_Y = 27, // Projection corrected in Y. - IMAQ_INERTIA_XX = 28, // Inertia matrix coefficient in XX. - IMAQ_INERTIA_YY = 29, // Inertia matrix coefficient in YY. - IMAQ_INERTIA_XY = 30, // Inertia matrix coefficient in XY. - IMAQ_MEAN_H = 31, // Mean length of horizontal segments. - IMAQ_MEAN_V = 32, // Mean length of vertical segments. - IMAQ_MAX_INTERCEPT = 33, // Length of longest segment of the convex hull. - IMAQ_MEAN_INTERCEPT = 34, // Mean length of the chords in an object - // perpendicular to its max intercept. - IMAQ_ORIENTATION = 35, // The orientation based on the inertia of the pixels - // in the particle. - IMAQ_EQUIV_ELLIPSE_MINOR = 36, // Total length of the axis of the ellipse - // having the same area as the particle and a - // major axis equal to half the max intercept. - IMAQ_ELLIPSE_MAJOR = 37, // Total length of major axis having the same area - // and perimeter as the particle in calibrated - // units. - IMAQ_ELLIPSE_MINOR = 38, // Total length of minor axis having the same area - // and perimeter as the particle in calibrated - // units. - IMAQ_ELLIPSE_RATIO = 39, // Fraction of major axis to minor axis. - IMAQ_RECT_LONG_SIDE = 40, // Length of the long side of a rectangle having - // the same area and perimeter as the particle in - // calibrated units. - IMAQ_RECT_SHORT_SIDE = 41, // Length of the short side of a rectangle having - // the same area and perimeter as the particle in - // calibrated units. - IMAQ_RECT_RATIO = - 42, // Ratio of rectangle long side to rectangle short side. - IMAQ_ELONGATION = 43, // Max intercept/mean perpendicular intercept. - IMAQ_COMPACTNESS = 44, // Particle area/(height x width). - IMAQ_HEYWOOD = 45, // Particle perimeter/perimeter of the circle having the - // same area as the particle. - IMAQ_TYPE_FACTOR = 46, // A complex factor relating the surface area to the - // moment of inertia. - IMAQ_HYDRAULIC = 47, // Particle area/particle perimeter. - IMAQ_WADDLE_DISK = 48, // Diameter of the disk having the same area as the - // particle in user units. - IMAQ_DIAGONAL = 49, // Diagonal of an equivalent rectangle in user units. - IMAQ_MEASUREMENT_VALUE_SIZE_GUARD = 0xFFFFFFFF -} MeasurementValue; - -typedef enum ScalingMode_enum { - IMAQ_SCALE_LARGER = - 0, // The function duplicates pixels to make the image larger. - IMAQ_SCALE_SMALLER = - 1, // The function subsamples pixels to make the image smaller. - IMAQ_SCALING_MODE_SIZE_GUARD = 0xFFFFFFFF -} ScalingMode; - -typedef enum ScalingMethod_enum { - IMAQ_SCALE_TO_PRESERVE_AREA = 0, // Correction functions scale the image such - // that the features in the corrected image - // have the same area as the features in the - // input image. - IMAQ_SCALE_TO_FIT = 1, // Correction functions scale the image such that the - // corrected image is the same size as the input - // image. - IMAQ_SCALING_METHOD_SIZE_GUARD = 0xFFFFFFFF -} ScalingMethod; - -typedef enum ReferenceMode_enum { - IMAQ_COORD_X_Y = - 0, // This method requires three elements in the points array. - IMAQ_COORD_ORIGIN_X = - 1, // This method requires two elements in the points array. - IMAQ_REFERENCE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ReferenceMode; - -typedef enum RectOrientation_enum { - IMAQ_BASE_INSIDE = 0, // Specifies that the base of the rectangular image - // lies along the inside edge of the annulus. - IMAQ_BASE_OUTSIDE = 1, // Specifies that the base of the rectangular image - // lies along the outside edge of the annulus. - IMAQ_TEXT_ORIENTATION_SIZE_GUARD = 0xFFFFFFFF -} RectOrientation; - -typedef enum ShapeMode_enum { - IMAQ_SHAPE_RECT = 1, // The function draws a rectangle. - IMAQ_SHAPE_OVAL = 2, // The function draws an oval. - IMAQ_SHAPE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ShapeMode; - -typedef enum PolarityType_enum { - IMAQ_EDGE_RISING = 1, // The edge is a rising edge. - IMAQ_EDGE_FALLING = -1, // The edge is a falling edge. - IMAQ_POLARITY_TYPE_SIZE_GUARD = 0xFFFFFFFF -} PolarityType; - -typedef enum SizeType_enum { - IMAQ_KEEP_LARGE = - 0, // The function keeps large particles remaining after the erosion. - IMAQ_KEEP_SMALL = - 1, // The function keeps small particles eliminated by the erosion. - IMAQ_SIZE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} SizeType; - -typedef enum Plane3D_enum { - IMAQ_3D_REAL = 0, // The function shows the real part of complex images. - IMAQ_3D_IMAGINARY = - 1, // The function shows the imaginary part of complex images. - IMAQ_3D_MAGNITUDE = - 2, // The function shows the magnitude part of complex images. - IMAQ_3D_PHASE = 3, // The function shows the phase part of complex images. - IMAQ_PLANE_3D_SIZE_GUARD = 0xFFFFFFFF -} Plane3D; - -typedef enum PhotometricMode_enum { - IMAQ_WHITE_IS_ZERO = - 0, // The function interprets zero-value pixels as white. - IMAQ_BLACK_IS_ZERO = - 1, // The function interprets zero-value pixels as black. - IMAQ_PHOTOMETRIC_MODE_SIZE_GUARD = 0xFFFFFFFF -} PhotometricMode; - -typedef enum ParticleInfoMode_enum { - IMAQ_BASIC_INFO = 0, // The function returns only the following elements of - // each report: area, calibratedArea, boundingRect. - IMAQ_ALL_INFO = - 1, // The function returns all the information about each particle. - IMAQ_PARTICLE_INFO_MODE_SIZE_GUARD = 0xFFFFFFFF -} ParticleInfoMode; - -typedef enum OutlineMethod_enum { - IMAQ_EDGE_DIFFERENCE = 0, // The function uses a method that produces - // continuous contours by highlighting each pixel - // where an intensity variation occurs between - // itself and its three upper-left neighbors. - IMAQ_EDGE_GRADIENT = 1, // The function uses a method that outlines contours - // where an intensity variation occurs along the - // vertical axis. - IMAQ_EDGE_PREWITT = 2, // The function uses a method that extracts the outer - // contours of objects. - IMAQ_EDGE_ROBERTS = 3, // The function uses a method that outlines the - // contours that highlight pixels where an intensity - // variation occurs along the diagonal axes. - IMAQ_EDGE_SIGMA = 4, // The function uses a method that outlines contours and - // details by setting pixels to the mean value found in - // their neighborhood, if their deviation from this - // value is not significant. - IMAQ_EDGE_SOBEL = 5, // The function uses a method that extracts the outer - // contours of objects. - IMAQ_OUTLINE_METHOD_SIZE_GUARD = 0xFFFFFFFF -} OutlineMethod; - -typedef enum MorphologyMethod_enum { - IMAQ_AUTOM = 0, // The function uses a transformation that generates simpler - // particles that contain fewer details. - IMAQ_CLOSE = 1, // The function uses a transformation that fills tiny holes - // and smooths boundaries. - IMAQ_DILATE = 2, // The function uses a transformation that eliminates tiny - // holes isolated in particles and expands the contour of - // the particles according to the template defined by the - // structuring element. - IMAQ_ERODE = 3, // The function uses a transformation that eliminates pixels - // isolated in the background and erodes the contour of - // particles according to the template defined by the - // structuring element. - IMAQ_GRADIENT = 4, // The function uses a transformation that leaves only the - // pixels that would be added by the dilation process or - // eliminated by the erosion process. - IMAQ_GRADIENTOUT = 5, // The function uses a transformation that leaves only - // the pixels that would be added by the dilation - // process. - IMAQ_GRADIENTIN = 6, // The function uses a transformation that leaves only - // the pixels that would be eliminated by the erosion - // process. - IMAQ_HITMISS = 7, // The function uses a transformation that extracts each - // pixel located in a neighborhood exactly matching the - // template defined by the structuring element. - IMAQ_OPEN = 8, // The function uses a transformation that removes small - // particles and smooths boundaries. - IMAQ_PCLOSE = 9, // The function uses a transformation that fills tiny holes - // and smooths the inner contour of particles according to - // the template defined by the structuring element. - IMAQ_POPEN = 10, // The function uses a transformation that removes small - // particles and smooths the contour of particles according - // to the template defined by the structuring element. - IMAQ_THICK = 11, // The function uses a transformation that adds to an image - // those pixels located in a neighborhood that matches a - // template specified by the structuring element. - IMAQ_THIN = 12, // The function uses a transformation that eliminates pixels - // that are located in a neighborhood matching a template - // specified by the structuring element. - IMAQ_MORPHOLOGY_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MorphologyMethod; - -typedef enum MeterArcMode_enum { - IMAQ_METER_ARC_ROI = 0, // The function uses the roi parameter and ignores - // the base, start, and end parameters. - IMAQ_METER_ARC_POINTS = 1, // The function uses the base,start, and end - // parameters and ignores the roi parameter. - IMAQ_METER_ARC_MODE_SIZE_GUARD = 0xFFFFFFFF -} MeterArcMode; - -typedef enum RakeDirection_enum { - IMAQ_LEFT_TO_RIGHT = 0, // The function searches from the left side of the - // search area to the right side of the search area. - IMAQ_RIGHT_TO_LEFT = 1, // The function searches from the right side of the - // search area to the left side of the search area. - IMAQ_TOP_TO_BOTTOM = 2, // The function searches from the top side of the - // search area to the bottom side of the search area. - IMAQ_BOTTOM_TO_TOP = 3, // The function searches from the bottom side of the - // search area to the top side of the search area. - IMAQ_RAKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} RakeDirection; - -typedef enum TruncateMode_enum { - IMAQ_TRUNCATE_LOW = 0, // The function truncates low frequencies. - IMAQ_TRUNCATE_HIGH = 1, // The function truncates high frequencies. - IMAQ_TRUNCATE_MODE_SIZE_GUARD = 0xFFFFFFFF -} TruncateMode; - -typedef enum AttenuateMode_enum { - IMAQ_ATTENUATE_LOW = 0, // The function attenuates low frequencies. - IMAQ_ATTENUATE_HIGH = 1, // The function attenuates high frequencies. - IMAQ_ATTENUATE_MODE_SIZE_GUARD = 0xFFFFFFFF -} AttenuateMode; - -typedef enum WindowThreadPolicy_enum { - IMAQ_CALLING_THREAD = 0, // Using this policy, NI Vision creates windows in - // the thread that makes the first display function - // call for a given window number. - IMAQ_SEPARATE_THREAD = 1, // Using this policy, NI Vision creates windows in - // a separate thread and processes messages for the - // windows automatically. - IMAQ_WINDOW_THREAD_POLICY_SIZE_GUARD = 0xFFFFFFFF -} WindowThreadPolicy; - -typedef enum WindowOptions_enum { - IMAQ_WIND_RESIZABLE = - 1, // When present, the user may resize the window interactively. - IMAQ_WIND_TITLEBAR = - 2, // When present, the title bar on the window is visible. - IMAQ_WIND_CLOSEABLE = 4, // When present, the close box is available. - IMAQ_WIND_TOPMOST = 8, // When present, the window is always on top. - IMAQ_WINDOW_OPTIONS_SIZE_GUARD = 0xFFFFFFFF -} WindowOptions; - -typedef enum WindowEventType_enum { - IMAQ_NO_EVENT = - 0, // No event occurred since the last call to imaqGetLastEvent(). - IMAQ_CLICK_EVENT = 1, // The user clicked on a window. - IMAQ_DRAW_EVENT = 2, // The user drew an ROI in a window. - IMAQ_MOVE_EVENT = 3, // The user moved a window. - IMAQ_SIZE_EVENT = 4, // The user sized a window. - IMAQ_SCROLL_EVENT = 5, // The user scrolled a window. - IMAQ_ACTIVATE_EVENT = 6, // The user activated a window. - IMAQ_CLOSE_EVENT = 7, // The user closed a window. - IMAQ_DOUBLE_CLICK_EVENT = 8, // The user double-clicked in a window. - IMAQ_WINDOW_EVENT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} WindowEventType; - -typedef enum VisionInfoType_enum { - IMAQ_ANY_VISION_INFO = 0, // The function checks if any extra vision - // information is associated with the image. - IMAQ_PATTERN_MATCHING_INFO = 1, // The function checks if any pattern - // matching template information is - // associated with the image. - IMAQ_CALIBRATION_INFO = 2, // The function checks if any calibration - // information is associated with the image. - IMAQ_OVERLAY_INFO = 3, // The function checks if any overlay information is - // associated with the image. - IMAQ_VISION_INFO_TYPE_SIZE_GUARD = 0xFFFFFFFF -} VisionInfoType; - -typedef enum SearchStrategy_enum { - IMAQ_CONSERVATIVE = 1, // Instructs the pattern matching algorithm to use the - // largest possible amount of information from the - // image at the expense of slowing down the speed of - // the algorithm. - IMAQ_BALANCED = 2, // Instructs the pattern matching algorithm to balance the - // amount of information from the image it uses with the - // speed of the algorithm. - IMAQ_AGGRESSIVE = 3, // Instructs the pattern matching algorithm to use a - // lower amount of information from the image, which - // allows the algorithm to run quickly but at the - // expense of accuracy. - IMAQ_VERY_AGGRESSIVE = 4, // Instructs the pattern matching algorithm to use - // the smallest possible amount of information from - // the image, which allows the algorithm to run at - // the highest speed possible but at the expense of - // accuracy. - IMAQ_SEARCH_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} SearchStrategy; - -typedef enum TwoEdgePolarityType_enum { - IMAQ_NONE = 0, // The function ignores the polarity of the edges. - IMAQ_RISING_FALLING = 1, // The polarity of the first edge is rising (dark to - // light) and the polarity of the second edge is - // falling (light to dark). - IMAQ_FALLING_RISING = 2, // The polarity of the first edge is falling (light - // to dark) and the polarity of the second edge is - // rising (dark to light). - IMAQ_RISING_RISING = 3, // The polarity of the first edge is rising (dark to - // light) and the polarity of the second edge is - // rising (dark to light). - IMAQ_FALLING_FALLING = 4, // The polarity of the first edge is falling (light - // to dark) and the polarity of the second edge is - // falling (light to dark). - IMAQ_TWO_EDGE_POLARITY_TYPE_SIZE_GUARD = 0xFFFFFFFF -} TwoEdgePolarityType; - -typedef enum ObjectType_enum { - IMAQ_BRIGHT_OBJECTS = 0, // The function detects bright objects. - IMAQ_DARK_OBJECTS = 1, // The function detects dark objects. - IMAQ_OBJECT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ObjectType; - -typedef enum Tool_enum { - IMAQ_NO_TOOL = -1, // No tool is in the selected state. - IMAQ_SELECTION_TOOL = - 0, // The selection tool selects an existing ROI in an image. - IMAQ_POINT_TOOL = 1, // The point tool draws a point on the image. - IMAQ_LINE_TOOL = 2, // The line tool draws a line on the image. - IMAQ_RECTANGLE_TOOL = - 3, // The rectangle tool draws a rectangle on the image. - IMAQ_OVAL_TOOL = 4, // The oval tool draws an oval on the image. - IMAQ_POLYGON_TOOL = 5, // The polygon tool draws a polygon on the image. - IMAQ_CLOSED_FREEHAND_TOOL = - 6, // The closed freehand tool draws closed freehand shapes on the image. - IMAQ_ANNULUS_TOOL = 7, // The annulus tool draws annuluses on the image. - IMAQ_ZOOM_TOOL = 8, // The zoom tool controls the zoom of an image. - IMAQ_PAN_TOOL = 9, // The pan tool shifts the view of the image. - IMAQ_POLYLINE_TOOL = 10, // The polyline tool draws a series of connected - // straight lines on the image. - IMAQ_FREEHAND_TOOL = - 11, // The freehand tool draws freehand lines on the image. - IMAQ_ROTATED_RECT_TOOL = - 12, // The rotated rectangle tool draws rotated rectangles on the image. - IMAQ_ZOOM_OUT_TOOL = 13, // The zoom out tool controls the zoom of an image. - IMAQ_TOOL_SIZE_GUARD = 0xFFFFFFFF -} Tool; - -typedef enum TIFFCompressionType_enum { - IMAQ_NO_COMPRESSION = 0, // The function does not compress the TIFF file. - IMAQ_JPEG = 1, // The function uses the JPEG compression algorithm to - // compress the TIFF file. - IMAQ_RUN_LENGTH = 2, // The function uses a run length compression algorithm - // to compress the TIFF file. - IMAQ_ZIP = 3, // The function uses the ZIP compression algorithm to compress - // the TIFF file. - IMAQ_TIFF_COMPRESSION_TYPE_SIZE_GUARD = 0xFFFFFFFF -} TIFFCompressionType; - -typedef enum ThresholdMethod_enum { - IMAQ_THRESH_CLUSTERING = 0, // The function uses a method that sorts the - // histogram of the image within a discrete - // number of classes corresponding to the number - // of phases perceived in an image. - IMAQ_THRESH_ENTROPY = 1, // The function uses a method that is best for - // detecting particles that are present in minuscule - // proportions on the image. - IMAQ_THRESH_METRIC = 2, // The function uses a method that is well-suited for - // images in which classes are not too - // disproportionate. - IMAQ_THRESH_MOMENTS = 3, // The function uses a method that is suited for - // images that have poor contrast. - IMAQ_THRESH_INTERCLASS = 4, // The function uses a method that is well-suited - // for images in which classes have well - // separated pixel value distributions. - IMAQ_THRESHOLD_METHOD_SIZE_GUARD = 0xFFFFFFFF -} ThresholdMethod; - -typedef enum TextAlignment_enum { - IMAQ_LEFT = 0, // Left aligns the text at the reference point. - IMAQ_CENTER = 1, // Centers the text around the reference point. - IMAQ_RIGHT = 2, // Right aligns the text at the reference point. - IMAQ_TEXT_ALIGNMENT_SIZE_GUARD = 0xFFFFFFFF -} TextAlignment; - -typedef enum SpokeDirection_enum { - IMAQ_OUTSIDE_TO_INSIDE = 0, // The function searches from the outside of the - // search area to the inside of the search area. - IMAQ_INSIDE_TO_OUTSIDE = 1, // The function searches from the inside of the - // search area to the outside of the search area. - IMAQ_SPOKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} SpokeDirection; - -typedef enum SkeletonMethod_enum { - IMAQ_SKELETON_L = - 0, // Uses an L-shaped structuring element in the skeleton function. - IMAQ_SKELETON_M = - 1, // Uses an M-shaped structuring element in the skeleton function. - IMAQ_SKELETON_INVERSE = 2, // Uses an L-shaped structuring element on an - // inverse of the image in the skeleton function. - IMAQ_SKELETON_METHOD_SIZE_GUARD = 0xFFFFFFFF -} SkeletonMethod; - -typedef enum VerticalTextAlignment_enum { - IMAQ_BOTTOM = 0, // Aligns the bottom of the text at the reference point. - IMAQ_TOP = 1, // Aligns the top of the text at the reference point. - IMAQ_BASELINE = 2, // Aligns the baseline of the text at the reference point. - IMAQ_VERTICAL_TEXT_ALIGNMENT_SIZE_GUARD = 0xFFFFFFFF -} VerticalTextAlignment; - -typedef enum CalibrationROI_enum { - IMAQ_FULL_IMAGE = 0, // The correction function corrects the whole image, - // regardless of the user-defined or calibration-defined - // ROIs. - IMAQ_CALIBRATION_ROI = 1, // The correction function corrects the area - // defined by the calibration ROI. - IMAQ_USER_ROI = 2, // The correction function corrects the area defined by - // the user-defined ROI. - IMAQ_CALIBRATION_AND_USER_ROI = - 3, // The correction function corrects the area defined by the - // intersection of the user-defined ROI and the calibration ROI. - IMAQ_CALIBRATION_OR_USER_ROI = - 4, // The correction function corrects the area defined by the union of - // the user-defined ROI and the calibration ROI. - IMAQ_CALIBRATION_ROI_SIZE_GUARD = 0xFFFFFFFF -} CalibrationROI; - -typedef enum ContourType_enum { - IMAQ_EMPTY_CONTOUR = 0, // The contour is empty. - IMAQ_POINT = 1, // The contour represents a point. - IMAQ_LINE = 2, // The contour represents a line. - IMAQ_RECT = 3, // The contour represents a rectangle. - IMAQ_OVAL = 4, // The contour represents an oval. - IMAQ_CLOSED_CONTOUR = 5, // The contour represents a series of connected - // points where the last point connects to the - // first. - IMAQ_OPEN_CONTOUR = 6, // The contour represents a series of connected points - // where the last point does not connect to the first. - IMAQ_ANNULUS = 7, // The contour represents an annulus. - IMAQ_ROTATED_RECT = 8, // The contour represents a rotated rectangle. - IMAQ_CONTOUR_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ContourType; - -typedef enum MathTransformMethod_enum { - IMAQ_TRANSFORM_LINEAR = 0, // The function uses linear remapping. - IMAQ_TRANSFORM_LOG = 1, // The function uses logarithmic remapping. - IMAQ_TRANSFORM_EXP = 2, // The function uses exponential remapping. - IMAQ_TRANSFORM_SQR = 3, // The function uses square remapping. - IMAQ_TRANSFORM_SQRT = 4, // The function uses square root remapping. - IMAQ_TRANSFORM_POWX = 5, // The function uses power X remapping. - IMAQ_TRANSFORM_POW1X = 6, // The function uses power 1/X remapping. - IMAQ_MATH_TRANSFORM_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MathTransformMethod; - -typedef enum ComplexPlane_enum { - IMAQ_REAL = - 0, // The function operates on the real plane of the complex image. - IMAQ_IMAGINARY = - 1, // The function operates on the imaginary plane of the complex image. - IMAQ_MAGNITUDE = - 2, // The function operates on the magnitude plane of the complex image. - IMAQ_PHASE = - 3, // The function operates on the phase plane of the complex image. - IMAQ_COMPLEX_PLANE_SIZE_GUARD = 0xFFFFFFFF -} ComplexPlane; - -typedef enum PaletteType_enum { - IMAQ_PALETTE_GRAY = 0, // The function uses a palette that has a gradual - // gray-level variation from black to white. - IMAQ_PALETTE_BINARY = 1, // The function uses a palette of 16 cycles of 16 - // different colors that is useful with binary - // images. - IMAQ_PALETTE_GRADIENT = 2, // The function uses a palette that has a - // gradation from red to white with a prominent - // range of light blue in the upper value range. - IMAQ_PALETTE_RAINBOW = 3, // The function uses a palette that has a gradation - // from blue to red with a prominent range of - // greens in the middle value range. - IMAQ_PALETTE_TEMPERATURE = 4, // The function uses a palette that has a - // gradation from light brown to dark brown. - IMAQ_PALETTE_USER = 5, // The function uses a palette defined by the user. - IMAQ_PALETTE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} PaletteType; - -typedef enum ColorSensitivity_enum { - IMAQ_SENSITIVITY_LOW = 0, // Instructs the algorithm to divide the hue plane - // into a low number of sectors, allowing for - // simple color analysis. - IMAQ_SENSITIVITY_MED = 1, // Instructs the algorithm to divide the hue plane - // into a medium number of sectors, allowing for - // color analysis that balances sensitivity and - // complexity. - IMAQ_SENSITIVITY_HIGH = 2, // Instructs the algorithm to divide the hue plane - // into a high number of sectors, allowing for - // complex, sensitive color analysis. - IMAQ_COLOR_SENSITIVITY_SIZE_GUARD = 0xFFFFFFFF -} ColorSensitivity; - -typedef enum ColorMode_enum { - IMAQ_RGB = - 0, // The function operates in the RGB (Red, Blue, Green) color space. - IMAQ_HSL = 1, // The function operates in the HSL (Hue, Saturation, - // Luminance) color space. - IMAQ_HSV = 2, // The function operates in the HSV (Hue, Saturation, Value) - // color space. - IMAQ_HSI = 3, // The function operates in the HSI (Hue, Saturation, - // Intensity) color space. - IMAQ_CIE = 4, // The function operates in the CIE L*a*b* color space. - IMAQ_CIEXYZ = 5, // The function operates in the CIE XYZ color space. - IMAQ_COLOR_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColorMode; - -typedef enum DetectionMode_enum { - IMAQ_DETECT_PEAKS = 0, // The function detects peaks. - IMAQ_DETECT_VALLEYS = 1, // The function detects valleys. - IMAQ_DETECTION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DetectionMode; - -typedef enum CalibrationUnit_enum { - IMAQ_UNDEFINED = 0, // The image does not have a defined unit of measurement. - IMAQ_ANGSTROM = 1, // The unit of measure for the image is angstroms. - IMAQ_MICROMETER = 2, // The unit of measure for the image is micrometers. - IMAQ_MILLIMETER = 3, // The unit of measure for the image is millimeters. - IMAQ_CENTIMETER = 4, // The unit of measure for the image is centimeters. - IMAQ_METER = 5, // The unit of measure for the image is meters. - IMAQ_KILOMETER = 6, // The unit of measure for the image is kilometers. - IMAQ_MICROINCH = 7, // The unit of measure for the image is microinches. - IMAQ_INCH = 8, // The unit of measure for the image is inches. - IMAQ_FOOT = 9, // The unit of measure for the image is feet. - IMAQ_NAUTICMILE = 10, // The unit of measure for the image is nautical miles. - IMAQ_GROUNDMILE = 11, // The unit of measure for the image is ground miles. - IMAQ_STEP = 12, // The unit of measure for the image is steps. - IMAQ_CALIBRATION_UNIT_SIZE_GUARD = 0xFFFFFFFF -} CalibrationUnit; - -typedef enum ConcentricRakeDirection_enum { - IMAQ_COUNTER_CLOCKWISE = 0, // The function searches the search area in a - // counter-clockwise direction. - IMAQ_CLOCKWISE = - 1, // The function searches the search area in a clockwise direction. - IMAQ_CONCENTRIC_RAKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} ConcentricRakeDirection; - -typedef enum CalibrationMode_enum { - IMAQ_PERSPECTIVE = 0, // Functions correct for distortion caused by the - // camera's perspective. - IMAQ_NONLINEAR = - 1, // Functions correct for distortion caused by the camera's lens. - IMAQ_SIMPLE_CALIBRATION = 2, // Functions do not correct for distortion. - IMAQ_CORRECTED_IMAGE = 3, // The image is already corrected. - IMAQ_CALIBRATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} CalibrationMode; - -typedef enum BrowserLocation_enum { - IMAQ_INSERT_FIRST_FREE = - 0, // Inserts the thumbnail in the first available cell. - IMAQ_INSERT_END = 1, // Inserts the thumbnail after the last occupied cell. - IMAQ_BROWSER_LOCATION_SIZE_GUARD = 0xFFFFFFFF -} BrowserLocation; - -typedef enum BrowserFrameStyle_enum { - IMAQ_RAISED_FRAME = 0, // Each thumbnail has a raised frame. - IMAQ_BEVELLED_FRAME = 1, // Each thumbnail has a beveled frame. - IMAQ_OUTLINE_FRAME = 2, // Each thumbnail has an outlined frame. - IMAQ_HIDDEN_FRAME = 3, // Each thumbnail has a hidden frame. - IMAQ_STEP_FRAME = 4, // Each thumbnail has a stepped frame. - IMAQ_RAISED_OUTLINE_FRAME = - 5, // Each thumbnail has a raised, outlined frame. - IMAQ_BROWSER_FRAME_STYLE_SIZE_GUARD = 0xFFFFFFFF -} BrowserFrameStyle; - -typedef enum BorderMethod_enum { - IMAQ_BORDER_MIRROR = - 0, // Symmetrically copies pixel values from the image into the border. - IMAQ_BORDER_COPY = 1, // Copies the value of the pixel closest to the edge of - // the image into the border. - IMAQ_BORDER_CLEAR = 2, // Sets all pixels in the border to 0. - IMAQ_BORDER_METHOD_SIZE_GUARD = 0xFFFFFFFF -} BorderMethod; - -typedef enum BarcodeType_enum { - IMAQ_INVALID = -1, // The barcode is not of a type known by NI Vision. - IMAQ_CODABAR = 1, // The barcode is of type Codabar. - IMAQ_CODE39 = 2, // The barcode is of type Code 39. - IMAQ_CODE93 = 4, // The barcode is of type Code 93. - IMAQ_CODE128 = 8, // The barcode is of type Code 128. - IMAQ_EAN8 = 16, // The barcode is of type EAN 8. - IMAQ_EAN13 = 32, // The barcode is of type EAN 13. - IMAQ_I2_OF_5 = 64, // The barcode is of type Code 25. - IMAQ_MSI = 128, // The barcode is of type MSI code. - IMAQ_UPCA = 256, // The barcode is of type UPC A. - IMAQ_PHARMACODE = 512, // The barcode is of type Pharmacode. - IMAQ_RSS_LIMITED = 1024, // The barcode is of type RSS Limited. - IMAQ_BARCODE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} BarcodeType; - -typedef enum AxisOrientation_enum { - IMAQ_DIRECT = 0, // The y-axis direction corresponds to the y-axis direction - // of the Cartesian coordinate system. - IMAQ_INDIRECT = 1, // The y-axis direction corresponds to the y-axis - // direction of an image. - IMAQ_AXIS_ORIENTATION_SIZE_GUARD = 0xFFFFFFFF -} AxisOrientation; - -typedef enum ColorIgnoreMode_enum { - IMAQ_IGNORE_NONE = - 0, // Specifies that the function does not ignore any pixels. - IMAQ_IGNORE_BLACK = 1, // Specifies that the function ignores black pixels. - IMAQ_IGNORE_WHITE = 2, // Specifies that the function ignores white pixels. - IMAQ_IGNORE_BLACK_AND_WHITE = - 3, // Specifies that the function ignores black pixels and white pixels. - IMAQ_BLACK_WHITE_IGNORE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColorIgnoreMode; - -typedef enum LevelType_enum { - IMAQ_ABSOLUTE = 0, // The function evaluates the threshold and hysteresis - // values as absolute values. - IMAQ_RELATIVE = 1, // The function evaluates the threshold and hysteresis - // values relative to the dynamic range of the given path. - IMAQ_LEVEL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} LevelType; - -typedef enum MatchingMode_enum { - IMAQ_MATCH_SHIFT_INVARIANT = 1, // Searches for occurrences of the template - // image anywhere in the searchRect, assuming - // that the pattern is not rotated more than - // plus or minus 4 degrees. - IMAQ_MATCH_ROTATION_INVARIANT = 2, // Searches for occurrences of the pattern - // in the image with no restriction on the - // rotation of the pattern. - IMAQ_MATCHING_MODE_SIZE_GUARD = 0xFFFFFFFF -} MatchingMode; - -typedef enum MappingMethod_enum { - IMAQ_FULL_DYNAMIC = 0, //(Obsolete) When the image bit depth is 0, the - //function maps the full dynamic range of the 16-bit - //image to an 8-bit scale. - IMAQ_DOWNSHIFT = 1, //(Obsolete) When the image bit depth is 0, the function - //shifts the 16-bit image pixels to the right the number - //of times specified by the shiftCount element of the - //DisplayMapping structure. - IMAQ_RANGE = 2, //(Obsolete) When the image bit depth is 0, the function maps - //the pixel values in the range specified by the minimumValue - //and maximumValue elements of the DisplayMapping structure - //to an 8-bit scale. - IMAQ_90_PCT_DYNAMIC = - 3, //(Obsolete) When the image bit depth to 0, the function maps the - //dynamic range containing the middle 90 percent of the cumulated - //histogram of the image to an 8-bit (256 grayscale values) scale. - IMAQ_PERCENT_RANGE = 4, //(Obsolete) When the image bit depth is 0, the - //function maps the pixel values in the relative - //percentage range (0 to 100) of the cumulated - //histogram specified by minimumValue and - //maximumValue to an 8-bit scale. - IMAQ_DEFAULT_MAPPING = - 10, // If the bit depth is 0, the function maps the 16-bit image to 8 - // bits by following the IMAQ_FULL_DYNAMIC_ALWAYS behavior; - // otherwise, the function shifts the image data to the right - // according to the IMAQ_MOST_SIGNIFICANT behavior. - IMAQ_MOST_SIGNIFICANT = 11, // The function shifts the 16-bit image pixels to - // the right until the 8 most significant bits of - // the image data are remaining. - IMAQ_FULL_DYNAMIC_ALWAYS = 12, // The function maps the full dynamic range of - // the 16-bit image to an 8-bit scale. - IMAQ_DOWNSHIFT_ALWAYS = 13, // The function shifts the 16-bit image pixels to - // the right the number of times specified by the - // shiftCount element of the DisplayMapping - // structure. - IMAQ_RANGE_ALWAYS = 14, // The function maps the pixel values in the range - // specified by the minimumValue and maximumValue - // elements of the DisplayMapping structure to an - // 8-bit scale. - IMAQ_90_PCT_DYNAMIC_ALWAYS = 15, // The function maps the dynamic range - // containing the middle 90 percent of the - // cumulated histogram of the image to an - // 8-bit (256 grayscale values) scale. - IMAQ_PERCENT_RANGE_ALWAYS = - 16, // The function maps the pixel values in the relative percentage - // range (0 to 100) of the cumulated histogram specified by - // minimumValue and maximumValue to an 8-bit scale. - IMAQ_MAPPING_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MappingMethod; - -typedef enum ComparisonFunction_enum { - IMAQ_CLEAR_LESS = 0, // The comparison is true if the source pixel value is - // less than the comparison image pixel value. - IMAQ_CLEAR_LESS_OR_EQUAL = 1, // The comparison is true if the source pixel - // value is less than or equal to the - // comparison image pixel value. - IMAQ_CLEAR_EQUAL = 2, // The comparison is true if the source pixel value is - // equal to the comparison image pixel value. - IMAQ_CLEAR_GREATER_OR_EQUAL = 3, // The comparison is true if the source - // pixel value is greater than or equal to - // the comparison image pixel value. - IMAQ_CLEAR_GREATER = 4, // The comparison is true if the source pixel value - // is greater than the comparison image pixel value. - IMAQ_COMPARE_FUNCTION_SIZE_GUARD = 0xFFFFFFFF -} ComparisonFunction; - -typedef enum LineGaugeMethod_enum { - IMAQ_EDGE_TO_EDGE = 0, // Measures from the first edge on the line to the - // last edge on the line. - IMAQ_EDGE_TO_POINT = 1, // Measures from the first edge on the line to the - // end point of the line. - IMAQ_POINT_TO_EDGE = 2, // Measures from the start point of the line to the - // first edge on the line. - IMAQ_POINT_TO_POINT = 3, // Measures from the start point of the line to the - // end point of the line. - IMAQ_LINE_GAUGE_METHOD_SIZE_GUARD = 0xFFFFFFFF -} LineGaugeMethod; - -typedef enum Direction3D_enum { - IMAQ_3D_NW = 0, // The viewing angle for the 3D image is from the northwest. - IMAQ_3D_SW = 1, // The viewing angle for the 3D image is from the southwest. - IMAQ_3D_SE = 2, // The viewing angle for the 3D image is from the southeast. - IMAQ_3D_NE = 3, // The viewing angle for the 3D image is from the northeast. - IMAQ_DIRECTION_3D_SIZE_GUARD = 0xFFFFFFFF -} Direction3D; - -typedef enum LearningMode_enum { - IMAQ_LEARN_ALL = 0, // The function extracts information for shift- and - // rotation-invariant matching. - IMAQ_LEARN_SHIFT_INFORMATION = - 1, // The function extracts information for shift-invariant matching. - IMAQ_LEARN_ROTATION_INFORMATION = - 2, // The function extracts information for rotation-invariant matching. - IMAQ_LEARNING_MODE_SIZE_GUARD = 0xFFFFFFFF -} LearningMode; - -typedef enum KernelFamily_enum { - IMAQ_GRADIENT_FAMILY = 0, // The kernel is in the gradient family. - IMAQ_LAPLACIAN_FAMILY = 1, // The kernel is in the Laplacian family. - IMAQ_SMOOTHING_FAMILY = 2, // The kernel is in the smoothing family. - IMAQ_GAUSSIAN_FAMILY = 3, // The kernel is in the Gaussian family. - IMAQ_KERNEL_FAMILY_SIZE_GUARD = 0xFFFFFFFF -} KernelFamily; - -typedef enum InterpolationMethod_enum { - IMAQ_ZERO_ORDER = 0, // The function uses an interpolation method that - // interpolates new pixel values using the nearest valid - // neighboring pixel. - IMAQ_BILINEAR = 1, // The function uses an interpolation method that - // interpolates new pixel values using a bidirectional - // average of the neighboring pixels. - IMAQ_QUADRATIC = 2, // The function uses an interpolation method that - // interpolates new pixel values using a quadratic - // approximating polynomial. - IMAQ_CUBIC_SPLINE = 3, // The function uses an interpolation method that - // interpolates new pixel values by fitting them to a - // cubic spline curve, where the curve is based on - // known pixel values from the image. - IMAQ_BILINEAR_FIXED = 4, // The function uses an interpolation method that - // interpolates new pixel values using a - // bidirectional average of the neighboring pixels. - IMAQ_INTERPOLATION_METHOD_SIZE_GUARD = 0xFFFFFFFF -} InterpolationMethod; - -typedef enum ImageType_enum { - IMAQ_IMAGE_U8 = 0, // The image type is 8-bit unsigned integer grayscale. - IMAQ_IMAGE_U16 = 7, // The image type is 16-bit unsigned integer grayscale. - IMAQ_IMAGE_I16 = 1, // The image type is 16-bit signed integer grayscale. - IMAQ_IMAGE_SGL = 2, // The image type is 32-bit floating-point grayscale. - IMAQ_IMAGE_COMPLEX = 3, // The image type is complex. - IMAQ_IMAGE_RGB = 4, // The image type is RGB color. - IMAQ_IMAGE_HSL = 5, // The image type is HSL color. - IMAQ_IMAGE_RGB_U64 = 6, // The image type is 64-bit unsigned RGB color. - IMAQ_IMAGE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ImageType; - -typedef enum ImageFeatureMode_enum { - IMAQ_COLOR_AND_SHAPE_FEATURES = 0, // Instructs the function to use the color - // and the shape features of the color - // pattern. - IMAQ_COLOR_FEATURES = 1, // Instructs the function to use the color features - // of the color pattern. - IMAQ_SHAPE_FEATURES = 2, // Instructs the function to use the shape features - // of the color pattern. - IMAQ_FEATURE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ImageFeatureMode; - -typedef enum FontColor_enum { - IMAQ_WHITE = 0, // Draws text in white. - IMAQ_BLACK = 1, // Draws text in black. - IMAQ_INVERT = 2, // Inverts the text pixels. - IMAQ_BLACK_ON_WHITE = 3, // Draws text in black with a white background. - IMAQ_WHITE_ON_BLACK = 4, // Draws text in white with a black background. - IMAQ_FONT_COLOR_SIZE_GUARD = 0xFFFFFFFF -} FontColor; - -typedef enum FlipAxis_enum { - IMAQ_HORIZONTAL_AXIS = - 0, // Flips the image over the central horizontal axis. - IMAQ_VERTICAL_AXIS = 1, // Flips the image over the central vertical axis. - IMAQ_CENTER_AXIS = - 2, // Flips the image over both the central vertical and horizontal axes. - IMAQ_DIAG_L_TO_R_AXIS = 3, // Flips the image over an axis from the upper - // left corner to lower right corner. - IMAQ_DIAG_R_TO_L_AXIS = 4, // Flips the image over an axis from the upper - // right corner to lower left corner. - IMAQ_FLIP_AXIS_SIZE_GUARD = 0xFFFFFFFF -} FlipAxis; - -typedef enum EdgeProcess_enum { - IMAQ_FIRST = 0, // The function looks for the first edge. - IMAQ_FIRST_AND_LAST = 1, // The function looks for the first and last edge. - IMAQ_ALL = 2, // The function looks for all edges. - IMAQ_BEST = 3, // The function looks for the best edge. - IMAQ_EDGE_PROCESS_SIZE_GUARD = 0xFFFFFFFF -} EdgeProcess; - -typedef enum DrawMode_enum { - IMAQ_DRAW_VALUE = - 0, // Draws the boundary of the object with the specified pixel value. - IMAQ_DRAW_INVERT = - 2, // Inverts the pixel values of the boundary of the object. - IMAQ_PAINT_VALUE = 1, // Fills the object with the given pixel value. - IMAQ_PAINT_INVERT = 3, // Inverts the pixel values of the object. - IMAQ_HIGHLIGHT_VALUE = 4, // The function fills the object by highlighting - // the enclosed pixels with the color of the - // object. - IMAQ_DRAW_MODE_SIZE_GUARD = 0xFFFFFFFF -} DrawMode; - -typedef enum NearestNeighborMetric_enum { - IMAQ_METRIC_MAXIMUM = 0, // The maximum metric. - IMAQ_METRIC_SUM = 1, // The sum metric. - IMAQ_METRIC_EUCLIDEAN = 2, // The Euclidean metric. - IMAQ_NEAREST_NEIGHBOR_METRIC_SIZE_GUARD = 0xFFFFFFFF -} NearestNeighborMetric; - -typedef enum ReadResolution_enum { - IMAQ_LOW_RESOLUTION = - 0, // Configures NI Vision to use low resolution during the read process. - IMAQ_MEDIUM_RESOLUTION = 1, // Configures NI Vision to use medium resolution - // during the read process. - IMAQ_HIGH_RESOLUTION = 2, // Configures NI Vision to use high resolution - // during the read process. - IMAQ_READ_RESOLUTION_SIZE_GUARD = 0xFFFFFFFF -} ReadResolution; - -typedef enum ThresholdMode_enum { - IMAQ_FIXED_RANGE = 0, // Performs thresholding using the values you provide - // in the lowThreshold and highThreshold elements of - // OCRProcessingOptions. - IMAQ_COMPUTED_UNIFORM = - 1, // Calculates a single threshold value for the entire ROI. - IMAQ_COMPUTED_LINEAR = 2, // Calculates a value on the left side of the ROI, - // calculates a value on the right side of the ROI, - // and linearly fills the middle values from left - // to right. - IMAQ_COMPUTED_NONLINEAR = 3, // Divides the ROI into the number of blocks - // specified by the blockCount element of - // OCRProcessingOptions and calculates a - // threshold value for each block. - IMAQ_THRESHOLD_MODE_SIZE_GUARD = 0xFFFFFFFF -} ThresholdMode; - -typedef enum ReadStrategy_enum { - IMAQ_READ_AGGRESSIVE = 0, // Configures NI Vision to perform fewer checks - // when analyzing objects to determine if they - // match trained characters. - IMAQ_READ_CONSERVATIVE = 1, // Configures NI Vision to perform more checks to - // determine if an object matches a trained - // character. - IMAQ_READ_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} ReadStrategy; - -typedef enum MeasurementType_enum { - IMAQ_MT_CENTER_OF_MASS_X = 0, // X-coordinate of the point representing the - // average position of the total particle mass, - // assuming every point in the particle has a - // constant density. - IMAQ_MT_CENTER_OF_MASS_Y = 1, // Y-coordinate of the point representing the - // average position of the total particle mass, - // assuming every point in the particle has a - // constant density. - IMAQ_MT_FIRST_PIXEL_X = - 2, // X-coordinate of the highest, leftmost particle pixel. - IMAQ_MT_FIRST_PIXEL_Y = - 3, // Y-coordinate of the highest, leftmost particle pixel. - IMAQ_MT_BOUNDING_RECT_LEFT = - 4, // X-coordinate of the leftmost particle point. - IMAQ_MT_BOUNDING_RECT_TOP = 5, // Y-coordinate of highest particle point. - IMAQ_MT_BOUNDING_RECT_RIGHT = - 6, // X-coordinate of the rightmost particle point. - IMAQ_MT_BOUNDING_RECT_BOTTOM = - 7, // Y-coordinate of the lowest particle point. - IMAQ_MT_MAX_FERET_DIAMETER_START_X = - 8, // X-coordinate of the start of the line segment connecting the two - // perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_START_Y = - 9, // Y-coordinate of the start of the line segment connecting the two - // perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_END_X = - 10, // X-coordinate of the end of the line segment connecting the two - // perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_END_Y = - 11, // Y-coordinate of the end of the line segment connecting the two - // perimeter points that are the furthest apart. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_LEFT = - 12, // X-coordinate of the leftmost pixel in the longest row of - // contiguous pixels in the particle. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_RIGHT = - 13, // X-coordinate of the rightmost pixel in the longest row of - // contiguous pixels in the particle. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_ROW = - 14, // Y-coordinate of all of the pixels in the longest row of contiguous - // pixels in the particle. - IMAQ_MT_BOUNDING_RECT_WIDTH = - 16, // Distance between the x-coordinate of the leftmost particle point - // and the x-coordinate of the rightmost particle point. - IMAQ_MT_BOUNDING_RECT_HEIGHT = - 17, // Distance between the y-coordinate of highest particle point and - // the y-coordinate of the lowest particle point. - IMAQ_MT_BOUNDING_RECT_DIAGONAL = - 18, // Distance between opposite corners of the bounding rectangle. - IMAQ_MT_PERIMETER = 19, // Length of the outer boundary of the particle. - IMAQ_MT_CONVEX_HULL_PERIMETER = 20, // Perimeter of the smallest convex - // polygon containing all points in the - // particle. - IMAQ_MT_HOLES_PERIMETER = - 21, // Sum of the perimeters of each hole in the particle. - IMAQ_MT_MAX_FERET_DIAMETER = 22, // Distance between the start and end of the - // line segment connecting the two perimeter - // points that are the furthest apart. - IMAQ_MT_EQUIVALENT_ELLIPSE_MAJOR_AXIS = - 23, // Length of the major axis of the ellipse with the same perimeter - // and area as the particle. - IMAQ_MT_EQUIVALENT_ELLIPSE_MINOR_AXIS = - 24, // Length of the minor axis of the ellipse with the same perimeter - // and area as the particle. - IMAQ_MT_EQUIVALENT_ELLIPSE_MINOR_AXIS_FERET = - 25, // Length of the minor axis of the ellipse with the same area as the - // particle, and Major Axis equal in length to the Max Feret - // Diameter. - IMAQ_MT_EQUIVALENT_RECT_LONG_SIDE = 26, // Longest side of the rectangle with - // the same perimeter and area as the - // particle. - IMAQ_MT_EQUIVALENT_RECT_SHORT_SIDE = 27, // Shortest side of the rectangle - // with the same perimeter and area - // as the particle. - IMAQ_MT_EQUIVALENT_RECT_DIAGONAL = 28, // Distance between opposite corners - // of the rectangle with the same - // perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_RECT_SHORT_SIDE_FERET = - 29, // Shortest side of the rectangle with the same area as the particle, - // and longest side equal in length to the Max Feret Diameter. - IMAQ_MT_AVERAGE_HORIZ_SEGMENT_LENGTH = - 30, // Average length of a horizontal segment in the particle. - IMAQ_MT_AVERAGE_VERT_SEGMENT_LENGTH = - 31, // Average length of a vertical segment in the particle. - IMAQ_MT_HYDRAULIC_RADIUS = - 32, // The particle area divided by the particle perimeter. - IMAQ_MT_WADDEL_DISK_DIAMETER = - 33, // Diameter of a disk with the same area as the particle. - IMAQ_MT_AREA = 35, // Area of the particle. - IMAQ_MT_HOLES_AREA = 36, // Sum of the areas of each hole in the particle. - IMAQ_MT_PARTICLE_AND_HOLES_AREA = - 37, // Area of a particle that completely covers the image. - IMAQ_MT_CONVEX_HULL_AREA = 38, // Area of the smallest convex polygon - // containing all points in the particle. - IMAQ_MT_IMAGE_AREA = 39, // Area of the image. - IMAQ_MT_NUMBER_OF_HOLES = 41, // Number of holes in the particle. - IMAQ_MT_NUMBER_OF_HORIZ_SEGMENTS = - 42, // Number of horizontal segments in the particle. - IMAQ_MT_NUMBER_OF_VERT_SEGMENTS = - 43, // Number of vertical segments in the particle. - IMAQ_MT_ORIENTATION = 45, // The angle of the line that passes through the - // particle Center of Mass about which the particle - // has the lowest moment of inertia. - IMAQ_MT_MAX_FERET_DIAMETER_ORIENTATION = - 46, // The angle of the line segment connecting the two perimeter points - // that are the furthest apart. - IMAQ_MT_AREA_BY_IMAGE_AREA = - 48, // Percentage of the particle Area covering the Image Area. - IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA = 49, // Percentage of the particle - // Area in relation to its - // Particle and Holes Area. - IMAQ_MT_RATIO_OF_EQUIVALENT_ELLIPSE_AXES = 50, // Equivalent Ellipse Major - // Axis divided by Equivalent - // Ellipse Minor Axis. - IMAQ_MT_RATIO_OF_EQUIVALENT_RECT_SIDES = - 51, // Equivalent Rect Long Side divided by Equivalent Rect Short Side. - IMAQ_MT_ELONGATION_FACTOR = - 53, // Max Feret Diameter divided by Equivalent Rect Short Side (Feret). - IMAQ_MT_COMPACTNESS_FACTOR = 54, // Area divided by the product of Bounding - // Rect Width and Bounding Rect Height. - IMAQ_MT_HEYWOOD_CIRCULARITY_FACTOR = 55, // Perimeter divided by the - // circumference of a circle with - // the same area. - IMAQ_MT_TYPE_FACTOR = 56, // Factor relating area to moment of inertia. - IMAQ_MT_SUM_X = 58, // The sum of all x-coordinates in the particle. - IMAQ_MT_SUM_Y = 59, // The sum of all y-coordinates in the particle. - IMAQ_MT_SUM_XX = 60, // The sum of all x-coordinates squared in the particle. - IMAQ_MT_SUM_XY = - 61, // The sum of all x-coordinates times y-coordinates in the particle. - IMAQ_MT_SUM_YY = 62, // The sum of all y-coordinates squared in the particle. - IMAQ_MT_SUM_XXX = 63, // The sum of all x-coordinates cubed in the particle. - IMAQ_MT_SUM_XXY = 64, // The sum of all x-coordinates squared times - // y-coordinates in the particle. - IMAQ_MT_SUM_XYY = 65, // The sum of all x-coordinates times y-coordinates - // squared in the particle. - IMAQ_MT_SUM_YYY = 66, // The sum of all y-coordinates cubed in the particle. - IMAQ_MT_MOMENT_OF_INERTIA_XX = - 68, // The moment of inertia in the x-direction twice. - IMAQ_MT_MOMENT_OF_INERTIA_XY = - 69, // The moment of inertia in the x and y directions. - IMAQ_MT_MOMENT_OF_INERTIA_YY = - 70, // The moment of inertia in the y-direction twice. - IMAQ_MT_MOMENT_OF_INERTIA_XXX = - 71, // The moment of inertia in the x-direction three times. - IMAQ_MT_MOMENT_OF_INERTIA_XXY = 72, // The moment of inertia in the - // x-direction twice and the y-direction - // once. - IMAQ_MT_MOMENT_OF_INERTIA_XYY = 73, // The moment of inertia in the - // x-direction once and the y-direction - // twice. - IMAQ_MT_MOMENT_OF_INERTIA_YYY = - 74, // The moment of inertia in the y-direction three times. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XX = - 75, // The normalized moment of inertia in the x-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XY = - 76, // The normalized moment of inertia in the x- and y-directions. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_YY = - 77, // The normalized moment of inertia in the y-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XXX = - 78, // The normalized moment of inertia in the x-direction three times. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XXY = 79, // The normalized moment of inertia - // in the x-direction twice and the - // y-direction once. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XYY = 80, // The normalized moment of inertia - // in the x-direction once and the - // y-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_YYY = - 81, // The normalized moment of inertia in the y-direction three times. - IMAQ_MT_HU_MOMENT_1 = 82, // The first Hu moment. - IMAQ_MT_HU_MOMENT_2 = 83, // The second Hu moment. - IMAQ_MT_HU_MOMENT_3 = 84, // The third Hu moment. - IMAQ_MT_HU_MOMENT_4 = 85, // The fourth Hu moment. - IMAQ_MT_HU_MOMENT_5 = 86, // The fifth Hu moment. - IMAQ_MT_HU_MOMENT_6 = 87, // The sixth Hu moment. - IMAQ_MT_HU_MOMENT_7 = 88, // The seventh Hu moment. - IMAQ_MEASUREMENT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} MeasurementType; - -typedef enum GeometricMatchingMode_enum { - IMAQ_GEOMETRIC_MATCH_SHIFT_INVARIANT = - 0, // Searches for occurrences of the pattern in the image, assuming that - // the pattern is not rotated more than plus or minus 5 degrees. - IMAQ_GEOMETRIC_MATCH_ROTATION_INVARIANT = - 1, // Searches for occurrences of the pattern in the image with reduced - // restriction on the rotation of the pattern. - IMAQ_GEOMETRIC_MATCH_SCALE_INVARIANT = - 2, // Searches for occurrences of the pattern in the image with reduced - // restriction on the size of the pattern. - IMAQ_GEOMETRIC_MATCH_OCCLUSION_INVARIANT = - 4, // Searches for occurrences of the pattern in the image, allowing for - // a specified percentage of the pattern to be occluded. - IMAQ_GEOMETRIC_MATCHING_MODE_SIZE_GUARD = 0xFFFFFFFF -} GeometricMatchingMode; - -typedef enum ButtonLabel_enum { - IMAQ_BUTTON_OK = 0, // The label "OK". - IMAQ_BUTTON_SAVE = 1, // The label "Save". - IMAQ_BUTTON_SELECT = 2, // The label "Select". - IMAQ_BUTTON_LOAD = 3, // The label "Load". - IMAQ_BUTTON_LABEL_SIZE_GUARD = 0xFFFFFFFF -} ButtonLabel; - -typedef enum NearestNeighborMethod_enum { - IMAQ_MINIMUM_MEAN_DISTANCE = 0, // The minimum mean distance method. - IMAQ_K_NEAREST_NEIGHBOR = 1, // The k-nearest neighbor method. - IMAQ_NEAREST_PROTOTYPE = 2, // The nearest prototype method. - IMAQ_NEAREST_NEIGHBOR_METHOD_SIZE_GUARD = 0xFFFFFFFF -} NearestNeighborMethod; - -typedef enum QRMirrorMode_enum { - IMAQ_QR_MIRROR_MODE_AUTO_DETECT = - -2, // The function should determine if the QR code is mirrored. - IMAQ_QR_MIRROR_MODE_MIRRORED = - 1, // The function should expect the QR code to appear mirrored. - IMAQ_QR_MIRROR_MODE_NORMAL = - 0, // The function should expect the QR code to appear normal. - IMAQ_QR_MIRROR_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRMirrorMode; - -typedef enum ColumnProcessingMode_enum { - IMAQ_AVERAGE_COLUMNS = 0, // Averages the data extracted for edge detection. - IMAQ_MEDIAN_COLUMNS = - 1, // Takes the median of the data extracted for edge detection. - IMAQ_COLUMN_PROCESSING_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColumnProcessingMode; - -typedef enum FindReferenceDirection_enum { - IMAQ_LEFT_TO_RIGHT_DIRECT = 0, // Searches from the left side of the search - // area to the right side of the search area - // for a direct axis. - IMAQ_LEFT_TO_RIGHT_INDIRECT = 1, // Searches from the left side of the search - // area to the right side of the search area - // for an indirect axis. - IMAQ_TOP_TO_BOTTOM_DIRECT = 2, // Searches from the top of the search area to - // the bottom of the search area for a direct - // axis. - IMAQ_TOP_TO_BOTTOM_INDIRECT = 3, // Searches from the top of the search area - // to the bottom of the search area for an - // indirect axis. - IMAQ_RIGHT_TO_LEFT_DIRECT = 4, // Searches from the right side of the search - // area to the left side of the search area - // for a direct axis. - IMAQ_RIGHT_TO_LEFT_INDIRECT = 5, // Searches from the right side of the - // search area to the left side of the - // search area for an indirect axis. - IMAQ_BOTTOM_TO_TOP_DIRECT = 6, // Searches from the bottom of the search area - // to the top of the search area for a direct - // axis. - IMAQ_BOTTOM_TO_TOP_INDIRECT = 7, // Searches from the bottom of the search - // area to the top of the search area for an - // indirect axis. - IMAQ_FIND_COORD_SYS_DIR_SIZE_GUARD = 0xFFFFFFFF -} FindReferenceDirection; - -typedef enum MulticoreOperation_enum { - IMAQ_GET_CORES = - 0, // The number of processor cores NI Vision is currently using. - IMAQ_SET_CORES = 1, // The number of processor cores for NI Vision to use. - IMAQ_USE_MAX_AVAILABLE = - 2, // Use the maximum number of available processor cores. - IMAQ_MULTICORE_OPERATION_SIZE_GUARD = 0xFFFFFFFF -} MulticoreOperation; - -typedef enum GroupBehavior_enum { - IMAQ_GROUP_CLEAR = 0, // Sets the behavior of the overlay group to clear the - // current settings when an image is transformed. - IMAQ_GROUP_KEEP = 1, // Sets the behavior of the overlay group to keep the - // current settings when an image is transformed. - IMAQ_GROUP_TRANSFORM = - 2, // Sets the behavior of the overlay group to transform with the image. - IMAQ_GROUP_BEHAVIOR_SIZE_GUARD = 0xFFFFFFFF -} GroupBehavior; - -typedef enum QRDimensions_enum { - IMAQ_QR_DIMENSIONS_AUTO_DETECT = 0, // The function will automatically - // determine the dimensions of the QR - // code. - IMAQ_QR_DIMENSIONS_11x11 = - 11, // Specifies the dimensions of the QR code as 11 x 11. - IMAQ_QR_DIMENSIONS_13x13 = - 13, // Specifies the dimensions of the QR code as 13 x 13. - IMAQ_QR_DIMENSIONS_15x15 = - 15, // Specifies the dimensions of the QR code as 15 x 15. - IMAQ_QR_DIMENSIONS_17x17 = - 17, // Specifies the dimensions of the QR code as 17 x 17. - IMAQ_QR_DIMENSIONS_21x21 = - 21, // Specifies the dimensions of the QR code as 21 x 21. - IMAQ_QR_DIMENSIONS_25x25 = - 25, // Specifies the dimensions of the QR code as 25 x 25. - IMAQ_QR_DIMENSIONS_29x29 = - 29, // Specifies the dimensions of the QR code as 29 x 29. - IMAQ_QR_DIMENSIONS_33x33 = - 33, // Specifies the dimensions of the QR code as 33 x 33. - IMAQ_QR_DIMENSIONS_37x37 = - 37, // Specifies the dimensions of the QR code as 37 x 37. - IMAQ_QR_DIMENSIONS_41x41 = - 41, // Specifies the dimensions of the QR code as 41 x 41. - IMAQ_QR_DIMENSIONS_45x45 = - 45, // Specifies the dimensions of the QR code as 45 x 45. - IMAQ_QR_DIMENSIONS_49x49 = - 49, // Specifies the dimensions of the QR code as 49 x 49. - IMAQ_QR_DIMENSIONS_53x53 = - 53, // Specifies the dimensions of the QR code as 53 x 53. - IMAQ_QR_DIMENSIONS_57x57 = - 57, // Specifies the dimensions of the QR code as 57 x 57. - IMAQ_QR_DIMENSIONS_61x61 = - 61, // Specifies the dimensions of the QR code as 61 x 61. - IMAQ_QR_DIMENSIONS_65x65 = - 65, // Specifies the dimensions of the QR code as 65 x 65. - IMAQ_QR_DIMENSIONS_69x69 = - 69, // Specifies the dimensions of the QR code as 69 x 69. - IMAQ_QR_DIMENSIONS_73x73 = - 73, // Specifies the dimensions of the QR code as 73 x 73. - IMAQ_QR_DIMENSIONS_77x77 = - 77, // Specifies the dimensions of the QR code as 77 x 77. - IMAQ_QR_DIMENSIONS_81x81 = - 81, // Specifies the dimensions of the QR code as 81 x 81. - IMAQ_QR_DIMENSIONS_85x85 = - 85, // Specifies the dimensions of the QR code as 85 x 85. - IMAQ_QR_DIMENSIONS_89x89 = - 89, // Specifies the dimensions of the QR code as 89 x 89. - IMAQ_QR_DIMENSIONS_93x93 = - 93, // Specifies the dimensions of the QR code as 93 x 93. - IMAQ_QR_DIMENSIONS_97x97 = - 97, // Specifies the dimensions of the QR code as 97 x 97. - IMAQ_QR_DIMENSIONS_101x101 = - 101, // Specifies the dimensions of the QR code as 101 x 101. - IMAQ_QR_DIMENSIONS_105x105 = - 105, // Specifies the dimensions of the QR code as 105 x 105. - IMAQ_QR_DIMENSIONS_109x109 = - 109, // Specifies the dimensions of the QR code as 109 x 109. - IMAQ_QR_DIMENSIONS_113x113 = - 113, // Specifies the dimensions of the QR code as 113 x 113. - IMAQ_QR_DIMENSIONS_117x117 = - 117, // Specifies the dimensions of the QR code as 117 x 117. - IMAQ_QR_DIMENSIONS_121x121 = - 121, // Specifies the dimensions of the QR code as 121 x 121. - IMAQ_QR_DIMENSIONS_125x125 = - 125, // Specifies the dimensions of the QR code as 125 x 125. - IMAQ_QR_DIMENSIONS_129x129 = - 129, // Specifies the dimensions of the QR code as 129 x 129. - IMAQ_QR_DIMENSIONS_133x133 = - 133, // Specifies the dimensions of the QR code as 133 x 133. - IMAQ_QR_DIMENSIONS_137x137 = - 137, // Specifies the dimensions of the QR code as 137 x 137. - IMAQ_QR_DIMENSIONS_141x141 = - 141, // Specifies the dimensions of the QR code as 141 x 141. - IMAQ_QR_DIMENSIONS_145x145 = - 145, // Specifies the dimensions of the QR code as 145 x 145. - IMAQ_QR_DIMENSIONS_149x149 = - 149, // Specifies the dimensions of the QR code as 149 x 149. - IMAQ_QR_DIMENSIONS_153x153 = - 153, // Specifies the dimensions of the QR code as 153 x 153. - IMAQ_QR_DIMENSIONS_157x157 = - 157, // Specifies the dimensions of the QR code as 157 x 1537. - IMAQ_QR_DIMENSIONS_161x161 = - 161, // Specifies the dimensions of the QR code as 161 x 161. - IMAQ_QR_DIMENSIONS_165x165 = - 165, // Specifies the dimensions of the QR code as 165 x 165. - IMAQ_QR_DIMENSIONS_169x169 = - 169, // Specifies the dimensions of the QR code as 169 x 169. - IMAQ_QR_DIMENSIONS_173x173 = - 173, // Specifies the dimensions of the QR code as 173 x 173. - IMAQ_QR_DIMENSIONS_177x177 = - 177, // Specifies the dimensions of the QR code as 177 x 177. - IMAQ_QR_DIMENSIONS_SIZE_GUARD = 0xFFFFFFFF -} QRDimensions; - -typedef enum QRCellFilterMode_enum { - IMAQ_QR_CELL_FILTER_MODE_AUTO_DETECT = - -2, // The function will try all filter modes and uses the one that - // decodes the QR code within the fewest iterations and utilizing the - // least amount of error correction. - IMAQ_QR_CELL_FILTER_MODE_AVERAGE = 0, // The function sets the pixel value - // for the cell to the average of the - // sampled pixels. - IMAQ_QR_CELL_FILTER_MODE_MEDIAN = 1, // The function sets the pixel value for - // the cell to the median of the sampled - // pixels. - IMAQ_QR_CELL_FILTER_MODE_CENTRAL_AVERAGE = - 2, // The function sets the pixel value for the cell to the average of - // the pixels in the center of the cell sample. - IMAQ_QR_CELL_FILTER_MODE_HIGH_AVERAGE = - 3, // The function sets the pixel value for the cell to the average value - // of the half of the sampled pixels with the highest pixel values. - IMAQ_QR_CELL_FILTER_MODE_LOW_AVERAGE = - 4, // The function sets the pixel value for the cell to the average value - // of the half of the sampled pixels with the lowest pixel values. - IMAQ_QR_CELL_FILTER_MODE_VERY_HIGH_AVERAGE = - 5, // The function sets the pixel value for the cell to the average value - // of the ninth of the sampled pixels with the highest pixel values. - IMAQ_QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE = - 6, // The function sets the pixel value for the cell to the average value - // of the ninth of the sampled pixels with the lowest pixel values. - IMAQ_QR_CELL_FILTER_MODE_ALL = - 8, // The function tries each filter mode, starting with - // IMAQ_QR_CELL_FILTER_MODE_AVERAGE and ending with - // IMAQ_QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE, stopping once a filter - // mode decodes correctly. - IMAQ_QR_CELL_FILTER_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRCellFilterMode; - -typedef enum RoundingMode_enum { - IMAQ_ROUNDING_MODE_OPTIMIZE = - 0, // Rounds the result of a division using the best available method. - IMAQ_ROUNDING_MODE_TRUNCATE = 1, // Truncates the result of a division. - IMAQ_ROUNDING_MODE_SIZE_GUARD = 0xFFFFFFFF -} RoundingMode; - -typedef enum QRDemodulationMode_enum { - IMAQ_QR_DEMODULATION_MODE_AUTO_DETECT = - -2, // The function will try each demodulation mode and use the one which - // decodes the QR code within the fewest iterations and utilizing the - // least amount of error correction. - IMAQ_QR_DEMODULATION_MODE_HISTOGRAM = 0, // The function uses a histogram of - // all of the QR cells to calculate - // a threshold. - IMAQ_QR_DEMODULATION_MODE_LOCAL_CONTRAST = - 1, // The function examines each of the cell's neighbors to determine if - // the cell is on or off. - IMAQ_QR_DEMODULATION_MODE_COMBINED = 2, // The function uses the histogram of - // the QR code to calculate a - // threshold. - IMAQ_QR_DEMODULATION_MODE_ALL = - 3, // The function tries IMAQ_QR_DEMODULATION_MODE_HISTOGRAM, then - // IMAQ_QR_DEMODULATION_MODE_LOCAL_CONTRAST and then - // IMAQ_QR_DEMODULATION_MODE_COMBINED, stopping once one mode is - // successful. - IMAQ_QR_DEMODULATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRDemodulationMode; - -typedef enum ContrastMode_enum { - IMAQ_ORIGINAL_CONTRAST = 0, // Instructs the geometric matching algorithm to - // find matches with the same contrast as the - // template. - IMAQ_REVERSED_CONTRAST = 1, // Instructs the geometric matching algorithm to - // find matches with the inverted contrast of the - // template. - IMAQ_BOTH_CONTRASTS = 2, // Instructs the geometric matching algorithm to - // find matches with the same and inverted contrast - // of the template. -} ContrastMode; - -typedef enum QRPolarities_enum { - IMAQ_QR_POLARITY_AUTO_DETECT = - -2, // The function should determine the polarity of the QR code. - IMAQ_QR_POLARITY_BLACK_ON_WHITE = 0, // The function should search for a QR - // code with dark data on a bright - // background. - IMAQ_QR_POLARITY_WHITE_ON_BLACK = 1, // The function should search for a QR - // code with bright data on a dark - // background. - IMAQ_QR_POLARITY_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRPolarities; - -typedef enum QRRotationMode_enum { - IMAQ_QR_ROTATION_MODE_UNLIMITED = - 0, // The function allows for unlimited rotation. - IMAQ_QR_ROTATION_MODE_0_DEGREES = - 1, // The function allows for ??? 5 degrees of rotation. - IMAQ_QR_ROTATION_MODE_90_DEGREES = - 2, // The function allows for between 85 and 95 degrees of rotation. - IMAQ_QR_ROTATION_MODE_180_DEGREES = - 3, // The function allows for between 175 and 185 degrees of rotation. - IMAQ_QR_ROTATION_MODE_270_DEGREES = - 4, // The function allows for between 265 and 275 degrees of rotation. - IMAQ_QR_ROTATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRRotationMode; - -typedef enum QRGradingMode_enum { - IMAQ_QR_NO_GRADING = - 0, // The function does not make any preparatory calculations. - IMAQ_QR_GRADING_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRGradingMode; - -typedef enum StraightEdgeSearchMode_enum { - IMAQ_USE_FIRST_RAKE_EDGES = - 0, // Fits a straight edge on the first points detected using a rake. - IMAQ_USE_BEST_RAKE_EDGES = - 1, // Fits a straight edge on the best points detected using a rake. - IMAQ_USE_BEST_HOUGH_LINE = 2, // Finds the strongest straight edge using all - // points detected on a rake. - IMAQ_USE_FIRST_PROJECTION_EDGE = - 3, // Uses the location of the first projected edge as the straight edge. - IMAQ_USE_BEST_PROJECTION_EDGE = 4, // Finds the strongest projected edge - // location to determine the straight - // edge. - IMAQ_STRAIGHT_EDGE_SEARCH_SIZE_GUARD = 0xFFFFFFFF -} StraightEdgeSearchMode; - -typedef enum SearchDirection_enum { - IMAQ_SEARCH_DIRECTION_LEFT_TO_RIGHT = 0, // Searches from the left side of - // the search area to the right side - // of the search area. - IMAQ_SEARCH_DIRECTION_RIGHT_TO_LEFT = 1, // Searches from the right side of - // the search area to the left side - // of the search area. - IMAQ_SEARCH_DIRECTION_TOP_TO_BOTTOM = 2, // Searches from the top side of the - // search area to the bottom side of - // the search area. - IMAQ_SEARCH_DIRECTION_BOTTOM_TO_TOP = 3, // Searches from the bottom side of - // the search area to the top side - // of the search area. - IMAQ_SEARCH_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} SearchDirection; - -typedef enum QRStreamMode_enum { - IMAQ_QR_MODE_NUMERIC = - 0, // Specifies that the data was encoded using numeric mode. - IMAQ_QR_MODE_ALPHANUMERIC = - 1, // Specifies that the data was encoded using alpha-numeric mode. - IMAQ_QR_MODE_RAW_BYTE = 2, // Specifies that the data was not encoded but is - // only raw binary bytes, or encoded in JIS-8. - IMAQ_QR_MODE_EAN128_TOKEN = 3, // Specifies that the data has a special - // meaning represented by the application ID. - IMAQ_QR_MODE_EAN128_DATA = 4, // Specifies that the data has a special - // meaning represented by the application ID. - IMAQ_QR_MODE_ECI = 5, // Specifies that the data was meant to be read using - // the language represented in the language ID. - IMAQ_QR_MODE_KANJI = - 6, // Specifies that the data was encoded in Shift-JIS16 Japanese. - IMAQ_QR_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRStreamMode; - -typedef enum ParticleClassifierType_enum { - IMAQ_PARTICLE_LARGEST = 0, // Use only the largest particle in the image. - IMAQ_PARTICLE_ALL = 1, // Use all particles in the image. - IMAQ_PARTICLE_CLASSIFIER_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ParticleClassifierType; - -typedef enum QRCellSampleSize_enum { - IMAQ_QR_CELL_SAMPLE_SIZE_AUTO_DETECT = - -2, // The function will try each sample size and use the one which - // decodes the QR code within the fewest iterations and utilizing the - // least amount of error correction. - IMAQ_QR_CELL_SAMPLE_SIZE1X1 = - 1, // The function will use a 1x1 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE2X2 = - 2, // The function will use a 2x2 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE3X3 = - 3, // The function will use a 3x3 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE4X4 = - 4, // The function will use a 4x4 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE5X5 = - 5, // The function will use a 5x5 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE6X6 = - 6, // The function will use a 6x6 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE7X7 = - 7, // The function will use a 7x7 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} QRCellSampleSize; - -typedef enum RakeProcessType_enum { - IMAQ_GET_FIRST_EDGES = 0, - IMAQ_GET_FIRST_AND_LAST_EDGES = 1, - IMAQ_GET_ALL_EDGES = 2, - IMAQ_GET_BEST_EDGES = 3, - IMAQ_RAKE_PROCESS_TYPE_SIZE_GUARD = 0xFFFFFFFF -} RakeProcessType; - -typedef enum GeometricSetupDataItem_enum { - IMAQ_CURVE_EXTRACTION_MODE = - 0, // Specifies how the function identifies curves in the image. - IMAQ_CURVE_EDGE_THRSHOLD = 1, // Specifies the minimum contrast an edge pixel - // must have for it to be considered part of a - // curve. - IMAQ_CURVE_EDGE_FILTER = 2, // Specifies the width of the edge filter that - // the function uses to identify curves in the - // image. - IMAQ_MINIMUM_CURVE_LENGTH = 3, // Specifies the length, in pixels, of the - // smallest curve that you want the function - // to identify. - IMAQ_CURVE_ROW_SEARCH_STEP_SIZE = - 4, // Specifies the distance, in the y direction, between the image rows - // that the algorithm inspects for curve seed points. - IMAQ_CURVE_COL_SEARCH_STEP_SIZE = - 5, // Specifies the distance, in the x direction, between the image - // columns that the algorithm inspects for curve seed points. - IMAQ_CURVE_MAX_END_POINT_GAP = - 6, // Specifies the maximum gap, in pixels, between the endpoints of a - // curve that the function identifies as a closed curve. - IMAQ_EXTRACT_CLOSED_CURVES = - 7, // Specifies whether to identify only closed curves in the image. - IMAQ_ENABLE_SUBPIXEL_CURVE_EXTRACTION = - 8, // The function ignores this option. - IMAQ_ENABLE_CORRELATION_SCORE = 9, // Specifies that the function should - // calculate the Correlation Score and - // return it for each match result. - IMAQ_ENABLE_SUBPIXEL_ACCURACY = 10, // Determines whether to return the match - // results with subpixel accuracy. - IMAQ_SUBPIXEL_ITERATIONS = 11, // Specifies the maximum number of incremental - // improvements used to refine matches using - // subpixel information. - IMAQ_SUBPIXEL_TOLERANCE = - 12, // Specifies the maximum amount of change, in pixels, between - // consecutive incremental improvements in the match position before - // the function stops refining the match position. - IMAQ_INITIAL_MATCH_LIST_LENGTH = - 13, // Specifies the maximum size of the match list. - IMAQ_ENABLE_TARGET_TEMPLATE_CURVESCORE = - 14, // Specifies whether the function should calculate the match curve to - // template curve score and return it for each match result. - IMAQ_MINIMUM_MATCH_SEPARATION_DISTANCE = - 15, // Specifies the minimum separation distance, in pixels, between the - // origins of two matches that have unique positions. - IMAQ_MINIMUM_MATCH_SEPARATION_ANGLE = - 16, // Specifies the minimum angular difference, in degrees, between two - // matches that have unique angles. - IMAQ_MINIMUM_MATCH_SEPARATION_SCALE = - 17, // Specifies the minimum difference in scale, expressed as a - // percentage, between two matches that have unique scales. - IMAQ_MAXIMUM_MATCH_OVERLAP = 18, // Specifies whether you want the algorithm - // to spend less time accurately estimating - // the location of a match. - IMAQ_ENABLE_COARSE_RESULT = 19, // Specifies whether you want the algorithm - // to spend less time accurately estimating - // the location of a match. - IMAQ_ENABLE_CALIBRATION_SUPPORT = 20, // Specifies whether or not the - // algorithm treat the inspection image - // as a calibrated image. - IMAQ_ENABLE_CONTRAST_REVERSAL = - 21, // Specifies the contrast of the matches to search for. - IMAQ_SEARCH_STRATEGY = 22, // Specifies the aggressiveness of the strategy - // used to find matches in the image. - IMAQ_REFINEMENT_MATCH_FACTOR = - 23, // Specifies the factor applied to the number of matches requested to - // determine how many matches are refined in the pyramid stage. - IMAQ_SUBPIXEL_MATCH_FACTOR = 24, // Specifies the factor applied to the - // number for matches requested to determine - // how many matches are used for the final - // (subpixel) stage. - IMAQ_MAX_REFINEMENT_ITERATIONS = - 25, // Specifies maximum refinement iteration. -} GeometricSetupDataItem; - -typedef enum DistortionModel_enum { - IMAQ_POLYNOMIAL_MODEL = 0, // Polynomial model. - IMAQ_DIVISION_MODEL = 1, // Division Model. - IMAQ_NO_DISTORTION_MODEL = -1, // Not a distortion model. -} DistortionModel; - -typedef enum CalibrationThumbnailType_enum { - IMAQ_CAMARA_MODEL_TYPE = 0, // Camara model thumbnail type. - IMAQ_PERSPECTIVE_TYPE = 1, // Perspective thumbnail type. - IMAQ_MICRO_PLANE_TYPE = 2, // Micro Plane thumbnail type. - IMAQ_CALIBRATION_THUMBNAIL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} CalibrationThumbnailType; - -typedef enum SettingType_enum { - IMAQ_ROTATION_ANGLE_RANGE = 0, // Set a range for this option to specify the - // angles at which you expect the Function to - // find template matches in the inspection - // image. - IMAQ_SCALE_RANGE = 1, // Set a range for this option to specify the sizes at - // which you expect the Function to find template - // matches in the inspection image. - IMAQ_OCCLUSION_RANGE = 2, // Set a range for this option to specify the - // amount of occlusion you expect for a match in - // the inspection image. - IMAQ_SETTING_TYPE_SIZE_GUARD = 0xFFFFFFFF -} SettingType; - -typedef enum SegmentationDistanceLevel_enum { - IMAQ_SEGMENTATION_LEVEL_CONSERVATIVE = - 0, // Uses extensive criteria to determine the Maximum Distance. - IMAQ_SEGMENTATION_LEVEL_AGGRESSIVE = - 1, // Uses few criteria to determine the Maximum Distance. - IMAQ_SEGMENTATION_LEVEL_SIZE_GUARD = 0xFFFFFFFF -} SegmentationDistanceLevel; - -typedef enum ExtractContourSelection_enum { - IMAQ_CLOSEST = 0, // Selects the curve closest to the ROI. - IMAQ_LONGEST = 1, // Selects the longest curve. - IMAQ_STRONGEST = 2, // Selects the curve with the highest edge strength - // averaged from each point on the curve. - IMAQ_EXTRACT_CONTOUR_SELECTION_SIZE_GUARD = 0xFFFFFFFF -} ExtractContourSelection; - -typedef enum FindTransformMode_enum { - IMAQ_FIND_REFERENCE = 0, // Update both parts of the coordinate system. - IMAQ_UPDATE_TRANSFORM = 1, // Update only the new reference system. - IMAQ_FIND_TRANSFORM_MODE_SIZE_GUARD = 0xFFFFFFFF -} FindTransformMode; - -typedef enum ExtractContourDirection_enum { - IMAQ_RECT_LEFT_RIGHT = 0, // Searches the ROI from left to right. - IMAQ_RECT_RIGHT_LEFT = 1, // Searches the ROI from right to left. - IMAQ_RECT_TOP_BOTTOM = 2, // Searches the ROI from top to bottom. - IMAQ_RECT_BOTTOM_TOP = 3, // Searches the ROI from bottom to top. - IMAQ_ANNULUS_INNER_OUTER = - 4, // Searches the ROI from the inner radius to the outer radius. - IMAQ_ANNULUS_OUTER_INNER = - 5, // Searches the ROI from the outer radius to the inner radius. - IMAQ_ANNULUS_START_STOP = - 6, // Searches the ROI from start angle to end angle. - IMAQ_ANNULUS_STOP_START = - 7, // Searches the ROI from end angle to start angle. - IMAQ_EXTRACT_CONTOUR_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} ExtractContourDirection; - -typedef enum EdgePolaritySearchMode_enum { - IMAQ_SEARCH_FOR_ALL_EDGES = 0, // Searches for all edges. - IMAQ_SEARCH_FOR_RISING_EDGES = 1, // Searches for rising edges only. - IMAQ_SEARCH_FOR_FALLING_EDGES = 2, // Searches for falling edges only. - IMAQ_EDGE_POLARITY_MODE_SIZE_GUARD = 0xFFFFFFFF -} EdgePolaritySearchMode; - -typedef enum Connectivity_enum { - IMAQ_FOUR_CONNECTED = - 0, // Morphological reconstruction is performed in connectivity mode 4. - IMAQ_EIGHT_CONNECTED = - 1, // Morphological reconstruction is performed in connectivity mode 8. - IMAQ_CONNECTIVITY_SIZE_GUARD = 0xFFFFFFFF -} Connectivity; - -typedef enum MorphologyReconstructOperation_enum { - IMAQ_DILATE_RECONSTRUCT = 0, // Performs Reconstruction by dilation. - IMAQ_ERODE_RECONSTRUCT = 1, // Performs Reconstruction by erosion. - IMAQ_MORPHOLOGY_RECONSTRUCT_OPERATION_SIZE_GUARD = 0xFFFFFFFF -} MorphologyReconstructOperation; - -typedef enum WaveletType_enum { - IMAQ_DB02 = 0, - IMAQ_DB03 = 1, - IMAQ_DB04 = 2, // Specifies the Wavelet Type as DB02. - IMAQ_DB05 = 3, - IMAQ_DB06 = 4, - IMAQ_DB07 = 5, - IMAQ_DB08 = 6, - IMAQ_DB09 = 7, - IMAQ_DB10 = 8, - IMAQ_DB11 = 9, - IMAQ_DB12 = 10, - IMAQ_DB13 = 11, - IMAQ_DB14 = 12, - IMAQ_HAAR = 13, - IMAQ_BIOR1_3 = 14, - IMAQ_BIOR1_5 = 15, - IMAQ_BIOR2_2 = 16, - IMAQ_BIOR2_4 = 17, - IMAQ_BIOR2_6 = 18, - IMAQ_BIOR2_8 = 19, - IMAQ_BIOR3_1 = 20, - IMAQ_BIOR3_3 = 21, - IMAQ_BIOR3_5 = 22, - IMAQ_BIOR3_7 = 23, - IMAQ_BIOR3_9 = 24, - IMAQ_BIOR4_4 = 25, - IMAQ_COIF1 = 26, - IMAQ_COIF2 = 27, - IMAQ_COIF3 = 28, - IMAQ_COIF4 = 29, - IMAQ_COIF5 = 30, - IMAQ_SYM2 = 31, - IMAQ_SYM3 = 32, - IMAQ_SYM4 = 33, - IMAQ_SYM5 = 34, - IMAQ_SYM6 = 35, - IMAQ_SYM7 = 36, - IMAQ_SYM8 = 37, - IMAQ_BIOR5_5 = 38, - IMAQ_BIOR6_8 = 39, - IMAQ_WAVE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} WaveletType; - -typedef enum ParticleClassifierThresholdType_enum { - IMAQ_THRESHOLD_MANUAL = 0, // The classifier performs a manual threshold on - // the image during preprocessing. - IMAQ_THRESHOLD_AUTO = 1, // The classifier performs an auto threshold on the - // image during preprocessing. - IMAQ_THRESHOLD_LOCAL = 2, // The classifier performs a local threshold on the - // image during preprocessing. -} ParticleClassifierThresholdType; - -typedef enum MeasureParticlesCalibrationMode_enum { - IMAQ_CALIBRATION_MODE_PIXEL = 0, // The function takes only pixel - // measurements on the particles in the - // image. - IMAQ_CALIBRATION_MODE_CALIBRATED = 1, // The function takes only calibrated - // measurements on the particles in the - // image. - IMAQ_CALIBRATION_MODE_BOTH = 2, // The function takes both pixel and - // calibrated measurements on the particles - // in the image. - IMAQ_MEASURE_PARTICLES_CALIBRATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} MeasureParticlesCalibrationMode; - -typedef enum GeometricMatchingSearchStrategy_enum { - IMAQ_GEOMETRIC_MATCHING_CONSERVATIVE = - 0, // Instructs the pattern matching algorithm to use the largest - // possible amount of information from the image at the expense of - // slowing down the speed of the algorithm. - IMAQ_GEOMETRIC_MATCHING_BALANCED = - 1, // Instructs the pattern matching algorithm to balance the amount of - // information from the image it uses with the speed of the algorithm. - IMAQ_GEOMETRIC_MATCHING_AGGRESSIVE = - 2, // Instructs the pattern matching algorithm to use a lower amount of - // information from the image, which allows the algorithm to run - // quickly but at the expense of accuracy. - IMAQ_GEOMETRIC_MATCHING_SEARCH_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} GeometricMatchingSearchStrategy; - -typedef enum ColorClassificationResolution_enum { - IMAQ_CLASSIFIER_LOW_RESOLUTION = - 0, // Low resolution version of the color classifier. - IMAQ_CLASSIFIER_MEDIUM_RESOLUTION = - 1, // Medium resolution version of the color classifier. - IMAQ_CLASSIFIER_HIGH_RESOLUTION = - 2, // High resolution version of the color classifier. - IMAQ_CLASSIFIER_RESOLUTION_SIZE_GUARD = 0xFFFFFFFF -} ColorClassificationResolution; - -typedef enum ConnectionConstraintType_enum { - IMAQ_DISTANCE_CONSTRAINT = 0, // Specifies the distance, in pixels, within - // which the end points of two curves must lie - // in order to be considered part of a contour. - IMAQ_ANGLE_CONSTRAINT = - 1, // Specifies the range, in degrees, within which the difference - // between the angle of two curves, measured at the end points, must - // lie in order for the two curves to be considered part of a contour. - IMAQ_CONNECTIVITY_CONSTRAINT = - 2, // Specifies the distance, in pixels, within which a line extended - // from the end point of a curve must pass the end point of another - // curve in order for the two curves to be considered part of a - // contour. - IMAQ_GRADIENT_CONSTRAINT = - 3, // Specifies the range, in degrees, within which the gradient angles - // of two curves, measured at the end points, must lie in order for - // the two curves to be considered part of a contour. - IMAQ_NUM_CONNECTION_CONSTRAINT_TYPES = 4, //. - IMAQ_CONNECTION_CONSTRAINT_SIZE_GUARD = 0xFFFFFFFF -} ConnectionConstraintType; - -typedef enum Barcode2DContrast_enum { - IMAQ_ALL_BARCODE_2D_CONTRASTS = - 0, // The function searches for barcodes of each contrast type. - IMAQ_BLACK_ON_WHITE_BARCODE_2D = 1, // The function searches for 2D barcodes - // containing black data on a white - // background. - IMAQ_WHITE_ON_BLACK_BARCODE_2D = 2, // The function searches for 2D barcodes - // containing white data on a black - // background. - IMAQ_BARCODE_2D_CONTRAST_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DContrast; - -typedef enum QRModelType_enum { - IMAQ_QR_MODELTYPE_AUTO_DETECT = - 0, // Specifies that the function will auto-detect the type of QR code. - IMAQ_QR_MODELTYPE_MICRO = 1, // Specifies the QR code is of a micro type. - IMAQ_QR_MODELTYPE_MODEL1 = 2, // Specifies the QR code is of a model1 type. - IMAQ_QR_MODELTYPE_MODEL2 = 3, // Specifies the QR code is of a model2 type. - IMAQ_QR_MODEL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} QRModelType; - -typedef enum WindowBackgroundFillStyle_enum { - IMAQ_FILL_STYLE_SOLID = 0, // Fill the display window with a solid color. - IMAQ_FILL_STYLE_HATCH = 2, // Fill the display window with a pattern defined - // by WindowBackgroundHatchStyle. - IMAQ_FILL_STYLE_DEFAULT = - 3, // Fill the display window with the NI Vision default pattern. - IMAQ_FILL_STYLE_SIZE_GUARD = 0xFFFFFFFF -} WindowBackgroundFillStyle; - -typedef enum ExtractionMode_enum { - IMAQ_NORMAL_IMAGE = 0, // Specifies that the function makes no assumptions - // about the uniformity of objects in the image or the - // image background. - IMAQ_UNIFORM_REGIONS = 1, // Specifies that the function assumes that either - // the objects in the image or the image background - // consists of uniform pixel values. - IMAQ_EXTRACTION_MODE_SIZE_GUARD = 0xFFFFFFFF -} ExtractionMode; - -typedef enum EdgeFilterSize_enum { - IMAQ_FINE = - 0, // Specifies that the function uses a fine (narrow) edge filter. - IMAQ_NORMAL = 1, // Specifies that the function uses a normal edge filter. - IMAQ_CONTOUR_TRACING = 2, // Sets the Edge Filter Size to contour tracing, - // which provides the best results for contour - // extraction but increases the time required to - // process the image. - IMAQ_EDGE_FILTER_SIZE_SIZE_GUARD = 0xFFFFFFFF -} EdgeFilterSize; - -typedef enum Barcode2DSearchMode_enum { - IMAQ_SEARCH_MULTIPLE = 0, // The function searches for multiple 2D barcodes. - IMAQ_SEARCH_SINGLE_CONSERVATIVE = - 1, // The function searches for 2D barcodes using the same searching - // algorithm as IMAQ_SEARCH_MULTIPLE but stops searching after - // locating one valid barcode. - IMAQ_SEARCH_SINGLE_AGGRESSIVE = - 2, // The function searches for a single 2D barcode using a method that - // assumes the barcode occupies a majority of the search region. - IMAQ_BARCODE_2D_SEARCH_MODE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DSearchMode; - -typedef enum DataMatrixSubtype_enum { - IMAQ_ALL_DATA_MATRIX_SUBTYPES = - 0, // The function searches for Data Matrix barcodes of all subtypes. - IMAQ_DATA_MATRIX_SUBTYPES_ECC_000_ECC_140 = - 1, // The function searches for Data Matrix barcodes of subtypes ECC 000, - // ECC 050, ECC 080, ECC 100 and ECC 140. - IMAQ_DATA_MATRIX_SUBTYPE_ECC_200 = - 2, // The function searches for Data Matrix ECC 200 barcodes. - IMAQ_DATA_MATRIX_SUBTYPE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixSubtype; - -typedef enum FeatureType_enum { - IMAQ_NOT_FOUND_FEATURE = 0, // Specifies the feature is not found. - IMAQ_CIRCLE_FEATURE = 1, // Specifies the feature is a circle. - IMAQ_ELLIPSE_FEATURE = 2, // Specifies the feature is an ellipse. - IMAQ_CONST_CURVE_FEATURE = 3, // Specifies the features is a constant curve. - IMAQ_RECTANGLE_FEATURE = 4, // Specifies the feature is a rectangle. - IMAQ_LEG_FEATURE = 5, // Specifies the feature is a leg. - IMAQ_CORNER_FEATURE = 6, // Specifies the feature is a corner. - IMAQ_PARALLEL_LINE_PAIR_FEATURE = - 7, // Specifies the feature is a parallel line pair. - IMAQ_PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE = - 8, // Specifies the feature is a pair of parallel line pairs. - IMAQ_LINE_FEATURE = 9, // Specifies the feature is a line. - IMAQ_CLOSED_CURVE_FEATURE = 10, // Specifies the feature is a closed curve. - IMAQ_FEATURE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} FeatureType; - -typedef enum Barcode2DCellShape_enum { - IMAQ_SQUARE_CELLS = 0, // The function uses an algorithm for decoding the 2D - // barcode that works with square data cells. - IMAQ_ROUND_CELLS = 1, // The function uses an algorithm for decoding the 2D - // barcode that works with round data cells. - IMAQ_BARCODE_2D_CELL_SHAPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DCellShape; - -typedef enum LocalThresholdMethod_enum { - IMAQ_NIBLACK = 0, // The function computes thresholds for each pixel based on - // its local statistics using the Niblack local - // thresholding algorithm. - IMAQ_BACKGROUND_CORRECTION = - 1, // The function performs background correction first to eliminate - // non-uniform lighting effects, then performs thresholding using the - // Otsu thresholding algorithm. - IMAQ_LOCAL_THRESHOLD_METHOD_SIZE_GUARD = 0xFFFFFFFF -} LocalThresholdMethod; - -typedef enum Barcode2DType_enum { - IMAQ_PDF417 = 0, // The 2D barcode is of type PDF417. - IMAQ_DATA_MATRIX_ECC_000 = - 1, // The 2D barcode is of type Data Matrix ECC 000. - IMAQ_DATA_MATRIX_ECC_050 = - 2, // The 2D barcode is of type Data Matrix ECC 050. - IMAQ_DATA_MATRIX_ECC_080 = - 3, // The 2D barcode is of type Data Matrix ECC 080. - IMAQ_DATA_MATRIX_ECC_100 = - 4, // The 2D barcode is of type Data Matrix ECC 100. - IMAQ_DATA_MATRIX_ECC_140 = - 5, // The 2D barcode is of type Data Matrix ECC 140. - IMAQ_DATA_MATRIX_ECC_200 = - 6, // The 2D barcode is of type Data Matrix ECC 200. - IMAQ_BARCODE_2D_TYPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DType; - -typedef enum ClassifierEngineType_enum { - IMAQ_ENGINE_NONE = 0, // No engine has been set on this classifier session. - IMAQ_ENGINE_NEAREST_NEIGHBOR = 1, // Nearest neighbor engine. - IMAQ_ENGINE_SUPPORT_VECTOR_MACHINE = 2, - IMAQ_CLASSIFIER_ENGINE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ClassifierEngineType; - -typedef enum ClassifierType_enum { - IMAQ_CLASSIFIER_CUSTOM = - 0, // The classifier session classifies vectors of doubles. - IMAQ_CLASSIFIER_PARTICLE = - 1, // The classifier session classifies particles in binary images. - IMAQ_CLASSIFIER_COLOR = - 2, // The classifier session classifies an image based on its color. - IMAQ_CLASSIFIER_TEXTURE = - 3, // The classifier session classifies an image based on its texture. - IMAQ_CLASSIFIER_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ClassifierType; - -typedef enum ParticleType_enum { - IMAQ_PARTICLE_BRIGHT = 0, // Bright particles. - IMAQ_PARTICLE_DARK = 1, // Dark particles. - IMAQ_PARTICLE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ParticleType; - -typedef enum VisionInfoType2_enum { - IMAQ_VISIONINFO_CALIBRATION = 0x01, // Used to indicate interaction with the - // Calibration information in an image. - IMAQ_VISIONINFO_OVERLAY = 0x02, // Used to indicate interaction with the - // Overlay information in an image. - IMAQ_VISIONINFO_GRAYTEMPLATE = 0x04, // Used to indicate interaction with the - // grayscale template information in an - // image. - IMAQ_VISIONINFO_COLORTEMPLATE = 0x08, // Used to indicate interaction with - // the color template information in an - // image. - IMAQ_VISIONINFO_GEOMETRICTEMPLATE = 0x10, // Used to indicate interaction - // with the geometric template - // information in an image. - IMAQ_VISIONINFO_CUSTOMDATA = 0x20, // Used to indicate interaction with the - // binary or text Custom Data in an image. - IMAQ_VISIONINFO_GOLDENTEMPLATE = 0x40, // Used to indicate interaction with - // the golden template information in - // an image. - IMAQ_VISIONINFO_GEOMETRICTEMPLATE2 = 0x80, // Used to indicate interaction - // with the geometric template 2 - // information in an image. - IMAQ_VISIONINFO_ALL = 0xFFFFFFFF, // Removes, checks for, or indicates the - // presence of all types of extra - // information in an image. -} VisionInfoType2; - -typedef enum ReadClassifierFileMode_enum { - IMAQ_CLASSIFIER_READ_ALL = - 0, // Read all information from the classifier file. - IMAQ_CLASSIFIER_READ_SAMPLES = - 1, // Read only the samples from the classifier file. - IMAQ_CLASSIFIER_READ_PROPERTIES = - 2, // Read only the properties from the classifier file. - IMAQ_READ_CLASSIFIER_FILE_MODES_SIZE_GUARD = 0xFFFFFFFF -} ReadClassifierFileMode; - -typedef enum WriteClassifierFileMode_enum { - IMAQ_CLASSIFIER_WRITE_ALL = - 0, // Writes all information to the classifier file. - IMAQ_CLASSIFIER_WRITE_CLASSIFY_ONLY = 1, // Write only the information needed - // to classify to the classifier - // file. - IMAQ_WRITE_CLASSIFIER_FILE_MODES_SIZE_GUARD = 0xFFFFFFFF -} WriteClassifierFileMode; - -typedef enum Barcode2DShape_enum { - IMAQ_SQUARE_BARCODE_2D = 0, // The function searches for square 2D barcodes. - IMAQ_RECTANGULAR_BARCODE_2D = - 1, // The function searches for rectangular 2D barcodes. - IMAQ_BARCODE_2D_SHAPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DShape; - -typedef enum DataMatrixRotationMode_enum { - IMAQ_UNLIMITED_ROTATION = 0, // The function allows for unlimited rotation. - IMAQ_0_DEGREES = - 1, // The function allows for between -5 and 5 degrees of rotation. - IMAQ_90_DEGREES = - 2, // The function allows for between 85 and 95 degrees of rotation. - IMAQ_180_DEGREES = - 3, // The function allows for between 175 and 185 degrees of rotation. - IMAQ_270_DEGREES = - 4, // The function allows for between 265 and 275 degrees of rotation. - IMAQ_DATA_MATRIX_ROTATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixRotationMode; - -typedef enum AIMGrade_enum { - IMAQ_AIM_GRADE_F = 0, // The Data Matrix barcode received a grade of F. - IMAQ_AIM_GRADE_D = 1, // The Data Matrix barcode received a grade of D. - IMAQ_AIM_GRADE_C = 2, // The Data Matrix barcode received a grade of C. - IMAQ_AIM_GRADE_B = 3, // The Data Matrix barcode received a grade of B. - IMAQ_AIM_GRADE_A = 4, // The Data Matrix barcode received a grade of A. - IMAQ_DATA_MATRIX_AIM_GRADE_SIZE_GUARD = 0xFFFFFFFF -} AIMGrade; - -typedef enum DataMatrixCellFillMode_enum { - IMAQ_AUTO_DETECT_CELL_FILL_MODE = -2, // Sets the function to determine the - // Data Matrix barcode cell fill - // percentage automatically. - IMAQ_LOW_FILL = 0, // Sets the function to read Data Matrix barcodes with a - // cell fill percentage of less than 30 percent. - IMAQ_NORMAL_FILL = 1, // Sets the function to read Data Matrix barcodes with - // a cell fill percentage greater than or equal to 30 - // percent. - IMAQ_DATA_MATRIX_CELL_FILL_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellFillMode; - -typedef enum DataMatrixDemodulationMode_enum { - IMAQ_AUTO_DETECT_DEMODULATION_MODE = - -2, // The function will try each demodulation mode and use the one which - // decodes the Data Matrix barcode within the fewest iterations and - // utilizing the least amount of error correction. - IMAQ_HISTOGRAM = 0, // The function uses a histogram of all of the Data - // Matrix cells to calculate a threshold. - IMAQ_LOCAL_CONTRAST = 1, // The function examines each of the cell's - // neighbors to determine if the cell is on or off. - IMAQ_COMBINED = 2, // The function uses the histogram of the Data Matrix - // barcode to calculate a threshold. - IMAQ_ALL_DEMODULATION_MODES = - 3, // The function tries IMAQ_HISTOGRAM, then IMAQ_LOCAL_CONTRAST and - // then IMAQ_COMBINATION, stopping once one mode is successful. - IMAQ_DATA_MATRIX_DEMODULATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixDemodulationMode; - -typedef enum DataMatrixECC_enum { - IMAQ_AUTO_DETECT_ECC = -2, // Sets the function to determine the Data Matrix - // barcode ECC automatically. - IMAQ_ECC_000 = - 0, // Sets the function to read Data Matrix barcodes of ECC 000 only. - IMAQ_ECC_050 = - 50, // Sets the function to read Data Matrix barcodes of ECC 050 only. - IMAQ_ECC_080 = - 80, // Sets the function to read Data Matrix barcodes of ECC 080 only. - IMAQ_ECC_100 = - 100, // Sets the function to read Data Matrix barcodes of ECC 100 only. - IMAQ_ECC_140 = - 140, // Sets the function to read Data Matrix barcodes of ECC 140 only. - IMAQ_ECC_000_140 = 190, // Sets the function to read Data Matrix barcodes of - // ECC 000, ECC 050, ECC 080, ECC 100, and ECC 140 - // only. - IMAQ_ECC_200 = - 200, // Sets the function to read Data Matrix barcodes of ECC 200 only. - IMAQ_DATA_MATRIX_ECC_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixECC; - -typedef enum DataMatrixPolarity_enum { - IMAQ_AUTO_DETECT_POLARITY = -2, // Sets the function to determine the Data - // Matrix barcode polarity automatically. - IMAQ_BLACK_DATA_ON_WHITE_BACKGROUND = 0, // Sets the function to read Data - // Matrix barcodes with dark data on - // a bright background. - IMAQ_WHITE_DATA_ON_BLACK_BACKGROUND = 1, // Sets the function to read Data - // Matrix barcodes with bright data - // on a dark background. - IMAQ_DATA_MATRIX_POLARITY_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixPolarity; - -typedef enum DataMatrixCellFilterMode_enum { - IMAQ_AUTO_DETECT_CELL_FILTER_MODE = - -2, // The function will try all filter modes and uses the one that - // decodes the Data Matrix barcode within the fewest iterations and - // utilizing the least amount of error correction. - IMAQ_AVERAGE_FILTER = 0, // The function sets the pixel value for the cell to - // the average of the sampled pixels. - IMAQ_MEDIAN_FILTER = 1, // The function sets the pixel value for the cell to - // the median of the sampled pixels. - IMAQ_CENTRAL_AVERAGE_FILTER = 2, // The function sets the pixel value for the - // cell to the average of the pixels in the - // center of the cell sample. - IMAQ_HIGH_AVERAGE_FILTER = - 3, // The function sets the pixel value for the cell to the average value - // of the half of the sampled pixels with the highest pixel values. - IMAQ_LOW_AVERAGE_FILTER = 4, // The function sets the pixel value for the - // cell to the average value of the half of the - // sampled pixels with the lowest pixel values. - IMAQ_VERY_HIGH_AVERAGE_FILTER = - 5, // The function sets the pixel value for the cell to the average value - // of the ninth of the sampled pixels with the highest pixel values. - IMAQ_VERY_LOW_AVERAGE_FILTER = - 6, // The function sets the pixel value for the cell to the average value - // of the ninth of the sampled pixels with the lowest pixel values. - IMAQ_ALL_CELL_FILTERS = 8, // The function tries each filter mode, starting - // with IMAQ_AVERAGE_FILTER and ending with - // IMAQ_VERY_LOW_AVERAGE_FILTER, stopping once a - // filter mode decodes correctly. - IMAQ_DATA_MATRIX_CELL_FILTER_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellFilterMode; - -typedef enum WindowBackgroundHatchStyle_enum { - IMAQ_HATCH_STYLE_HORIZONTAL = - 0, // The background of the display window will be horizontal bars. - IMAQ_HATCH_STYLE_VERTICAL = - 1, // The background of the display window will be vertical bars. - IMAQ_HATCH_STYLE_FORWARD_DIAGONAL = - 2, // The background of the display window will be diagonal bars. - IMAQ_HATCH_STYLE_BACKWARD_DIAGONAL = - 3, // The background of the display window will be diagonal bars. - IMAQ_HATCH_STYLE_CROSS = 4, // The background of the display window will be - // intersecting horizontal and vertical bars. - IMAQ_HATCH_STYLE_CROSS_HATCH = 5, // The background of the display window - // will be intersecting forward and - // backward diagonal bars. - IMAQ_HATCH_STYLE_SIZE_GUARD = 0xFFFFFFFF -} WindowBackgroundHatchStyle; - -typedef enum DataMatrixMirrorMode_enum { - IMAQ_AUTO_DETECT_MIRROR = -2, // Specifies that the function should determine - // if the Data Matrix barcode is mirrored. - IMAQ_APPEARS_NORMAL = 0, // Specifies that the function should expect the - // Data Matrix barcode to appear normal. - IMAQ_APPEARS_MIRRORED = 1, // Specifies that the function should expect the - // Data Matrix barcode to appear mirrored. - IMAQ_DATA_MATRIX_MIRROR_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixMirrorMode; - -typedef enum CalibrationMode2_enum { - IMAQ_PERSPECTIVE_MODE = 0, // Functions correct for distortion caused by the - // camera's perspective. - IMAQ_MICROPLANE_MODE = - 1, // Functions correct for distortion caused by the camera's lens. - IMAQ_SIMPLE_CALIBRATION_MODE = 2, // Functions do not correct for distortion. - IMAQ_CORRECTED_IMAGE_MODE = 3, // The image is already corrected. - IMAQ_NO_CALIBRATION_MODE = 4, // Image with No calibration. - IMAQ_CALIBRATION_MODE2_SIZE_GUARD = 0xFFFFFFFF -} CalibrationMode2; - -typedef enum DataMatrixGradingMode_enum { - IMAQ_NO_GRADING = - 0, // The function does not make any preparatory calculations. - IMAQ_PREPARE_FOR_AIM = 1, // The function prepares the image for grading - // using the AIM Print Quality metrics. - IMAQ_DATA_MATRIX_GRADING_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixGradingMode; - -typedef enum WaveletTransformMode_enum { - IMAQ_WAVELET_TRANSFORM_INTEGER = - 0, // Uses a 5-3 reversible integer transform. - IMAQ_WAVELET_TRANSFORM_FLOATING_POINT = - 1, // Performs a 9-7 irreversible floating-point transform. - IMAQ_WAVELET_TRANSFORM_MODE_SIZE_GUARD = 0xFFFFFFFF -} WaveletTransformMode; - -typedef enum NormalizationMethod_enum { - IMAQ_NORMALIZATION_NONE = 0, // No normalization. - IMAQ_NORMALIZATION_HISTOGRAM_MATCHING = 1, // Adjust image so its histogram - // is similar to the golden - // template's histogram. - IMAQ_NORMALIZATION_AVERAGE_MATCHING = 2, // Adjust image so its mean pixel - // value equals the golden - // template's mean pixel value. - IMAQ_NORMALIZATION_SIZE_GUARD = 0xFFFFFFFF -} NormalizationMethod; - -typedef enum RegistrationMethod_enum { - IMAQ_REGISTRATION_NONE = 0, // No registration. - IMAQ_REGISTRATION_PERSPECTIVE = 1, // Adjust image to correct for minor - // variations in alignment or perspective. - IMAQ_REGISTRATION_SIZE_GUARD = 0xFFFFFFFF -} RegistrationMethod; - -typedef enum LinearAveragesMode_enum { - IMAQ_COLUMN_AVERAGES = 1, // Specifies that the function calculates the mean - // pixel value of each column. - IMAQ_ROW_AVERAGES = 2, // Specifies that the function calculates the mean - // pixel value of each row. - IMAQ_RISING_DIAGONAL_AVERAGES = - 4, // Specifies that the function calculates the mean pixel value of each - // diagonal running from the lower left to the upper right of the - // inspected area of the image. - IMAQ_FALLING_DIAGONAL_AVERAGES = - 8, // Specifies that the function calculates the mean pixel value of each - // diagonal running from the upper left to the lower right of the - // inspected area of the image. - IMAQ_ALL_LINEAR_AVERAGES = 15, // Specifies that the function calculates all - // four linear mean pixel values. - IMAQ_LINEAR_AVERAGES_MODE_SIZE_GUARD = 0xFFFFFFFF -} LinearAveragesMode; - -typedef enum CompressionType_enum { - IMAQ_COMPRESSION_NONE = - 0, // Specifies that the function should not compress the image. - IMAQ_COMPRESSION_JPEG = 1, // Specifies that the function should use lossy - // JPEG compression on the image. - IMAQ_COMPRESSION_PACKED_BINARY = 2, // Specifies that the function should use - // lossless binary packing on the image. - IMAQ_COMPRESSION_TYPE_SIZE_GUARD = 0xFFFFFFFF -} CompressionType; - -typedef enum FlattenType_enum { - IMAQ_FLATTEN_IMAGE = 0, // Flattens just the image data. - IMAQ_FLATTEN_IMAGE_AND_VISION_INFO = 1, // Flattens the image data and any - // Vision information associated with - // the image. - IMAQ_FLATTEN_TYPE_SIZE_GUARD = 0xFFFFFFFF -} FlattenType; - -typedef enum DataMatrixCellSampleSize_enum { - IMAQ_AUTO_DETECT_CELL_SAMPLE_SIZE = - -2, // The function will try each sample size and use the one which - // decodes the Data Matrix barcode within the fewest iterations and - // utilizing the least amount of error correction. - IMAQ_1x1 = 1, // The function will use a 1x1 sized sample from each cell. - IMAQ_2x2 = 2, // The function will use a 2x2 sized sample from each cell. - IMAQ_3x3 = 3, // The function will use a 3x3 sized sample from each cell. - IMAQ_4x4 = 4, // The function will use a 4x4 sized sample from each cell. - IMAQ_5x5 = 5, // The function will use a 5x5 sized sample from each cell. - IMAQ_6x6 = 6, // The function will use a 6x6 sized sample from each cell. - IMAQ_7x7 = 7, // The function will use a 7x7 sized sample from each cell. - IMAQ_DATA_MATRIX_CELL_SAMPLE_SIZE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellSampleSize; - -//============================================================================ -// Forward Declare Data Structures -//============================================================================ -typedef struct Image_struct Image; -typedef struct ROI_struct ROI; -typedef struct Overlay_struct Overlay; -typedef struct ClassifierSession_struct ClassifierSession; -typedef struct MultipleGeometricPattern_struct MultipleGeometricPattern; -typedef int ContourID; -typedef unsigned long SESSION_ID; -typedef int AVISession; -typedef char* FilterName; -typedef char String255[256]; -typedef struct CharSet_struct CharSet; -typedef struct OCRSpacingOptions_struct OCRSpacingOptions; -typedef struct OCRProcessingOptions_struct OCRProcessingOptions; -typedef struct ReadTextOptions_struct ReadTextOptions; -typedef struct CharInfo_struct CharInfo; -typedef struct CharReport_struct CharReport; -typedef struct ReadTextReport_struct ReadTextReport; -typedef struct DivisionModel_struct DivisionModel; -typedef struct FocalLength_struct FocalLength; -typedef struct PolyModel_struct PolyModel; -typedef struct DistortionModelParams_struct DistortionModelParams; -typedef struct PointFloat_struct PointFloat; -typedef struct InternalParameters_struct InternalParameters; -typedef struct MaxGridSize_struct MaxGridSize; -typedef struct ImageSize_struct ImageSize; -typedef struct CalibrationReferencePoints_struct CalibrationReferencePoints; -typedef struct GetCameraParametersReport_struct GetCameraParametersReport; -typedef struct CalibrationAxisInfo_struct CalibrationAxisInfo; -typedef struct CalibrationLearnSetupInfo_struct CalibrationLearnSetupInfo; -typedef struct GridDescriptor_struct GridDescriptor; -typedef struct ErrorStatistics_struct ErrorStatistics; -typedef struct GetCalibrationInfoReport_struct GetCalibrationInfoReport; -typedef struct EdgePolarity_struct EdgePolarity; -typedef struct ClampSettings_struct ClampSettings; -typedef struct PointDouble_struct PointDouble; -typedef struct PointDoublePair_struct PointDoublePair; -typedef struct ClampResults_struct ClampResults; -typedef struct ClampPoints_struct ClampPoints; -typedef struct RGBValue_struct RGBValue; -typedef struct ClampOverlaySettings_struct ClampOverlaySettings; -typedef struct ClampMax2Report_struct ClampMax2Report; -typedef struct ContourFitSplineReport_struct ContourFitSplineReport; -typedef struct LineFloat_struct LineFloat; -typedef struct LineEquation_struct LineEquation; -typedef struct ContourFitLineReport_struct ContourFitLineReport; -typedef struct ContourFitPolynomialReport_struct ContourFitPolynomialReport; -typedef struct PartialCircle_struct PartialCircle; -typedef struct PartialEllipse_struct PartialEllipse; -typedef struct SetupMatchPatternData_struct SetupMatchPatternData; -typedef struct RangeSettingDouble_struct RangeSettingDouble; -typedef struct GeometricAdvancedSetupDataOption_struct - GeometricAdvancedSetupDataOption; -typedef struct ContourInfoReport_struct ContourInfoReport; -typedef struct ROILabel_struct ROILabel; -typedef struct SupervisedColorSegmentationReport_struct - SupervisedColorSegmentationReport; -typedef struct LabelToROIReport_struct LabelToROIReport; -typedef struct ColorSegmenationOptions_struct ColorSegmenationOptions; -typedef struct ClassifiedCurve_struct ClassifiedCurve; -typedef struct RangeDouble_struct RangeDouble; -typedef struct RangeLabel_struct RangeLabel; -typedef struct CurvatureAnalysisReport_struct CurvatureAnalysisReport; -typedef struct Disparity_struct Disparity; -typedef struct ComputeDistancesReport_struct ComputeDistancesReport; -typedef struct MatchMode_struct MatchMode; -typedef struct ClassifiedDisparity_struct ClassifiedDisparity; -typedef struct ClassifyDistancesReport_struct ClassifyDistancesReport; -typedef struct ContourComputeCurvatureReport_struct - ContourComputeCurvatureReport; -typedef struct ContourOverlaySettings_struct ContourOverlaySettings; -typedef struct CurveParameters_struct CurveParameters; -typedef struct ExtractContourReport_struct ExtractContourReport; -typedef struct ConnectionConstraint_struct ConnectionConstraint; -typedef struct ExtractTextureFeaturesReport_struct ExtractTextureFeaturesReport; -typedef struct WaveletBandsReport_struct WaveletBandsReport; -typedef struct CircleFitOptions_struct CircleFitOptions; -typedef struct EdgeOptions2_struct EdgeOptions2; -typedef struct FindCircularEdgeOptions_struct FindCircularEdgeOptions; -typedef struct FindConcentricEdgeOptions_struct FindConcentricEdgeOptions; -typedef struct ConcentricEdgeFitOptions_struct ConcentricEdgeFitOptions; -typedef struct FindConcentricEdgeReport_struct FindConcentricEdgeReport; -typedef struct FindCircularEdgeReport_struct FindCircularEdgeReport; -typedef struct WindowSize_struct WindowSize; -typedef struct DisplacementVector_struct DisplacementVector; -typedef struct WaveletOptions_struct WaveletOptions; -typedef struct CooccurrenceOptions_struct CooccurrenceOptions; -typedef struct ParticleClassifierLocalThresholdOptions_struct - ParticleClassifierLocalThresholdOptions; -typedef struct RangeFloat_struct RangeFloat; -typedef struct ParticleClassifierAutoThresholdOptions_struct - ParticleClassifierAutoThresholdOptions; -typedef struct ParticleClassifierPreprocessingOptions2_struct - ParticleClassifierPreprocessingOptions2; -typedef struct MeasureParticlesReport_struct MeasureParticlesReport; -typedef struct GeometricPatternMatch3_struct GeometricPatternMatch3; -typedef struct MatchGeometricPatternAdvancedOptions3_struct - MatchGeometricPatternAdvancedOptions3; -typedef struct ColorOptions_struct ColorOptions; -typedef struct SampleScore_struct SampleScore; -typedef struct ClassifierReportAdvanced_struct ClassifierReportAdvanced; -typedef struct LearnGeometricPatternAdvancedOptions2_struct - LearnGeometricPatternAdvancedOptions2; -typedef struct ParticleFilterOptions2_struct ParticleFilterOptions2; -typedef struct FindEdgeOptions2_struct FindEdgeOptions2; -typedef struct FindEdgeReport_struct FindEdgeReport; -typedef struct FindTransformRectOptions2_struct FindTransformRectOptions2; -typedef struct FindTransformRectsOptions2_struct FindTransformRectsOptions2; -typedef struct ReadTextReport3_struct ReadTextReport3; -typedef struct CharacterStatistics_struct CharacterStatistics; -typedef struct CharReport3_struct CharReport3; -typedef struct ArcInfo2_struct ArcInfo2; -typedef struct EdgeReport2_struct EdgeReport2; -typedef struct SearchArcInfo_struct SearchArcInfo; -typedef struct ConcentricRakeReport2_struct ConcentricRakeReport2; -typedef struct SpokeReport2_struct SpokeReport2; -typedef struct EdgeInfo_struct EdgeInfo; -typedef struct SearchLineInfo_struct SearchLineInfo; -typedef struct RakeReport2_struct RakeReport2; -typedef struct TransformBehaviors_struct TransformBehaviors; -typedef struct QRCodeDataToken_struct QRCodeDataToken; -typedef struct ParticleFilterOptions_struct ParticleFilterOptions; -typedef struct StraightEdgeReport2_struct StraightEdgeReport2; -typedef struct StraightEdgeOptions_struct StraightEdgeOptions; -typedef struct StraightEdge_struct StraightEdge; -typedef struct QRCodeSearchOptions_struct QRCodeSearchOptions; -typedef struct QRCodeSizeOptions_struct QRCodeSizeOptions; -typedef struct QRCodeDescriptionOptions_struct QRCodeDescriptionOptions; -typedef struct QRCodeReport_struct QRCodeReport; -typedef struct AIMGradeReport_struct AIMGradeReport; -typedef struct DataMatrixSizeOptions_struct DataMatrixSizeOptions; -typedef struct DataMatrixDescriptionOptions_struct DataMatrixDescriptionOptions; -typedef struct DataMatrixSearchOptions_struct DataMatrixSearchOptions; -typedef struct DataMatrixReport_struct DataMatrixReport; -typedef struct JPEG2000FileAdvancedOptions_struct JPEG2000FileAdvancedOptions; -typedef struct MatchGeometricPatternAdvancedOptions2_struct - MatchGeometricPatternAdvancedOptions2; -typedef struct InspectionAlignment_struct InspectionAlignment; -typedef struct InspectionOptions_struct InspectionOptions; -typedef struct CharReport2_struct CharReport2; -typedef struct CharInfo2_struct CharInfo2; -typedef struct ReadTextReport2_struct ReadTextReport2; -typedef struct EllipseFeature_struct EllipseFeature; -typedef struct CircleFeature_struct CircleFeature; -typedef struct ConstCurveFeature_struct ConstCurveFeature; -typedef struct RectangleFeature_struct RectangleFeature; -typedef struct LegFeature_struct LegFeature; -typedef struct CornerFeature_struct CornerFeature; -typedef struct LineFeature_struct LineFeature; -typedef struct ParallelLinePairFeature_struct ParallelLinePairFeature; -typedef struct PairOfParallelLinePairsFeature_struct - PairOfParallelLinePairsFeature; -typedef union GeometricFeature_union GeometricFeature; -typedef struct FeatureData_struct FeatureData; -typedef struct GeometricPatternMatch2_struct GeometricPatternMatch2; -typedef struct ClosedCurveFeature_struct ClosedCurveFeature; -typedef struct LineMatch_struct LineMatch; -typedef struct LineDescriptor_struct LineDescriptor; -typedef struct RectangleDescriptor_struct RectangleDescriptor; -typedef struct RectangleMatch_struct RectangleMatch; -typedef struct EllipseDescriptor_struct EllipseDescriptor; -typedef struct EllipseMatch_struct EllipseMatch; -typedef struct CircleMatch_struct CircleMatch; -typedef struct CircleDescriptor_struct CircleDescriptor; -typedef struct ShapeDetectionOptions_struct ShapeDetectionOptions; -typedef struct Curve_struct Curve; -typedef struct CurveOptions_struct CurveOptions; -typedef struct Barcode2DInfo_struct Barcode2DInfo; -typedef struct DataMatrixOptions_struct DataMatrixOptions; -typedef struct ClassifierAccuracyReport_struct ClassifierAccuracyReport; -typedef struct NearestNeighborClassResult_struct NearestNeighborClassResult; -typedef struct NearestNeighborTrainingReport_struct - NearestNeighborTrainingReport; -typedef struct ParticleClassifierPreprocessingOptions_struct - ParticleClassifierPreprocessingOptions; -typedef struct ClassifierSampleInfo_struct ClassifierSampleInfo; -typedef struct ClassScore_struct ClassScore; -typedef struct ClassifierReport_struct ClassifierReport; -typedef struct NearestNeighborOptions_struct NearestNeighborOptions; -typedef struct ParticleClassifierOptions_struct ParticleClassifierOptions; -typedef struct RGBU64Value_struct RGBU64Value; -typedef struct GeometricPatternMatch_struct GeometricPatternMatch; -typedef struct MatchGeometricPatternAdvancedOptions_struct - MatchGeometricPatternAdvancedOptions; -typedef struct MatchGeometricPatternOptions_struct MatchGeometricPatternOptions; -typedef struct LearnGeometricPatternAdvancedOptions_struct - LearnGeometricPatternAdvancedOptions; -typedef struct FitEllipseOptions_struct FitEllipseOptions; -typedef struct FitCircleOptions_struct FitCircleOptions; -typedef struct ConstructROIOptions2_struct ConstructROIOptions2; -typedef struct HSLValue_struct HSLValue; -typedef struct HSVValue_struct HSVValue; -typedef struct HSIValue_struct HSIValue; -typedef struct CIELabValue_struct CIELabValue; -typedef struct CIEXYZValue_struct CIEXYZValue; -typedef union Color2_union Color2; -typedef struct BestEllipse2_struct BestEllipse2; -typedef struct LearnPatternAdvancedOptions_struct LearnPatternAdvancedOptions; -typedef struct AVIInfo_struct AVIInfo; -typedef struct LearnPatternAdvancedShiftOptions_struct - LearnPatternAdvancedShiftOptions; -typedef struct LearnPatternAdvancedRotationOptions_struct - LearnPatternAdvancedRotationOptions; -typedef struct MatchPatternAdvancedOptions_struct MatchPatternAdvancedOptions; -typedef struct ParticleFilterCriteria2_struct ParticleFilterCriteria2; -typedef struct BestCircle2_struct BestCircle2; -typedef struct OCRSpacingOptions_struct OCRSpacingOptions; -typedef struct OCRProcessingOptions_struct OCRProcessingOptions; -typedef struct ReadTextOptions_struct ReadTextOptions; -typedef struct CharInfo_struct CharInfo; -#if !defined(USERINT_HEADER) && !defined(_CVI_RECT_DEFINED) -typedef struct Rect_struct Rect; -#endif -typedef struct CharReport_struct CharReport; -typedef struct ReadTextReport_struct ReadTextReport; -#if !defined(USERINT_HEADER) && !defined(_CVI_POINT_DEFINED) -typedef struct Point_struct Point; -#endif -typedef struct Annulus_struct Annulus; -typedef struct EdgeLocationReport_struct EdgeLocationReport; -typedef struct EdgeOptions_struct EdgeOptions; -typedef struct EdgeReport_struct EdgeReport; -typedef struct ExtremeReport_struct ExtremeReport; -typedef struct FitLineOptions_struct FitLineOptions; -typedef struct DisplayMapping_struct DisplayMapping; -typedef struct DetectExtremesOptions_struct DetectExtremesOptions; -typedef struct ImageInfo_struct ImageInfo; -typedef struct LCDOptions_struct LCDOptions; -typedef struct LCDReport_struct LCDReport; -typedef struct LCDSegments_struct LCDSegments; -typedef struct LearnCalibrationOptions_struct LearnCalibrationOptions; -typedef struct LearnColorPatternOptions_struct LearnColorPatternOptions; -typedef struct Line_struct Line; -typedef struct LinearAverages_struct LinearAverages; -typedef struct LineProfile_struct LineProfile; -typedef struct MatchColorPatternOptions_struct MatchColorPatternOptions; -typedef struct HistogramReport_struct HistogramReport; -typedef struct ArcInfo_struct ArcInfo; -typedef struct AxisReport_struct AxisReport; -typedef struct BarcodeInfo_struct BarcodeInfo; -typedef struct BCGOptions_struct BCGOptions; -typedef struct BestCircle_struct BestCircle; -typedef struct BestEllipse_struct BestEllipse; -typedef struct BestLine_struct BestLine; -typedef struct BrowserOptions_struct BrowserOptions; -typedef struct CoordinateSystem_struct CoordinateSystem; -typedef struct CalibrationInfo_struct CalibrationInfo; -typedef struct CalibrationPoints_struct CalibrationPoints; -typedef struct CaliperOptions_struct CaliperOptions; -typedef struct CaliperReport_struct CaliperReport; -typedef struct DrawTextOptions_struct DrawTextOptions; -typedef struct CircleReport_struct CircleReport; -typedef struct ClosedContour_struct ClosedContour; -typedef struct ColorHistogramReport_struct ColorHistogramReport; -typedef struct ColorInformation_struct ColorInformation; -typedef struct Complex_struct Complex; -typedef struct ConcentricRakeReport_struct ConcentricRakeReport; -typedef struct ConstructROIOptions_struct ConstructROIOptions; -typedef struct ContourInfo_struct ContourInfo; -typedef union ContourUnion_union ContourUnion; -typedef struct ContourInfo2_struct ContourInfo2; -typedef struct ContourPoint_struct ContourPoint; -typedef struct CoordinateTransform_struct CoordinateTransform; -typedef struct CoordinateTransform2_struct CoordinateTransform2; -typedef struct CannyOptions_struct CannyOptions; -typedef struct Range_struct Range; -typedef struct UserPointSymbol_struct UserPointSymbol; -typedef struct View3DOptions_struct View3DOptions; -typedef struct MatchPatternOptions_struct MatchPatternOptions; -typedef struct TIFFFileOptions_struct TIFFFileOptions; -typedef union Color_union Color; -typedef union PixelValue_union PixelValue; -typedef struct OpenContour_struct OpenContour; -typedef struct OverlayTextOptions_struct OverlayTextOptions; -typedef struct ParticleFilterCriteria_struct ParticleFilterCriteria; -typedef struct ParticleReport_struct ParticleReport; -typedef struct PatternMatch_struct PatternMatch; -typedef struct QuantifyData_struct QuantifyData; -typedef struct QuantifyReport_struct QuantifyReport; -typedef struct RakeOptions_struct RakeOptions; -typedef struct RakeReport_struct RakeReport; -typedef struct TransformReport_struct TransformReport; -typedef struct ShapeReport_struct ShapeReport; -typedef struct MeterArc_struct MeterArc; -typedef struct ThresholdData_struct ThresholdData; -typedef struct StructuringElement_struct StructuringElement; -typedef struct SpokeReport_struct SpokeReport; -typedef struct SimpleEdgeOptions_struct SimpleEdgeOptions; -typedef struct SelectParticleCriteria_struct SelectParticleCriteria; -typedef struct SegmentInfo_struct SegmentInfo; -typedef struct RotationAngleRange_struct RotationAngleRange; -typedef struct RotatedRect_struct RotatedRect; -typedef struct ROIProfile_struct ROIProfile; -typedef struct ToolWindowOptions_struct ToolWindowOptions; -typedef struct SpokeOptions_struct SpokeOptions; - -//============================================================================ -// Data Structures -//============================================================================ -#if !defined __GNUC__ && !defined _M_X64 -#pragma pack(push, 1) -#endif -typedef struct DivisionModel_struct { - float kappa; // The learned kappa coefficient of division model. -} DivisionModel; - -typedef struct FocalLength_struct { - float fx; // Focal length in X direction. - float fy; // Focal length in Y direction. -} FocalLength; - -typedef struct PolyModel_struct { - float* kCoeffs; // The learned radial coefficients of polynomial model. - unsigned int numKCoeffs; // Number of K coefficients. - float p1; // The P1(learned tangential coefficients of polynomial model). - float p2; // The P2(learned tangential coefficients of polynomial model). -} PolyModel; - -typedef struct DistortionModelParams_struct { - DistortionModel distortionModel; // Type of learned distortion model. - PolyModel polyModel; // The learned coefficients of polynomial model. - DivisionModel divisionModel; // The learned coefficient of division model. -} DistortionModelParams; - -typedef struct PointFloat_struct { - float x; // The x-coordinate of the point. - float y; // The y-coordinate of the point. -} PointFloat; - -typedef struct InternalParameters_struct { - char isInsufficientData; - FocalLength focalLength; - PointFloat opticalCenter; -} InternalParameters; - -typedef struct MaxGridSize_struct { - unsigned int xMax; // Maximum x limit for the grid size. - unsigned int yMax; // Maximum y limit for the grid size. -} MaxGridSize; - -typedef struct ImageSize_struct { - unsigned int xRes; // X resolution of the image. - unsigned int yRes; // Y resolution of the image. -} ImageSize; - -typedef struct CalibrationReferencePoints_struct { - PointDouble* - pixelCoords; // Specifies the coordinates of the pixel reference points. - unsigned int numPixelCoords; // Number of pixel coordinates. - PointDouble* - realCoords; // Specifies the measuring unit associated with the image. - unsigned int numRealCoords; // Number of real coordinates. - CalibrationUnit units; // Specifies the units of X Step and Y Step. - ImageSize imageSize; // Specifies the size of calibration template image. -} CalibrationReferencePoints; - -typedef struct GetCameraParametersReport_struct { - double* - projectionMatrix; // The projection(homography) matrix of working plane. - unsigned int projectionMatrixRows; // Number of rows in projection matrix. - unsigned int projectionMatrixCols; // Number of columns in projection matrix. - DistortionModelParams distortion; // Distortion model Coefficients. - InternalParameters internalParams; // The learned internal paramters of - // camera model such as focal length and - // optical center. -} GetCameraParametersReport; - -typedef struct CalibrationAxisInfo_struct { - PointFloat center; // The origin of the reference coordinate system, - // expressed in pixel units. - float rotationAngle; // The angle of the x-axis of the real-world coordinate - // system, in relation to the horizontal. - AxisOrientation axisDirection; // Specifies the direction of the calibraiton - // axis which is either Direct or Indirect. -} CalibrationAxisInfo; - -typedef struct CalibrationLearnSetupInfo_struct { - CalibrationMode2 calibrationMethod; // Type of calibration method used. - DistortionModel distortionModel; // Type of learned distortion model. - ScalingMethod - scaleMode; // The aspect scaling to use when correcting an image. - CalibrationROI roiMode; // The ROI to use when correcting an image. - char learnCorrectionTable; // Set this input to true value if you want the - // correction table to be determined and stored. -} CalibrationLearnSetupInfo; - -typedef struct GridDescriptor_struct { - float xStep; // The distance in the x direction between two adjacent pixels - // in units specified by unit. - float yStep; // The distance in the y direction between two adjacent pixels - // in units specified by unit. - CalibrationUnit unit; // The unit of measure for the image. -} GridDescriptor; - -typedef struct ErrorStatistics_struct { - double mean; // Mean error statistics value. - double maximum; // Maximum value of error. - double standardDeviation; // The standard deviation error statistiscs value. - double distortion; // The distortion error statistics value. -} ErrorStatistics; - -typedef struct GetCalibrationInfoReport_struct { - ROI* userRoi; // Specifies the ROI the user provided when learning the - // calibration. - ROI* calibrationRoi; // Specifies the ROI that corresponds to the region of - // the image where the calibration information is - // accurate. - CalibrationAxisInfo - axisInfo; // Reference Coordinate System for the real-world coordinates. - CalibrationLearnSetupInfo - learnSetupInfo; // Calibration learn setup information. - GridDescriptor gridDescriptor; // Specifies scaling constants used to - // calibrate the image. - float* errorMap; // The the error map of calibration template image. - unsigned int errorMapRows; // Number of rows in error map. - unsigned int errorMapCols; // Number of Columns in error map. - ErrorStatistics errorStatistics; // Error statistics of the calibration. -} GetCalibrationInfoReport; - -typedef struct EdgePolarity_struct { - EdgePolaritySearchMode start; - EdgePolaritySearchMode end; -} EdgePolarity; - -typedef struct ClampSettings_struct { - double angleRange; // Specifies the angle range. - EdgePolarity edgePolarity; // Specifies the edge polarity. -} ClampSettings; - -typedef struct PointDouble_struct { - double x; // The x-coordinate of the point. - double y; // The y-coordinate of the point. -} PointDouble; - -typedef struct PointDoublePair_struct { - PointDouble start; // The Start co-ordinate of the pair. - PointDouble end; // The End co-ordinate of the pair. -} PointDoublePair; - -typedef struct ClampResults_struct { - double distancePix; // Defines the Pixel world distance. - double distanceRealWorld; // Defines the real world distance. - double angleAbs; // Defines the absolute angle. - double angleRelative; // Defines the relative angle. -} ClampResults; - -typedef struct ClampPoints_struct { - PointDoublePair pixel; // Specifies the pixel world point pair for clamp. - PointDoublePair realWorld; // Specifies the real world point pair for clamp. -} ClampPoints; - -typedef struct RGBValue_struct { - unsigned char B; // The blue value of the color. - unsigned char G; // The green value of the color. - unsigned char R; // The red value of the color. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} RGBValue; - -typedef struct ClampOverlaySettings_struct { - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showCurves; // If TRUE, the function overlays the curves on the image. - int showClampLocation; // If TRUE, the function overlays the clamp location - // on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue curvesColor; // Specifies the RGB color value to use to overlay the - // curves. - RGBValue clampLocationsColor; // Specifies the RGB color value to use to - // overlay the clamp locations. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the group overlay name for the step - // overlays. -} ClampOverlaySettings; - -typedef struct ClampMax2Report_struct { - ClampResults clampResults; // Specifies the Clamp results information - // returned by the function. - ClampPoints clampPoints; // Specifies the clamp points information returned - // by the function. - unsigned int calibrationValid; // Specifies if the calibration information is - // valid or not. -} ClampMax2Report; - -typedef struct ContourFitSplineReport_struct { - PointDouble* points; // It returns the points of the best-fit B-spline curve. - int numberOfPoints; // Number of Best fit points returned. -} ContourFitSplineReport; - -typedef struct LineFloat_struct { - PointFloat start; // The coordinate location of the start of the line. - PointFloat end; // The coordinate location of the end of the line. -} LineFloat; - -typedef struct LineEquation_struct { - double a; // The a coefficient of the line equation. - double b; // The b coefficient of the line equation. - double c; // The c coefficient of the line equation. -} LineEquation; - -typedef struct ContourFitLineReport_struct { - LineFloat lineSegment; // Line Segment represents the intersection of the - // line equation and the contour. - LineEquation lineEquation; // Line Equation is a structure of three - // coefficients A, B, and C of the equation in the - // normal form (Ax + By + C=0) of the best fit - // line. -} ContourFitLineReport; - -typedef struct ContourFitPolynomialReport_struct { - PointDouble* bestFit; // It returns the points of the best-fit polynomial. - int numberOfPoints; // Number of Best fit points returned. - double* polynomialCoefficients; // Polynomial Coefficients returns the - // coefficients of the polynomial equation. - int numberOfCoefficients; // Number of Coefficients returned in the - // polynomial coefficients array. -} ContourFitPolynomialReport; - -typedef struct PartialCircle_struct { - PointFloat center; // Center of the circle. - double radius; // Radius of the circle. - double startAngle; // Start angle of the fitted structure. - double endAngle; // End angle of the fitted structure. -} PartialCircle; - -typedef struct PartialEllipse_struct { - PointFloat center; // Center of the Ellipse. - double angle; // Angle of the ellipse. - double majorRadius; // The length of the semi-major axis of the ellipse. - double minorRadius; // The length of the semi-minor axis of the ellipse. - double startAngle; // Start angle of the fitted structure. - double endAngle; // End angle of the fitted structure. -} PartialEllipse; - -typedef struct SetupMatchPatternData_struct { - unsigned char* matchSetupData; // String containing the match setup data. - int numMatchSetupData; // Number of match setup data. -} SetupMatchPatternData; - -typedef struct RangeSettingDouble_struct { - SettingType settingType; // Match Constraints specifies the match option - // whose values you want to constrain by the given - // range. - double min; // Min is the minimum value of the range for a given Match - // Constraint. - double max; // Max is the maximum value of the range for a given Match - // Constraint. -} RangeSettingDouble; - -typedef struct GeometricAdvancedSetupDataOption_struct { - GeometricSetupDataItem type; // It determines the option you want to use - // during the matching phase. - double value; // Value is the value for the option you want to use during the - // matching phase. -} GeometricAdvancedSetupDataOption; - -typedef struct ContourInfoReport_struct { - PointDouble* pointsPixel; // Points (pixel) specifies the location of every - // point detected on the curve, in pixels. - unsigned int numPointsPixel; // Number of points pixel elements. - PointDouble* pointsReal; // Points (real) specifies the location of every - // point detected on the curve, in calibrated units. - unsigned int numPointsReal; // Number of points real elements. - double* curvaturePixel; // Curvature Pixel displays the curvature profile for - // the selected contour, in pixels. - unsigned int numCurvaturePixel; // Number of curvature pixels. - double* curvatureReal; // Curvature Real displays the curvature profile for - // the selected contour, in calibrated units. - unsigned int numCurvatureReal; // Number of curvature Real elements. - double length; // Length (pixel) specifies the length, in pixels, of the - // curves in the image. - double lengthReal; // Length (real) specifies the length, in calibrated - // units, of the curves within the curvature range. - unsigned int hasEquation; // Has Equation specifies whether the contour has a - // fitted equation. -} ContourInfoReport; - -typedef struct ROILabel_struct { - char* className; // Specifies the classname you want to segment. - unsigned int - label; // Label is the label number associated with the Class Name. -} ROILabel; - -typedef struct SupervisedColorSegmentationReport_struct { - ROILabel* labelOut; // The Roi labels array. - unsigned int numLabelOut; // The number of elements in labelOut array. -} SupervisedColorSegmentationReport; - -typedef struct LabelToROIReport_struct { - ROI** roiArray; // Array of ROIs. - unsigned int numOfROIs; // Number of ROIs in the roiArray. - unsigned int* labelsOutArray; // Array of labels. - unsigned int numOfLabels; // Number of labels. - int* isTooManyVectorsArray; // isTooManyVectorsArray array. - unsigned int isTooManyVectorsArraySize; // Number of elements in - // isTooManyVectorsArray. -} LabelToROIReport; - -typedef struct ColorSegmenationOptions_struct { - unsigned int windowX; // X is the window size in x direction. - unsigned int windowY; // Y is the window size in y direction. - unsigned int stepSize; // Step Size is the distance between two windows. - unsigned int minParticleArea; // Min Particle Area is the minimum number of - // allowed pixels. - unsigned int maxParticleArea; // Max Particle Area is the maximum number of - // allowed pixels. - short isFineSegment; // When enabled, the step processes the boundary pixels - // of each segmentation cluster using a step size of 1. -} ColorSegmenationOptions; - -typedef struct ClassifiedCurve_struct { - double length; // Specifies the length, in pixels, of the curves within the - // curvature range. - double lengthReal; // specifies the length, in calibrated units, of the - // curves within the curvature range. - double maxCurvature; // specifies the maximum curvature, in pixels, for the - // selected curvature range. - double maxCurvatureReal; // specifies the maximum curvature, in calibrated - // units, for the selected curvature range. - unsigned int label; // specifies the class to which the the sample belongs. - PointDouble* curvePoints; // Curve Points is a point-coordinate cluster that - // defines the points of the curve. - unsigned int numCurvePoints; // Number of curve points. -} ClassifiedCurve; - -typedef struct RangeDouble_struct { - double minValue; // The minimum value of the range. - double maxValue; // The maximum value of the range. -} RangeDouble; - -typedef struct RangeLabel_struct { - RangeDouble range; // Specifies the range of curvature values. - unsigned int label; // Class Label specifies the class to which the the - // sample belongs. -} RangeLabel; - -typedef struct CurvatureAnalysisReport_struct { - ClassifiedCurve* curves; - unsigned int numCurves; -} CurvatureAnalysisReport; - -typedef struct Disparity_struct { - PointDouble - current; // Current is a array of points that defines the target contour. - PointDouble reference; // reference is a array of points that defines the - // template contour. - double distance; // Specifies the distance, in pixels, between the template - // contour point and the target contour point. -} Disparity; - -typedef struct ComputeDistancesReport_struct { - Disparity* - distances; // Distances is an array containing the computed distances. - unsigned int numDistances; // Number elements in the distances array. - Disparity* distancesReal; // Distances Real is an array containing the - // computed distances in calibrated units. - unsigned int numDistancesReal; // Number of elements in real distances array. -} ComputeDistancesReport; - -typedef struct MatchMode_struct { - unsigned int rotation; // Rotation When enabled, the Function searches for - // occurrences of the template in the inspection - // image, allowing for template matches to be rotated. - unsigned int scale; // Rotation When enabled, the Function searches for - // occurrences of the template in the inspection image, - // allowing for template matches to be rotated. - unsigned int occlusion; // Occlusion specifies whether or not to search for - // occluded versions of the shape. -} MatchMode; - -typedef struct ClassifiedDisparity_struct { - double length; // Length (pixel) specifies the length, in pixels, of the - // curves within the curvature range. - double lengthReal; // Length (real) specifies the length, in calibrated - // units, of the curves within the curvature range. - double maxDistance; // Maximum Distance (pixel) specifies the maximum - // distance, in pixels, between points along the selected - // contour and the template contour. - double maxDistanceReal; // Maximum Distance (real) specifies the maximum - // distance, in calibrated units, between points - // along the selected contour and the template - // contour. - unsigned int label; // Class Label specifies the class to which the the - // sample belongs. - PointDouble* templateSubsection; // Template subsection points is an array of - // points that defines the boundary of the - // template. - unsigned int numTemplateSubsection; // Number of reference points. - PointDouble* targetSubsection; // Current Points(Target subsection points) is - // an array of points that defines the - // boundary of the target. - unsigned int numTargetSubsection; // Number of current points. -} ClassifiedDisparity; - -typedef struct ClassifyDistancesReport_struct { - ClassifiedDisparity* classifiedDistances; // Disparity array containing the - // classified distances. - unsigned int - numClassifiedDistances; // Number of elements in the disparity array. -} ClassifyDistancesReport; - -typedef struct ContourComputeCurvatureReport_struct { - double* curvaturePixel; // Curvature Pixel displays the curvature profile for - // the selected contour, in pixels. - unsigned int numCurvaturePixel; // Number of curvature pixels. - double* curvatureReal; // Curvature Real displays the curvature profile for - // the selected contour, in calibrated units. - unsigned int numCurvatureReal; // Number of curvature Real elements. -} ContourComputeCurvatureReport; - -typedef struct ContourOverlaySettings_struct { - unsigned int overlay; // Overlay specifies whether to display the overlay on - // the image. - RGBValue color; // Color is the color of the overlay. - unsigned int width; // Width specifies the width of the overlay in pixels. - unsigned int maintainWidth; // Maintain Width? specifies whether you want the - // overlay measured in screen pixels or image - // pixels. -} ContourOverlaySettings; - -typedef struct CurveParameters_struct { - ExtractionMode extractionMode; // Specifies the method the function uses to - // identify curves in the image. - int threshold; // Specifies the minimum contrast a seed point must have in - // order to begin a curve. - EdgeFilterSize filterSize; // Specifies the width of the edge filter the - // function uses to identify curves in the image. - int minLength; // Specifies the length, in pixels, of the smallest curve the - // function will extract. - int searchStep; // Search Step Size specifies the distance, in the y - // direction, between the image rows that the algorithm - // inspects for curve seed points. - int maxEndPointGap; // Specifies the maximum gap, in pixels, between the - // endpoints of a curve that the function identifies as a - // closed curve. - int subpixel; // Subpixel specifies whether to detect curve points with - // subpixel accuracy. -} CurveParameters; - -typedef struct ExtractContourReport_struct { - PointDouble* contourPoints; // Contour Points specifies every point found on - // the contour. - int numContourPoints; // Number of contour points. - PointDouble* sourcePoints; // Source Image Points specifies every point found - // on the contour in the source image. - int numSourcePoints; // Number of source points. -} ExtractContourReport; - -typedef struct ConnectionConstraint_struct { - ConnectionConstraintType constraintType; // Constraint Type specifies what - // criteria to use to consider two - // curves part of a contour. - RangeDouble range; // Specifies range for a given Match Constraint. -} ConnectionConstraint; - -typedef struct ExtractTextureFeaturesReport_struct { - int* waveletBands; // The array having all the Wavelet Banks used for - // extraction. - int numWaveletBands; // Number of wavelet banks in the Array. - double** textureFeatures; // 2-D array to store all the Texture features - // extracted. - int textureFeaturesRows; // Number of Rows in the Texture Features array. - int textureFeaturesCols; // Number of Cols in Texture Features array. -} ExtractTextureFeaturesReport; - -typedef struct WaveletBandsReport_struct { - float** LLBand; // 2-D array for LL Band. - float** LHBand; // 2-D array for LH Band. - float** HLBand; // 2-D array for HL Band. - float** HHBand; // 2-D array for HH Band. - float** LLLBand; // 2-D array for LLL Band. - float** LLHBand; // 2-D array for LLH Band. - float LHLBand; // 2-D array for LHL Band. - float** LHHBand; // 2-D array for LHH Band. - int rows; // Number of Rows for each of the 2-D arrays. - int cols; // Number of Columns for each of the 2-D arrays. -} WaveletBandsReport; - -typedef struct CircleFitOptions_struct { - int maxRadius; // Specifies the acceptable distance, in pixels, that a point - // determined to belong to the circle can be from the - // perimeter of the circle. - double stepSize; // Step Size is the angle, in degrees, between each radial - // line in the annular region. - RakeProcessType processType; // Method used to process the data extracted for - // edge detection. -} CircleFitOptions; - -typedef struct EdgeOptions2_struct { - EdgePolaritySearchMode - polarity; // Specifies the polarity of the edges to be found. - unsigned int kernelSize; // Specifies the size of the edge detection kernel. - unsigned int width; // Specifies the number of pixels averaged perpendicular - // to the search direction to compute the edge profile - // strength at each point along the search ROI. - float minThreshold; // Specifies the minimum edge strength (gradient - // magnitude) required for a detected edge. - InterpolationMethod interpolationType; // Specifies the interpolation method - // used to locate the edge position. - ColumnProcessingMode columnProcessingMode; // Specifies the method used to - // find the straight edge. -} EdgeOptions2; - -typedef struct FindCircularEdgeOptions_struct { - SpokeDirection - direction; // Specifies the Spoke direction to search in the ROI. - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showSearchLines; // If TRUE, the function overlays the search lines used - // to locate the edges on the image. - int showEdgesFound; // If TRUE, the function overlays the locations of the - // edges found on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue searchLinesColor; // Specifies the RGB color value to use to overlay - // the search lines. - RGBValue searchEdgesColor; // Specifies the RGB color value to use to overlay - // the search edges. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the overlay group name to assign to the - // overlays. - EdgeOptions2 edgeOptions; // Specifies the edge detection options along a - // single search line. -} FindCircularEdgeOptions; - -typedef struct FindConcentricEdgeOptions_struct { - ConcentricRakeDirection direction; // Specifies the Concentric Rake - // direction. - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showSearchLines; // If TRUE, the function overlays the search lines used - // to locate the edges on the image. - int showEdgesFound; // If TRUE, the function overlays the locations of the - // edges found on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue searchLinesColor; // Specifies the RGB color value to use to overlay - // the search lines. - RGBValue searchEdgesColor; // Specifies the RGB color value to use to overlay - // the search edges. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the overlay group name to assign to the - // overlays. - EdgeOptions2 edgeOptions; // Specifies the edge detection options along a - // single search line. -} FindConcentricEdgeOptions; - -typedef struct ConcentricEdgeFitOptions_struct { - int maxRadius; // Specifies the acceptable distance, in pixels, that a point - // determined to belong to the circle can be from the - // perimeter of the circle. - double stepSize; // The sampling factor that determines the gap between the - // rake lines. - RakeProcessType processType; // Method used to process the data extracted for - // edge detection. -} ConcentricEdgeFitOptions; - -typedef struct FindConcentricEdgeReport_struct { - PointFloat startPt; // Pixel Coordinates for starting point of the edge. - PointFloat endPt; // Pixel Coordinates for end point of the edge. - PointFloat startPtCalibrated; // Real world Coordinates for starting point of - // the edge. - PointFloat - endPtCalibrated; // Real world Coordinates for end point of the edge. - double angle; // Angle of the edge found. - double angleCalibrated; // Calibrated angle of the edge found. - double straightness; // The straightness value of the detected straight edge. - double avgStrength; // Average strength of the egde found. - double avgSNR; // Average SNR(Signal to Noise Ratio) for the edge found. - int lineFound; // If the edge is found or not. -} FindConcentricEdgeReport; - -typedef struct FindCircularEdgeReport_struct { - PointFloat centerCalibrated; // Real world Coordinates of the Center. - double radiusCalibrated; // Real world radius of the Circular Edge found. - PointFloat center; // Pixel Coordinates of the Center. - double radius; // Radius in pixels of the Circular Edge found. - double roundness; // The roundness of the calculated circular edge. - double avgStrength; // Average strength of the egde found. - double avgSNR; // Average SNR(Signal to Noise Ratio) for the edge found. - int circleFound; // If the circlular edge is found or not. -} FindCircularEdgeReport; - -typedef struct WindowSize_struct { - int x; // Window lenght on X direction. - int y; // Window lenght on Y direction. - int stepSize; // Distance between windows. -} WindowSize; - -typedef struct DisplacementVector_struct { - int x; // length on X direction. - int y; // length on Y direction. -} DisplacementVector; - -typedef struct WaveletOptions_struct { - WaveletType typeOfWavelet; // Type of wavelet(db, bior. - float minEnergy; // Minimum Energy in the bands to consider for texture - // defect detection. -} WaveletOptions; - -typedef struct CooccurrenceOptions_struct { - int level; // Level/size of matrix. - DisplacementVector - displacement; // Displacemnet between pixels to accumulate the matrix. -} CooccurrenceOptions; - -typedef struct ParticleClassifierLocalThresholdOptions_struct { - LocalThresholdMethod - method; // Specifies the local thresholding method the function uses. - ParticleType particleType; // Specifies what kind of particles to look for. - unsigned int windowWidth; // The width of the rectangular window around the - // pixel on which the function performs the local - // threshold. - unsigned int windowHeight; // The height of the rectangular window around the - // pixel on which the function performs the local - // threshold. - double deviationWeight; // Specifies the k constant used in the Niblack local - // thresholding algorithm, which determines the - // weight applied to the variance calculation. -} ParticleClassifierLocalThresholdOptions; - -typedef struct RangeFloat_struct { - float minValue; // The minimum value of the range. - float maxValue; // The maximum value of the range. -} RangeFloat; - -typedef struct ParticleClassifierAutoThresholdOptions_struct { - ThresholdMethod method; // The method for binary thresholding, which - // specifies how to calculate the classes. - ParticleType particleType; // Specifies what kind of particles to look for. - RangeFloat limits; // The limits on the automatic threshold range. -} ParticleClassifierAutoThresholdOptions; - -typedef struct ParticleClassifierPreprocessingOptions2_struct { - ParticleClassifierThresholdType - thresholdType; // The type of threshold to perform on the image. - RangeFloat manualThresholdRange; // The range of pixels to keep if manually - // thresholding the image. - ParticleClassifierAutoThresholdOptions - autoThresholdOptions; // The options used to auto threshold the image. - ParticleClassifierLocalThresholdOptions - localThresholdOptions; // The options used to local threshold the image. - int rejectBorder; // Set this element to TRUE to reject border particles. - int numErosions; // The number of erosions to perform. -} ParticleClassifierPreprocessingOptions2; - -typedef struct MeasureParticlesReport_struct { - double** pixelMeasurements; // The measurements on the particles in the - // image, in pixel coordinates. - double** calibratedMeasurements; // The measurements on the particles in the - // image, in real-world coordinates. - size_t numParticles; // The number of particles on which measurements were - // taken. - size_t numMeasurements; // The number of measurements taken. -} MeasureParticlesReport; - -typedef struct GeometricPatternMatch3_struct { - PointFloat - position; // The location of the origin of the template in the match. - float rotation; // The rotation of the match relative to the template image, - // in degrees. - float scale; // The size of the match relative to the size of the template - // image, expressed as a percentage. - float score; // The accuracy of the match. - PointFloat corner[4]; // An array of four points describing the rectangle - // surrounding the template image. - int inverse; // This element is TRUE if the match is an inverse of the - // template image. - float occlusion; // The percentage of the match that is occluded. - float templateMatchCurveScore; // The accuracy of the match obtained by - // comparing the template curves to the curves - // in the match region. - float matchTemplateCurveScore; // The accuracy of the match obtained by - // comparing the curves in the match region to - // the template curves. - float correlationScore; // The accuracy of the match obtained by comparing - // the template image to the match region using a - // correlation metric that compares the two regions - // as a function of their pixel values. - PointFloat calibratedPosition; // The location of the origin of the template - // in the match. - float calibratedRotation; // The rotation of the match relative to the - // template image, in degrees. - PointFloat calibratedCorner[4]; // An array of four points describing the - // rectangle surrounding the template image. -} GeometricPatternMatch3; - -typedef struct MatchGeometricPatternAdvancedOptions3_struct { - unsigned int subpixelIterations; // Specifies the maximum number of - // incremental improvements used to refine - // matches with subpixel information. - double subpixelTolerance; // Specifies the maximum amount of change, in - // pixels, between consecutive incremental - // improvements in the match position before the - // function stops refining the match position. - unsigned int - initialMatchListLength; // Specifies the maximum size of the match list. - int targetTemplateCurveScore; // Set this element to TRUE to specify that the - // function should calculate the match curve to - // template curve score and return it for each - // match result. - int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation score and - // return it for each match result. - double minMatchSeparationDistance; // Specifies the minimum separation - // distance, in pixels, between the - // origins of two matches that have unique - // positions. - double minMatchSeparationAngle; // Specifies the minimum angular difference, - // in degrees, between two matches that have - // unique angles. - double minMatchSeparationScale; // Specifies the minimum difference in scale, - // expressed as a percentage, between two - // matches that have unique scales. - double maxMatchOverlap; // Specifies the maximum amount of overlap, expressed - // as a percentage, allowed between the bounding - // rectangles of two unique matches. - int coarseResult; // Specifies whether you want the function to spend less - // time accurately estimating the location of a match. - int enableCalibrationSupport; // Set this element to TRUE to specify the - // algorithm treat the inspection image as a - // calibrated image. - ContrastMode enableContrastReversal; // Use this element to specify the - // contrast of the matches to search for - // in the image. - GeometricMatchingSearchStrategy - matchStrategy; // Specifies the aggressiveness of the search strategy. - unsigned int refineMatchFactor; // Specifies the factor that is applied to - // the number of matches requested by the - // user to determine the number of matches - // that are refined at the initial matching - // stage. - unsigned int subpixelMatchFactor; // Specifies the factor that is applied to - // the number of matches requested by the - // user to determine the number of matches - // that are evaluated at the final subpixel - // matching stage. -} MatchGeometricPatternAdvancedOptions3; - -typedef struct ColorOptions_struct { - ColorClassificationResolution colorClassificationResolution; // Specifies the - // color - // resolution of - // the - // classifier. - unsigned int useLuminance; // Specifies if the luminance band is going to be - // used in the feature vector. - ColorMode colorMode; // Specifies the color mode of the classifier. -} ColorOptions; - -typedef struct SampleScore_struct { - char* className; // The name of the class. - float distance; // The distance from the item to this class. - unsigned int index; // index of this sample. -} SampleScore; - -typedef struct ClassifierReportAdvanced_struct { - char* bestClassName; // The name of the best class for the sample. - float classificationScore; // The similarity of the sample and the two - // closest classes in the classifier. - float identificationScore; // The similarity of the sample and the assigned - // class. - ClassScore* allScores; // All classes and their scores. - int allScoresSize; // The number of entries in allScores. - SampleScore* sampleScores; // All samples and their scores. - int sampleScoresSize; // The number of entries in sampleScores. -} ClassifierReportAdvanced; - -typedef struct LearnGeometricPatternAdvancedOptions2_struct { - double minScaleFactor; // Specifies the minimum scale factor that the - // template is learned for. - double maxScaleFactor; // Specifies the maximum scale factor the template is - // learned for. - double minRotationAngleValue; // Specifies the minimum rotation angle the - // template is learned for. - double maxRotationAngleValue; // Specifies the maximum rotation angle the - // template is learned for. - unsigned int imageSamplingFactor; // Specifies the factor that is used to - // subsample the template and the image for - // the initial matching phase. -} LearnGeometricPatternAdvancedOptions2; - -typedef struct ParticleFilterOptions2_struct { - int rejectMatches; // Set this parameter to TRUE to transfer only those - // particles that do not meet all the criteria. - int rejectBorder; // Set this element to TRUE to reject border particles. - int fillHoles; // Set this element to TRUE to fill holes in particles. - int connectivity8; // Set this parameter to TRUE to use connectivity-8 to - // determine whether particles are touching. -} ParticleFilterOptions2; - -typedef struct FindEdgeOptions2_struct { - RakeDirection direction; // The direction to search in the ROI. - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showSearchLines; // If TRUE, the function overlays the search lines used - // to locate the edges on the image. - int showEdgesFound; // If TRUE, the function overlays the locations of the - // edges found on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue searchLinesColor; // Specifies the RGB color value to use to overlay - // the search lines. - RGBValue searchEdgesColor; // Specifies the RGB color value to use to overlay - // the search edges. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the overlay group name to assign to the - // overlays. - EdgeOptions2 edgeOptions; // Specifies the edge detection options along a - // single search line. -} FindEdgeOptions2; - -typedef struct FindEdgeReport_struct { - StraightEdge* straightEdges; // An array of straight edges detected. - unsigned int - numStraightEdges; // Indicates the number of straight edges found. -} FindEdgeReport; - -typedef struct FindTransformRectOptions2_struct { - FindReferenceDirection direction; // Specifies the direction and orientation - // in which the function searches for the - // primary axis. - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showSearchLines; // If TRUE, the function overlays the search lines used - // to locate the edges on the image. - int showEdgesFound; // If TRUE, the function overlays the locations of the - // edges found on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue searchLinesColor; // Specifies the RGB color value to use to overlay - // the search lines. - RGBValue searchEdgesColor; // Specifies the RGB color value to use to overlay - // the search edges. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the overlay group name to assign to the - // overlays. - EdgeOptions2 edgeOptions; // Specifies the edge detection options along a - // single search line. -} FindTransformRectOptions2; - -typedef struct FindTransformRectsOptions2_struct { - FindReferenceDirection direction; // Specifies the direction and orientation - // in which the function searches for the - // primary axis. - int showSearchArea; // If TRUE, the function overlays the search area on the - // image. - int showSearchLines; // If TRUE, the function overlays the search lines used - // to locate the edges on the image. - int showEdgesFound; // If TRUE, the function overlays the locations of the - // edges found on the image. - int showResult; // If TRUE, the function overlays the hit lines to the object - // and the edge used to generate the hit line on the result - // image. - RGBValue searchAreaColor; // Specifies the RGB color value to use to overlay - // the search area. - RGBValue searchLinesColor; // Specifies the RGB color value to use to overlay - // the search lines. - RGBValue searchEdgesColor; // Specifies the RGB color value to use to overlay - // the search edges. - RGBValue resultColor; // Specifies the RGB color value to use to overlay the - // results. - char* overlayGroupName; // Specifies the overlay group name to assign to the - // overlays. - EdgeOptions2 primaryEdgeOptions; // Specifies the parameters used to compute - // the edge gradient information and detect - // the edges for the primary ROI. - EdgeOptions2 secondaryEdgeOptions; // Specifies the parameters used to - // compute the edge gradient information - // and detect the edges for the secondary - // ROI. -} FindTransformRectsOptions2; - -typedef struct ReadTextReport3_struct { - const char* readString; // The read string. - CharReport3* characterReport; // An array of reports describing the - // properties of each identified character. - int numCharacterReports; // The number of identified characters. - ROI* roiBoundingCharacters; // An array specifying the coordinates of the - // character bounding ROI. -} ReadTextReport3; - -typedef struct CharacterStatistics_struct { - int left; // The left offset of the character bounding rectangles in the - // current ROI. - int top; // The top offset of the character bounding rectangles in the - // current ROI. - int width; // The width of each of the characters you trained in the current - // ROI. - int height; // The height of each trained character in the current ROI. - int characterSize; // The size of the character in pixels. -} CharacterStatistics; - -typedef struct CharReport3_struct { - const char* character; // The character value. - int classificationScore; // The degree to which the assigned character class - // represents the object better than the other - // character classes in the character set. - int verificationScore; // The similarity of the character and the reference - // character for the character class. - int verified; // This element is TRUE if a reference character was found for - // the character class and FALSE if a reference character was - // not found. - int lowThreshold; // The minimum value of the threshold range used for this - // character. - int highThreshold; // The maximum value of the threshold range used for this - // character. - CharacterStatistics - characterStats; // Describes the characters segmented in the ROI. -} CharReport3; - -typedef struct ArcInfo2_struct { - PointFloat center; // The center point of the arc. - double radius; // The radius of the arc. - double startAngle; // The starting angle of the arc, specified - // counter-clockwise from the x-axis. - double endAngle; // The ending angle of the arc, specified counter-clockwise - // from the x-axis. -} ArcInfo2; - -typedef struct EdgeReport2_struct { - EdgeInfo* edges; // An array of edges detected. - unsigned int numEdges; // Indicates the number of edges detected. - double* gradientInfo; // An array that contains the calculated edge strengths - // along the user-defined search area. - unsigned int numGradientInfo; // Indicates the number of elements contained - // in gradientInfo. - int calibrationValid; // Indicates if the calibration data corresponding to - // the location of the edges is correct. -} EdgeReport2; - -typedef struct SearchArcInfo_struct { - ArcInfo2 arcCoordinates; // Describes the arc used for edge detection. - EdgeReport2 edgeReport; // Describes the edges found in this search line. -} SearchArcInfo; - -typedef struct ConcentricRakeReport2_struct { - EdgeInfo* firstEdges; // The first edge point detected along each search line - // in the ROI. - unsigned int numFirstEdges; // The number of points in the firstEdges array. - EdgeInfo* lastEdges; // The last edge point detected along each search line - // in the ROI. - unsigned int numLastEdges; // The number of points in the lastEdges array. - SearchArcInfo* searchArcs; // Contains the arcs used for edge detection and - // the edge information for each arc. - unsigned int numSearchArcs; // The number of arcs in the searchArcs array. -} ConcentricRakeReport2; - -typedef struct SpokeReport2_struct { - EdgeInfo* firstEdges; // The first edge point detected along each search line - // in the ROI. - unsigned int numFirstEdges; // The number of points in the firstEdges array. - EdgeInfo* lastEdges; // The last edge point detected along each search line - // in the ROI. - unsigned int numLastEdges; // The number of points in the lastEdges array. - SearchLineInfo* searchLines; // The search lines used for edge detection. - unsigned int - numSearchLines; // The number of search lines used in the edge detection. -} SpokeReport2; - -typedef struct EdgeInfo_struct { - PointFloat position; // The location of the edge in the image. - PointFloat calibratedPosition; // The position of the edge in the image in - // real-world coordinates. - double distance; // The location of the edge from the first point along the - // boundary of the input ROI. - double calibratedDistance; // The location of the edge from the first point - // along the boundary of the input ROI in - // real-world coordinates. - double magnitude; // The intensity contrast at the edge. - double - noisePeak; // The strength of the noise associated with the current edge. - int rising; // Indicates the polarity of the edge. -} EdgeInfo; - -typedef struct SearchLineInfo_struct { - LineFloat lineCoordinates; // The endpoints of the search line. - EdgeReport2 edgeReport; // Describes the edges found in this search line. -} SearchLineInfo; - -typedef struct RakeReport2_struct { - EdgeInfo* firstEdges; // The first edge point detected along each search line - // in the ROI. - unsigned int numFirstEdges; // The number of points in the firstEdges array. - EdgeInfo* lastEdges; // The last edge point detected along each search line - // in the ROI. - unsigned int numLastEdges; // The number of points in the lastEdges array. - SearchLineInfo* searchLines; // The search lines used for edge detection. - unsigned int - numSearchLines; // The number of search lines used in the edge detection. -} RakeReport2; - -typedef struct TransformBehaviors_struct { - GroupBehavior ShiftBehavior; // Specifies the behavior of an overlay group - // when a shift operation is applied to an - // image. - GroupBehavior ScaleBehavior; // Specifies the behavior of an overlay group - // when a scale operation is applied to an - // image. - GroupBehavior RotateBehavior; // Specifies the behavior of an overlay group - // when a rotate operation is applied to an - // image. - GroupBehavior SymmetryBehavior; // Specifies the behavior of an overlay group - // when a symmetry operation is applied to an - // image. -} TransformBehaviors; - -typedef struct QRCodeDataToken_struct { - QRStreamMode mode; // Specifies the stream mode or the format of the data - // that is encoded in the QR code. - unsigned int modeData; // Indicates specifiers used by the user to - // postprocess the data if it requires it. - unsigned char* data; // Shows the encoded data in the QR code. - unsigned int - dataLength; // Specifies the length of the data found in the QR code. -} QRCodeDataToken; - -typedef struct ParticleFilterOptions_struct { - int rejectMatches; // Set this parameter to TRUE to transfer only those - // particles that do not meet all the criteria. - int rejectBorder; // Set this element to TRUE to reject border particles. - int connectivity8; // Set this parameter to TRUE to use connectivity-8 to - // determine whether particles are touching. -} ParticleFilterOptions; - -typedef struct StraightEdgeReport2_struct { - StraightEdge* straightEdges; // Contains an array of found straight edges. - unsigned int - numStraightEdges; // Indicates the number of straight edges found. - SearchLineInfo* searchLines; // Contains an array of all search lines used in - // the detection. - unsigned int - numSearchLines; // The number of search lines used in the edge detection. -} StraightEdgeReport2; - -typedef struct StraightEdgeOptions_struct { - unsigned int numLines; // Specifies the number of straight edges to find. - StraightEdgeSearchMode - searchMode; // Specifies the method used to find the straight edge. - double minScore; // Specifies the minimum score of a detected straight edge. - double maxScore; // Specifies the maximum score of a detected edge. - double orientation; // Specifies the angle at which the straight edge is - // expected to be found. - double angleRange; // Specifies the +/- range around the orientation within - // which the straight edge is expected to be found. - double angleTolerance; // Specifies the expected angular accuracy of the - // straight edge. - unsigned int stepSize; // Specifies the gap in pixels between the search - // lines used with the rake-based methods. - double minSignalToNoiseRatio; // Specifies the minimum signal to noise ratio - // (SNR) of the edge points used to fit the - // straight edge. - double minCoverage; // Specifies the minimum number of points as a percentage - // of the number of search lines that need to be included - // in the detected straight edge. - unsigned int houghIterations; // Specifies the number of iterations used in - // the Hough-based method. -} StraightEdgeOptions; - -typedef struct StraightEdge_struct { - LineFloat straightEdgeCoordinates; // End points of the detected straight - // edge in pixel coordinates. - LineFloat calibratedStraightEdgeCoordinates; // End points of the detected - // straight edge in real-world - // coordinates. - double angle; // Angle of the found edge using the pixel coordinates. - double calibratedAngle; // Angle of the found edge using the real-world - // coordinates. - double score; // Describes the score of the detected edge. - double straightness; // The straightness value of the detected straight edge. - double averageSignalToNoiseRatio; // Describes the average signal to noise - // ratio (SNR) of the detected edge. - int calibrationValid; // Indicates if the calibration data for the straight - // edge is valid. - EdgeInfo* usedEdges; // An array of edges that were used to determine this - // straight line. - unsigned int - numUsedEdges; // Indicates the number of edges in the usedEdges array. -} StraightEdge; - -typedef struct QRCodeSearchOptions_struct { - QRRotationMode rotationMode; // Specifies the amount of QR code rotation the - // function should allow for. - unsigned int skipLocation; // If set to TRUE, specifies that the function - // should assume that the QR code occupies the - // entire image (or the entire search region). - unsigned int edgeThreshold; // The strength of the weakest edge the function - // uses to find the coarse location of the QR - // code in the image. - QRDemodulationMode demodulationMode; // The demodulation mode the function - // uses to locate the QR code. - QRCellSampleSize cellSampleSize; // The cell sample size the function uses to - // locate the QR code. - QRCellFilterMode cellFilterMode; // The cell filter mode the function uses to - // locate the QR code. - unsigned int skewDegreesAllowed; // Specifies the amount of skew in the QR - // code the function should allow for. -} QRCodeSearchOptions; - -typedef struct QRCodeSizeOptions_struct { - unsigned int minSize; // Specifies the minimum size (in pixels) of the QR - // code in the image. - unsigned int maxSize; // Specifies the maximum size (in pixels) of the QR - // code in the image. -} QRCodeSizeOptions; - -typedef struct QRCodeDescriptionOptions_struct { - QRDimensions dimensions; // The number of rows and columns that are populated - // for the QR code, measured in cells. - QRPolarities polarity; // The polarity of the QR code. - QRMirrorMode mirror; // This element is TRUE if the QR code appears mirrored - // in the image and FALSE if the QR code appears - // normally in the image. - QRModelType - modelType; // This option allows you to specify the type of QR code. -} QRCodeDescriptionOptions; - -typedef struct QRCodeReport_struct { - unsigned int found; // This element is TRUE if the function located and - // decoded a QR code and FALSE if the function failed to - // locate and decode a QR code. - unsigned char* data; // The data encoded in the QR code. - unsigned int dataLength; // The length of the data array. - PointFloat boundingBox[4]; // An array of four points describing the - // rectangle surrounding the QR code. - QRCodeDataToken* tokenizedData; // Contains the data tokenized in exactly the - // way it was encoded in the code. - unsigned int sizeOfTokenizedData; // Size of the tokenized data. - unsigned int numErrorsCorrected; // The number of errors the function - // corrected when decoding the QR code. - unsigned int dimensions; // The number of rows and columns that are populated - // for the QR code, measured in cells. - unsigned int version; // The version of the QR code. - QRModelType modelType; // This option allows you to specify what type of QR - // code this is. - QRStreamMode streamMode; // The format of the data encoded in the stream. - QRPolarities matrixPolarity; // The polarity of the QR code. - unsigned int mirrored; // This element is TRUE if the QR code appears - // mirrored in the image and FALSE if the QR code - // appears normally in the image. - unsigned int positionInAppendStream; // Indicates what position the QR code - // is in with respect to the stream of - // data in all codes. - unsigned int sizeOfAppendStream; // Specifies how many QR codes are part of a - // larger array of codes. - int firstEAN128ApplicationID; // The first EAN-128 Application ID encountered - // in the stream. - int firstECIDesignator; // The first Regional Language Designator encountered - // in the stream. - unsigned int appendStreamIdentifier; // Specifies what stream the QR code is - // in relation to when the code is part - // of a larger array of codes. - unsigned int minimumEdgeStrength; // The strength of the weakest edge the - // function used to find the coarse - // location of the QR code in the image. - QRDemodulationMode demodulationMode; // The demodulation mode the function - // used to locate the QR code. - QRCellSampleSize cellSampleSize; // The cell sample size the function used to - // locate the QR code. - QRCellFilterMode cellFilterMode; // The cell filter mode the function used to - // locate the QR code. -} QRCodeReport; - -typedef struct AIMGradeReport_struct { - AIMGrade overallGrade; // The overall letter grade, which is equal to the - // lowest of the other five letter grades. - AIMGrade decodingGrade; // The letter grade assigned to a Data Matrix barcode - // based on the success of the function in decoding - // the Data Matrix barcode. - AIMGrade symbolContrastGrade; // The letter grade assigned to a Data Matrix - // barcode based on the symbol contrast raw - // score. - float symbolContrast; // The symbol contrast raw score representing the - // percentage difference between the mean of the - // reflectance of the darkest 10 percent and lightest - // 10 percent of the Data Matrix barcode. - AIMGrade printGrowthGrade; // The print growth letter grade for the Data - // Matrix barcode. - float printGrowth; // The print growth raw score for the barcode, which is - // based on the extent to which dark or light markings - // appropriately fill their module boundaries. - AIMGrade axialNonuniformityGrade; // The axial nonuniformity grade for the - // Data Matrix barcode. - float axialNonuniformity; // The axial nonuniformity raw score for the - // barcode, which is based on how much the sampling - // point spacing differs from one axis to another. - AIMGrade unusedErrorCorrectionGrade; // The unused error correction letter - // grade for the Data Matrix barcode. - float unusedErrorCorrection; // The unused error correction raw score for the - // Data Matrix barcode, which is based on the - // extent to which regional or spot damage in - // the Data Matrix barcode has eroded the - // reading safety margin provided by the error - // correction. -} AIMGradeReport; - -typedef struct DataMatrixSizeOptions_struct { - unsigned int minSize; // Specifies the minimum size (in pixels) of the Data - // Matrix barcode in the image. - unsigned int maxSize; // Specifies the maximum size (in pixels) of the Data - // Matrix barcode in the image. - unsigned int quietZoneWidth; // Specifies the expected minimum size of the - // quiet zone, in pixels. -} DataMatrixSizeOptions; - -typedef struct DataMatrixDescriptionOptions_struct { - float aspectRatio; // Specifies the ratio of the width of each Data Matrix - // barcode cell (in pixels) to the height of the Data - // Matrix barcode (in pixels). - unsigned int rows; // Specifies the number of rows in the Data Matrix - // barcode. - unsigned int - columns; // Specifies the number of columns in the Data Matrix barcode. - int rectangle; // Set this element to TRUE to specify that the Data Matrix - // barcode is rectangular. - DataMatrixECC ecc; // Specifies the ECC used for this Data Matrix barcode. - DataMatrixPolarity polarity; // Specifies the data-to-background contrast for - // the Data Matrix barcode. - DataMatrixCellFillMode cellFill; // Specifies the fill percentage for a cell - // of the Data Matrix barcode that is in the - // "ON" state. - float minBorderIntegrity; // Specifies the minimum percentage of the border - // (locator pattern and timing pattern) the - // function should expect in the Data Matrix - // barcode. - DataMatrixMirrorMode mirrorMode; // Specifies if the Data Matrix barcode - // appears normally in the image or if the - // barcode appears mirrored in the image. -} DataMatrixDescriptionOptions; - -typedef struct DataMatrixSearchOptions_struct { - DataMatrixRotationMode rotationMode; // Specifies the amount of Data Matrix - // barcode rotation the function should - // allow for. - int skipLocation; // If set to TRUE, specifies that the function should - // assume that the Data Matrix barcode occupies the entire - // image (or the entire search region). - unsigned int edgeThreshold; // Specifies the minimum contrast a pixel must - // have in order to be considered part of a - // matrix cell edge. - DataMatrixDemodulationMode demodulationMode; // Specifies the mode the - // function should use to - // demodulate (determine which - // cells are on and which cells - // are off) the Data Matrix - // barcode. - DataMatrixCellSampleSize cellSampleSize; // Specifies the sample size, in - // pixels, the function should take - // to determine if each cell is on - // or off. - DataMatrixCellFilterMode cellFilterMode; // Specifies the mode the function - // uses to determine the pixel value - // for each cell. - unsigned int skewDegreesAllowed; // Specifies the amount of skew in the Data - // Matrix barcode the function should allow - // for. - unsigned int maxIterations; // Specifies the maximum number of iterations - // before the function stops looking for the Data - // Matrix barcode. - unsigned int initialSearchVectorWidth; // Specifies the number of pixels the - // function should average together to - // determine the location of an edge. -} DataMatrixSearchOptions; - -typedef struct DataMatrixReport_struct { - int found; // This element is TRUE if the function located and decoded a Data - // Matrix barcode and FALSE if the function failed to locate and - // decode a Data Matrix barcode. - int binary; // This element is TRUE if the Data Matrix barcode contains - // binary data and FALSE if the Data Matrix barcode contains text - // data. - unsigned char* data; // The data encoded in the Data Matrix barcode. - unsigned int dataLength; // The length of the data array. - PointFloat boundingBox[4]; // An array of four points describing the - // rectangle surrounding the Data Matrix barcode. - unsigned int numErrorsCorrected; // The number of errors the function - // corrected when decoding the Data Matrix - // barcode. - unsigned int numErasuresCorrected; // The number of erasures the function - // corrected when decoding the Data Matrix - // barcode. - float aspectRatio; // Specifies the aspect ratio of the Data Matrix barcode - // in the image, which equals the ratio of the width of a - // Data Matrix barcode cell (in pixels) to the height of a - // Data Matrix barcode cell (in pixels). - unsigned int rows; // The number of rows in the Data Matrix barcode. - unsigned int columns; // The number of columns in the Data Matrix barcode. - DataMatrixECC - ecc; // The Error Correction Code (ECC) used by the Data Matrix barcode. - DataMatrixPolarity polarity; // The polarity of the Data Matrix barcode. - DataMatrixCellFillMode - cellFill; // The cell fill percentage of the Data Matrix barcode. - float borderIntegrity; // The percentage of the Data Matrix barcode border - // that appears correctly in the image. - int mirrored; // This element is TRUE if the Data Matrix barcode appears - // mirrored in the image and FALSE if the Data Matrix barcode - // appears normally in the image. - unsigned int minimumEdgeStrength; // The strength of the weakest edge the - // function used to find the coarse - // location of the Data Matrix barcode in - // the image. - DataMatrixDemodulationMode demodulationMode; // The demodulation mode the - // function used to locate the - // Data Matrix barcode. - DataMatrixCellSampleSize cellSampleSize; // The cell sample size the function - // used to locate the Data Matrix - // barcode. - DataMatrixCellFilterMode cellFilterMode; // The cell filter mode the function - // used to locate the Data Matrix - // barcode. - unsigned int iterations; // The number of iterations the function took in - // attempting to locate the Data Matrix barcode. -} DataMatrixReport; - -typedef struct JPEG2000FileAdvancedOptions_struct { - WaveletTransformMode waveletMode; // Determines which wavelet transform to - // use when writing the file. - int useMultiComponentTransform; // Set this parameter to TRUE to use an - // additional transform on RGB images. - unsigned int maxWaveletTransformLevel; // Specifies the maximum allowed level - // of wavelet transform. - float quantizationStepSize; // Specifies the absolute base quantization step - // size for derived quantization mode. -} JPEG2000FileAdvancedOptions; - -typedef struct MatchGeometricPatternAdvancedOptions2_struct { - int minFeaturesUsed; // Specifies the minimum number of features the function - // uses when matching. - int maxFeaturesUsed; // Specifies the maximum number of features the function - // uses when matching. - int subpixelIterations; // Specifies the maximum number of incremental - // improvements used to refine matches with subpixel - // information. - double subpixelTolerance; // Specifies the maximum amount of change, in - // pixels, between consecutive incremental - // improvements in the match position before the - // function stops refining the match position. - int initialMatchListLength; // Specifies the maximum size of the match list. - float matchTemplateCurveScore; // Set this element to TRUE to specify that - // the function should calculate the match - // curve to template curve score and return it - // for each match result. - int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation score and - // return it for each match result. - double minMatchSeparationDistance; // Specifies the minimum separation - // distance, in pixels, between the - // origins of two matches that have unique - // positions. - double minMatchSeparationAngle; // Specifies the minimum angular difference, - // in degrees, between two matches that have - // unique angles. - double minMatchSeparationScale; // Specifies the minimum difference in scale, - // expressed as a percentage, between two - // matches that have unique scales. - double maxMatchOverlap; // Specifies the maximum amount of overlap, expressed - // as a percentage, allowed between the bounding - // rectangles of two unique matches. - int coarseResult; // Specifies whether you want the function to spend less - // time accurately estimating the location of a match. - int smoothContours; // Set this element to TRUE to specify smoothing be done - // on the contours of the inspection image before feature - // extraction. - int enableCalibrationSupport; // Set this element to TRUE to specify the - // algorithm treat the inspection image as a - // calibrated image. -} MatchGeometricPatternAdvancedOptions2; - -typedef struct InspectionAlignment_struct { - PointFloat position; // The location of the center of the golden template in - // the image under inspection. - float rotation; // The rotation of the golden template in the image under - // inspection, in degrees. - float scale; // The percentage of the size of the area under inspection - // compared to the size of the golden template. -} InspectionAlignment; - -typedef struct InspectionOptions_struct { - RegistrationMethod registrationMethod; // Specifies how the function - // registers the golden template and - // the target image. - NormalizationMethod normalizationMethod; // Specifies how the function - // normalizes the golden template to - // the target image. - int edgeThicknessToIgnore; // Specifies desired thickness of edges to be - // ignored. - float brightThreshold; // Specifies the threshold for areas where the target - // image is brighter than the golden template. - float darkThreshold; // Specifies the threshold for areas where the target - // image is darker than the golden template. - int binary; // Specifies whether the function should return a binary image - // giving the location of defects, or a grayscale image giving - // the intensity of defects. -} InspectionOptions; - -typedef struct CharReport2_struct { - const char* character; // The character value. - PointFloat corner[4]; // An array of four points that describes the rectangle - // that surrounds the character. - int lowThreshold; // The minimum value of the threshold range used for this - // character. - int highThreshold; // The maximum value of the threshold range used for this - // character. - int classificationScore; // The degree to which the assigned character class - // represents the object better than the other - // character classes in the character set. - int verificationScore; // The similarity of the character and the reference - // character for the character class. - int verified; // This element is TRUE if a reference character was found for - // the character class and FALSE if a reference character was - // not found. -} CharReport2; - -typedef struct CharInfo2_struct { - const char* charValue; // Retrieves the character value of the corresponding - // character in the character set. - const Image* charImage; // The image you used to train this character. - const Image* internalImage; // The internal representation that NI Vision - // uses to match objects to this character. - int isReferenceChar; // This element is TRUE if the character is the - // reference character for the character class. -} CharInfo2; - -typedef struct ReadTextReport2_struct { - const char* readString; // The read string. - CharReport2* characterReport; // An array of reports describing the - // properties of each identified character. - int numCharacterReports; // The number of identified characters. -} ReadTextReport2; - -typedef struct EllipseFeature_struct { - PointFloat position; // The location of the center of the ellipse. - double rotation; // The orientation of the semi-major axis of the ellipse - // with respect to the horizontal. - double minorRadius; // The length of the semi-minor axis of the ellipse. - double majorRadius; // The length of the semi-major axis of the ellipse. -} EllipseFeature; - -typedef struct CircleFeature_struct { - PointFloat position; // The location of the center of the circle. - double radius; // The radius of the circle. -} CircleFeature; - -typedef struct ConstCurveFeature_struct { - PointFloat - position; // The center of the circle that this constant curve lies upon. - double radius; // The radius of the circle that this constant curve lies - // upon. - double startAngle; // When traveling along the constant curve from one - // endpoint to the next in a counterclockwise manner, this - // is the angular component of the vector originating at - // the center of the constant curve and pointing towards - // the first endpoint of the constant curve. - double endAngle; // When traveling along the constant curve from one endpoint - // to the next in a counterclockwise manner, this is the - // angular component of the vector originating at the center - // of the constant curve and pointing towards the second - // endpoint of the constant curve. -} ConstCurveFeature; - -typedef struct RectangleFeature_struct { - PointFloat position; // The center of the rectangle. - PointFloat corner[4]; // The four corners of the rectangle. - double rotation; // The orientation of the rectangle with respect to the - // horizontal. - double width; // The width of the rectangle. - double height; // The height of the rectangle. -} RectangleFeature; - -typedef struct LegFeature_struct { - PointFloat position; // The location of the leg feature. - PointFloat corner[4]; // The four corners of the leg feature. - double rotation; // The orientation of the leg with respect to the - // horizontal. - double width; // The width of the leg. - double height; // The height of the leg. -} LegFeature; - -typedef struct CornerFeature_struct { - PointFloat position; // The location of the corner feature. - double rotation; // The angular component of the vector bisecting the corner - // from position. - double enclosedAngle; // The measure of the enclosed angle of the corner. - int isVirtual; -} CornerFeature; - -typedef struct LineFeature_struct { - PointFloat startPoint; // The starting point of the line. - PointFloat endPoint; // The ending point of the line. - double length; // The length of the line measured in pixels from the start - // point to the end point. - double - rotation; // The orientation of the line with respect to the horizontal. -} LineFeature; - -typedef struct ParallelLinePairFeature_struct { - PointFloat - firstStartPoint; // The starting point of the first line of the pair. - PointFloat firstEndPoint; // The ending point of the first line of the pair. - PointFloat - secondStartPoint; // The starting point of the second line of the pair. - PointFloat secondEndPoint; // The ending point of the second line of the - // pair. - double rotation; // The orientation of the feature with respect to the - // horizontal. - double distance; // The distance from the first line to the second line. -} ParallelLinePairFeature; - -typedef struct PairOfParallelLinePairsFeature_struct { - ParallelLinePairFeature - firstParallelLinePair; // The first parallel line pair. - ParallelLinePairFeature - secondParallelLinePair; // The second parallel line pair. - double rotation; // The orientation of the feature with respect to the - // horizontal. - double distance; // The distance from the midline of the first parallel line - // pair to the midline of the second parallel line pair. -} PairOfParallelLinePairsFeature; - -typedef union GeometricFeature_union { - CircleFeature* circle; // A pointer to a CircleFeature. - EllipseFeature* ellipse; // A pointer to an EllipseFeature. - ConstCurveFeature* constCurve; // A pointer to a ConstCurveFeature. - RectangleFeature* rectangle; // A pointer to a RectangleFeature. - LegFeature* leg; // A pointer to a LegFeature. - CornerFeature* corner; // A pointer to a CornerFeature. - ParallelLinePairFeature* - parallelLinePair; // A pointer to a ParallelLinePairFeature. - PairOfParallelLinePairsFeature* - pairOfParallelLinePairs; // A pointer to a - // PairOfParallelLinePairsFeature. - LineFeature* line; // A pointer to a LineFeature. - ClosedCurveFeature* closedCurve; // A pointer to a ClosedCurveFeature. -} GeometricFeature; - -typedef struct FeatureData_struct { - FeatureType type; // An enumeration representing the type of the feature. - PointFloat* - contourPoints; // A set of points describing the contour of the feature. - int numContourPoints; // The number of points in the contourPoints array. - GeometricFeature - feature; // The feature data specific to this type of feature. -} FeatureData; - -typedef struct GeometricPatternMatch2_struct { - PointFloat - position; // The location of the origin of the template in the match. - float rotation; // The rotation of the match relative to the template image, - // in degrees. - float scale; // The size of the match relative to the size of the template - // image, expressed as a percentage. - float score; // The accuracy of the match. - PointFloat corner[4]; // An array of four points describing the rectangle - // surrounding the template image. - int inverse; // This element is TRUE if the match is an inverse of the - // template image. - float occlusion; // The percentage of the match that is occluded. - float templateMatchCurveScore; // The accuracy of the match obtained by - // comparing the template curves to the curves - // in the match region. - float matchTemplateCurveScore; // The accuracy of the match obtained by - // comparing the curves in the match region to - // the template curves. - float correlationScore; // The accuracy of the match obtained by comparing - // the template image to the match region using a - // correlation metric that compares the two regions - // as a function of their pixel values. - String255 label; // The label corresponding to this match when the match is - // returned by imaqMatchMultipleGeometricPatterns(). - FeatureData* featureData; // The features used in this match. - int numFeatureData; // The size of the featureData array. - PointFloat calibratedPosition; // The location of the origin of the template - // in the match. - float calibratedRotation; // The rotation of the match relative to the - // template image, in degrees. - PointFloat calibratedCorner[4]; // An array of four points describing the - // rectangle surrounding the template image. -} GeometricPatternMatch2; - -typedef struct ClosedCurveFeature_struct { - PointFloat position; // The center of the closed curve feature. - double arcLength; // The arc length of the closed curve feature. -} ClosedCurveFeature; - -typedef struct LineMatch_struct { - PointFloat startPoint; // The starting point of the matched line. - PointFloat endPoint; // The ending point of the matched line. - double length; // The length of the line measured in pixels from the start - // point to the end point. - double rotation; // The orientation of the matched line. - double score; // The score of the matched line. -} LineMatch; - -typedef struct LineDescriptor_struct { - double minLength; // Specifies the minimum length of a line the function will - // return. - double maxLength; // Specifies the maximum length of a line the function will - // return. -} LineDescriptor; - -typedef struct RectangleDescriptor_struct { - double minWidth; // Specifies the minimum width of a rectangle the algorithm - // will return. - double maxWidth; // Specifies the maximum width of a rectangle the algorithm - // will return. - double minHeight; // Specifies the minimum height of a rectangle the - // algorithm will return. - double maxHeight; // Specifies the maximum height of a rectangle the - // algorithm will return. -} RectangleDescriptor; - -typedef struct RectangleMatch_struct { - PointFloat corner[4]; // The corners of the matched rectangle. - double rotation; // The orientation of the matched rectangle. - double width; // The width of the matched rectangle. - double height; // The height of the matched rectangle. - double score; // The score of the matched rectangle. -} RectangleMatch; - -typedef struct EllipseDescriptor_struct { - double minMajorRadius; // Specifies the minimum length of the semi-major axis - // of an ellipse the function will return. - double maxMajorRadius; // Specifies the maximum length of the semi-major axis - // of an ellipse the function will return. - double minMinorRadius; // Specifies the minimum length of the semi-minor axis - // of an ellipse the function will return. - double maxMinorRadius; // Specifies the maximum length of the semi-minor axis - // of an ellipse the function will return. -} EllipseDescriptor; - -typedef struct EllipseMatch_struct { - PointFloat position; // The location of the center of the matched ellipse. - double rotation; // The orientation of the matched ellipse. - double - majorRadius; // The length of the semi-major axis of the matched ellipse. - double - minorRadius; // The length of the semi-minor axis of the matched ellipse. - double score; // The score of the matched ellipse. -} EllipseMatch; - -typedef struct CircleMatch_struct { - PointFloat position; // The location of the center of the matched circle. - double radius; // The radius of the matched circle. - double score; // The score of the matched circle. -} CircleMatch; - -typedef struct CircleDescriptor_struct { - double minRadius; // Specifies the minimum radius of a circle the function - // will return. - double maxRadius; // Specifies the maximum radius of a circle the function - // will return. -} CircleDescriptor; - -typedef struct ShapeDetectionOptions_struct { - unsigned int mode; // Specifies the method used when looking for the shape in - // the image. - RangeFloat* angleRanges; // An array of angle ranges, in degrees, where each - // range specifies how much you expect the shape to - // be rotated in the image. - int numAngleRanges; // The size of the orientationRanges array. - RangeFloat scaleRange; // A range that specifies the sizes of the shapes you - // expect to be in the image, expressed as a ratio - // percentage representing the size of the pattern in - // the image divided by size of the original pattern - // multiplied by 100. - double minMatchScore; -} ShapeDetectionOptions; - -typedef struct Curve_struct { - PointFloat* points; // The points on the curve. - unsigned int numPoints; // The number of points in the curve. - int closed; // This element is TRUE if the curve is closed and FALSE if the - // curve is open. - double curveLength; // The length of the curve. - double minEdgeStrength; // The lowest edge strength detected on the curve. - double maxEdgeStrength; // The highest edge strength detected on the curve. - double averageEdgeStrength; // The average of all edge strengths detected on - // the curve. -} Curve; - -typedef struct CurveOptions_struct { - ExtractionMode extractionMode; // Specifies the method the function uses to - // identify curves in the image. - int threshold; // Specifies the minimum contrast a seed point must have in - // order to begin a curve. - EdgeFilterSize filterSize; // Specifies the width of the edge filter the - // function uses to identify curves in the image. - int minLength; // Specifies the length, in pixels, of the smallest curve the - // function will extract. - int rowStepSize; // Specifies the distance, in the y direction, between lines - // the function inspects for curve seed points. - int columnStepSize; // Specifies the distance, in the x direction, between - // columns the function inspects for curve seed points. - int maxEndPointGap; // Specifies the maximum gap, in pixels, between the - // endpoints of a curve that the function identifies as a - // closed curve. - int onlyClosed; // Set this element to TRUE to specify that the function - // should only identify closed curves in the image. - int subpixelAccuracy; // Set this element to TRUE to specify that the - // function identifies the location of curves with - // subpixel accuracy by interpolating between points to - // find the crossing of threshold. -} CurveOptions; - -typedef struct Barcode2DInfo_struct { - Barcode2DType type; // The type of the 2D barcode. - int binary; // This element is TRUE if the 2D barcode contains binary data - // and FALSE if the 2D barcode contains text data. - unsigned char* data; // The data encoded in the 2D barcode. - unsigned int dataLength; // The length of the data array. - PointFloat boundingBox[4]; // An array of four points describing the - // rectangle surrounding the 2D barcode. - unsigned int numErrorsCorrected; // The number of errors the function - // corrected when decoding the 2D barcode. - unsigned int numErasuresCorrected; // The number of erasures the function - // corrected when decoding the 2D barcode. - unsigned int rows; // The number of rows in the 2D barcode. - unsigned int columns; // The number of columns in the 2D barcode. -} Barcode2DInfo; - -typedef struct DataMatrixOptions_struct { - Barcode2DSearchMode searchMode; // Specifies the mode the function uses to - // search for barcodes. - Barcode2DContrast contrast; // Specifies the contrast of the barcodes that - // the function searches for. - Barcode2DCellShape cellShape; // Specifies the shape of the barcode data - // cells, which affects how the function - // decodes the barcode. - Barcode2DShape barcodeShape; // Specifies the shape of the barcodes that the - // function searches for. - DataMatrixSubtype subtype; // Specifies the Data Matrix subtypes of the - // barcodes that the function searches for. -} DataMatrixOptions; - -typedef struct ClassifierAccuracyReport_struct { - int size; // The size of the arrays in this structure. - float accuracy; // The overall accuracy of the classifier, from 0 to 1000. - char** classNames; // The names of the classes of this classifier. - double* classAccuracy; // An array of size elements that contains accuracy - // information for each class. - double* classPredictiveValue; // An array containing size elements that - // contains the predictive values of each - // class. - int** classificationDistribution; // A two-dimensional array containing - // information about how the classifier - // classifies its samples. -} ClassifierAccuracyReport; - -typedef struct NearestNeighborClassResult_struct { - char* className; // The name of the class. - float standardDeviation; // The standard deviation of the members of this - // class. - int count; // The number of samples in this class. -} NearestNeighborClassResult; - -typedef struct NearestNeighborTrainingReport_struct { - float** classDistancesTable; // The confidence in the training. - NearestNeighborClassResult* allScores; // All classes and their scores. - int allScoresSize; // The number of entries in allScores. -} NearestNeighborTrainingReport; - -typedef struct ParticleClassifierPreprocessingOptions_struct { - int manualThreshold; // Set this element to TRUE to specify the threshold - // range manually. - RangeFloat manualThresholdRange; // If a manual threshold is being done, the - // range of pixels to keep. - ThresholdMethod autoThresholdMethod; // If an automatic threshold is being - // done, the method used to calculate - // the threshold range. - RangeFloat limits; // The limits on the automatic threshold range. - ParticleType particleType; // Specifies what kind of particles to look for. - int rejectBorder; // Set this element to TRUE to reject border particles. - int numErosions; // The number of erosions to perform. -} ParticleClassifierPreprocessingOptions; - -typedef struct ClassifierSampleInfo_struct { - char* className; // The name of the class this sample is in. - double* featureVector; // The feature vector of this sample, or NULL if this - // is not a custom classifier session. - int featureVectorSize; // The number of elements in the feature vector. - Image* thumbnail; // A thumbnail image of this sample, or NULL if no image - // was specified. -} ClassifierSampleInfo; - -typedef struct ClassScore_struct { - char* className; // The name of the class. - float distance; // The distance from the item to this class. -} ClassScore; - -typedef struct ClassifierReport_struct { - char* bestClassName; // The name of the best class for the sample. - float classificationScore; // The similarity of the sample and the two - // closest classes in the classifier. - float identificationScore; // The similarity of the sample and the assigned - // class. - ClassScore* allScores; // All classes and their scores. - int allScoresSize; // The number of entries in allScores. -} ClassifierReport; - -typedef struct NearestNeighborOptions_struct { - NearestNeighborMethod method; // The method to use. - NearestNeighborMetric metric; // The metric to use. - int k; // The value of k, if the IMAQ_K_NEAREST_NEIGHBOR method is used. -} NearestNeighborOptions; - -typedef struct ParticleClassifierOptions_struct { - float scaleDependence; // The relative importance of scale when classifying - // particles. - float mirrorDependence; // The relative importance of mirror symmetry when - // classifying particles. -} ParticleClassifierOptions; - -typedef struct RGBU64Value_struct { - unsigned short B; // The blue value of the color. - unsigned short G; // The green value of the color. - unsigned short R; // The red value of the color. - unsigned short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} RGBU64Value; - -typedef struct GeometricPatternMatch_struct { - PointFloat - position; // The location of the origin of the template in the match. - float rotation; // The rotation of the match relative to the template image, - // in degrees. - float scale; // The size of the match relative to the size of the template - // image, expressed as a percentage. - float score; // The accuracy of the match. - PointFloat corner[4]; // An array of four points describing the rectangle - // surrounding the template image. - int inverse; // This element is TRUE if the match is an inverse of the - // template image. - float occlusion; // The percentage of the match that is occluded. - float templateMatchCurveScore; // The accuracy of the match obtained by - // comparing the template curves to the curves - // in the match region. - float matchTemplateCurveScore; // The accuracy of the match obtained by - // comparing the curves in the match region to - // the template curves. - float correlationScore; // The accuracy of the match obtained by comparing - // the template image to the match region using a - // correlation metric that compares the two regions - // as a function of their pixel values. -} GeometricPatternMatch; - -typedef struct MatchGeometricPatternAdvancedOptions_struct { - int minFeaturesUsed; // Specifies the minimum number of features the function - // uses when matching. - int maxFeaturesUsed; // Specifies the maximum number of features the function - // uses when matching. - int subpixelIterations; // Specifies the maximum number of incremental - // improvements used to refine matches with subpixel - // information. - double subpixelTolerance; // Specifies the maximum amount of change, in - // pixels, between consecutive incremental - // improvements in the match position before the - // function stops refining the match position. - int initialMatchListLength; // Specifies the maximum size of the match list. - int matchTemplateCurveScore; // Set this element to TRUE to specify that the - // function should calculate the match curve to - // template curve score and return it for each - // match result. - int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation score and - // return it for each match result. - double minMatchSeparationDistance; // Specifies the minimum separation - // distance, in pixels, between the - // origins of two matches that have unique - // positions. - double minMatchSeparationAngle; // Specifies the minimum angular difference, - // in degrees, between two matches that have - // unique angles. - double minMatchSeparationScale; // Specifies the minimum difference in scale, - // expressed as a percentage, between two - // matches that have unique scales. - double maxMatchOverlap; // Specifies the maximum amount of overlap, expressed - // as a percentage, allowed between the bounding - // rectangles of two unique matches. - int coarseResult; // Specifies whether you want the function to spend less - // time accurately estimating the location of a match. -} MatchGeometricPatternAdvancedOptions; - -typedef struct MatchGeometricPatternOptions_struct { - unsigned int mode; // Specifies the method imaqMatchGeometricPattern() uses - // when looking for the pattern in the image. - int subpixelAccuracy; // Set this element to TRUE to specify that the - // function should calculate match locations with - // subpixel accuracy. - RangeFloat* angleRanges; // An array of angle ranges, in degrees, where each - // range specifies how much you expect the template - // to be rotated in the image. - int numAngleRanges; // Number of angle ranges in the angleRanges array. - RangeFloat scaleRange; // A range that specifies the sizes of the pattern you - // expect to be in the image, expressed as a ratio - // percentage representing the size of the pattern in - // the image divided by size of the original pattern - // multiplied by 100. - RangeFloat occlusionRange; // A range that specifies the percentage of the - // pattern you expect to be occluded in the image. - int numMatchesRequested; // Number of valid matches expected. - float minMatchScore; // The minimum score a match can have for the function - // to consider the match valid. -} MatchGeometricPatternOptions; - -typedef struct LearnGeometricPatternAdvancedOptions_struct { - int minRectLength; // Specifies the minimum length for each side of a - // rectangular feature. - double minRectAspectRatio; // Specifies the minimum aspect ratio of a - // rectangular feature. - int minRadius; // Specifies the minimum radius for a circular feature. - int minLineLength; // Specifies the minimum length for a linear feature. - double minFeatureStrength; // Specifies the minimum strength for a feature. - int maxFeaturesUsed; // Specifies the maximum number of features the function - // uses when learning. - int maxPixelDistanceFromLine; // Specifies the maximum number of pixels - // between an edge pixel and a linear feature - // for the function to consider that edge pixel - // as part of the linear feature. -} LearnGeometricPatternAdvancedOptions; - -typedef struct FitEllipseOptions_struct { - int rejectOutliers; // Whether to use every given point or only a subset of - // the points to fit the ellipse. - double minScore; // Specifies the required quality of the fitted ellipse. - double pixelRadius; // The acceptable distance, in pixels, that a point - // determined to belong to the ellipse can be from the - // circumference of the ellipse. - int maxIterations; // Specifies the number of refinement iterations you allow - // the function to perform on the initial subset of - // points. -} FitEllipseOptions; - -typedef struct FitCircleOptions_struct { - int rejectOutliers; // Whether to use every given point or only a subset of - // the points to fit the circle. - double minScore; // Specifies the required quality of the fitted circle. - double pixelRadius; // The acceptable distance, in pixels, that a point - // determined to belong to the circle can be from the - // circumference of the circle. - int maxIterations; // Specifies the number of refinement iterations you allow - // the function to perform on the initial subset of - // points. -} FitCircleOptions; - -typedef struct ConstructROIOptions2_struct { - int windowNumber; // The window number of the image window. - const char* windowTitle; // Specifies the message string that the function - // displays in the title bar of the window. - PaletteType type; // The palette type to use. - RGBValue* palette; // If type is IMAQ_PALETTE_USER, this array is the palette - // of colors to use with the window. - int numColors; // If type is IMAQ_PALETTE_USER, this element is the number of - // colors in the palette array. - unsigned int maxContours; // The maximum number of contours the user will be - // able to select. -} ConstructROIOptions2; - -typedef struct HSLValue_struct { - unsigned char L; // The color luminance. - unsigned char S; // The color saturation. - unsigned char H; // The color hue. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} HSLValue; - -typedef struct HSVValue_struct { - unsigned char V; // The color value. - unsigned char S; // The color saturation. - unsigned char H; // The color hue. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} HSVValue; - -typedef struct HSIValue_struct { - unsigned char I; // The color intensity. - unsigned char S; // The color saturation. - unsigned char H; // The color hue. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} HSIValue; - -typedef struct CIELabValue_struct { - double b; // The yellow/blue information of the color. - double a; // The red/green information of the color. - double L; // The color lightness. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} CIELabValue; - -typedef struct CIEXYZValue_struct { - double Z; // The Z color information. - double Y; // The color luminance. - double X; // The X color information. - unsigned char alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. -} CIEXYZValue; - -typedef union Color2_union { - RGBValue rgb; // The information needed to describe a color in the RGB (Red, - // Green, and Blue) color space. - HSLValue hsl; // The information needed to describe a color in the HSL (Hue, - // Saturation, and Luminance) color space. - HSVValue hsv; // The information needed to describe a color in the HSI (Hue, - // Saturation, and Value) color space. - HSIValue hsi; // The information needed to describe a color in the HSI (Hue, - // Saturation, and Intensity) color space. - CIELabValue cieLab; // The information needed to describe a color in the CIE - // L*a*b* (L, a, b) color space. - CIEXYZValue cieXYZ; // The information needed to describe a color in the CIE - // XYZ (X, Y, Z) color space. - int rawValue; // The integer value for the data in the color union. -} Color2; - -typedef struct BestEllipse2_struct { - PointFloat center; // The coordinate location of the center of the ellipse. - PointFloat majorAxisStart; // The coordinate location of the start of the - // major axis of the ellipse. - PointFloat majorAxisEnd; // The coordinate location of the end of the major - // axis of the ellipse. - PointFloat minorAxisStart; // The coordinate location of the start of the - // minor axis of the ellipse. - PointFloat minorAxisEnd; // The coordinate location of the end of the minor - // axis of the ellipse. - double area; // The area of the ellipse. - double perimeter; // The length of the perimeter of the ellipse. - double error; // Represents the least square error of the fitted ellipse to - // the entire set of points. - int valid; // This element is TRUE if the function achieved the minimum score - // within the number of allowed refinement iterations and FALSE if - // the function did not achieve the minimum score. - int* pointsUsed; // An array of the indexes for the points array indicating - // which points the function used to fit the ellipse. - int numPointsUsed; // The number of points the function used to fit the - // ellipse. -} BestEllipse2; - -typedef struct LearnPatternAdvancedOptions_struct { - LearnPatternAdvancedShiftOptions* shiftOptions; // Use this element to - // control the behavior of - // imaqLearnPattern2() during - // the shift-invariant - // learning phase. - LearnPatternAdvancedRotationOptions* - rotationOptions; // Use this element to control the behavior of - // imaqLearnPattern2()during the rotation-invariant - // learning phase. -} LearnPatternAdvancedOptions; - -typedef struct AVIInfo_struct { - unsigned int width; // The width of each frame. - unsigned int height; // The height of each frame. - ImageType imageType; // The type of images this AVI contains. - unsigned int numFrames; // The number of frames in the AVI. - unsigned int framesPerSecond; // The number of frames per second this AVI - // should be shown at. - char* filterName; // The name of the compression filter used to create this - // AVI. - int hasData; // Specifies whether this AVI has data attached to each frame or - // not. - unsigned int maxDataSize; // If this AVI has data, the maximum size of the - // data in each frame. -} AVIInfo; - -typedef struct LearnPatternAdvancedShiftOptions_struct { - int initialStepSize; // The largest number of image pixels to shift the - // sample across the inspection image during the initial - // phase of shift-invariant matching. - int initialSampleSize; // Specifies the number of template pixels that you - // want to include in a sample for the initial phase - // of shift-invariant matching. - double initialSampleSizeFactor; // Specifies the size of the sample for the - // initial phase of shift-invariant matching - // as a percent of the template size, in - // pixels. - int finalSampleSize; // Specifies the number of template pixels you want to - // add to initialSampleSize for the final phase of - // shift-invariant matching. - double finalSampleSizeFactor; // Specifies the size of the sample for the - // final phase of shift-invariant matching as a - // percent of the edge points in the template, - // in pixels. - int subpixelSampleSize; // Specifies the number of template pixels that you - // want to include in a sample for the subpixel phase - // of shift-invariant matching. - double subpixelSampleSizeFactor; // Specifies the size of the sample for the - // subpixel phase of shift-invariant - // matching as a percent of the template - // size, in pixels. -} LearnPatternAdvancedShiftOptions; - -typedef struct LearnPatternAdvancedRotationOptions_struct { - SearchStrategy searchStrategySupport; // Specifies the aggressiveness of the - // rotation search strategy available - // during the matching phase. - int initialStepSize; // The largest number of image pixels to shift the - // sample across the inspection image during the initial - // phase of matching. - int initialSampleSize; // Specifies the number of template pixels that you - // want to include in a sample for the initial phase - // of rotation-invariant matching. - double initialSampleSizeFactor; // Specifies the size of the sample for the - // initial phase of rotation-invariant - // matching as a percent of the template - // size, in pixels. - int initialAngularAccuracy; // Sets the angle accuracy, in degrees, to use - // during the initial phase of rotation-invariant - // matching. - int finalSampleSize; // Specifies the number of template pixels you want to - // add to initialSampleSize for the final phase of - // rotation-invariant matching. - double finalSampleSizeFactor; // Specifies the size of the sample for the - // final phase of rotation-invariant matching - // as a percent of the edge points in the - // template, in pixels. - int finalAngularAccuracy; // Sets the angle accuracy, in degrees, to use - // during the final phase of the rotation-invariant - // matching. - int subpixelSampleSize; // Specifies the number of template pixels that you - // want to include in a sample for the subpixel phase - // of rotation-invariant matching. - double subpixelSampleSizeFactor; // Specifies the size of the sample for the - // subpixel phase of rotation-invariant - // matching as a percent of the template - // size, in pixels. -} LearnPatternAdvancedRotationOptions; - -typedef struct MatchPatternAdvancedOptions_struct { - int subpixelIterations; // Defines the maximum number of incremental - // improvements used to refine matching using - // subpixel information. - double subpixelTolerance; // Defines the maximum amount of change, in pixels, - // between consecutive incremental improvements in - // the match position that you want to trigger the - // end of the refinement process. - int initialMatchListLength; // Specifies the maximum size of the match list. - int matchListReductionFactor; // Specifies the reduction of the match list as - // matches are refined. - int initialStepSize; // Specifies the number of pixels to shift the sample - // across the inspection image during the initial phase - // of shift-invariant matching. - SearchStrategy searchStrategy; // Specifies the aggressiveness of the - // rotation search strategy. - int intermediateAngularAccuracy; // Specifies the accuracy to use during the - // intermediate phase of rotation-invariant - // matching. -} MatchPatternAdvancedOptions; - -typedef struct ParticleFilterCriteria2_struct { - MeasurementType parameter; // The morphological measurement that the function - // uses for filtering. - float lower; // The lower bound of the criteria range. - float upper; // The upper bound of the criteria range. - int calibrated; // Set this element to TRUE to take calibrated measurements. - int exclude; // Set this element to TRUE to indicate that a match occurs when - // the measurement is outside the criteria range. -} ParticleFilterCriteria2; - -typedef struct BestCircle2_struct { - PointFloat center; // The coordinate location of the center of the circle. - double radius; // The radius of the circle. - double area; // The area of the circle. - double perimeter; // The length of the perimeter of the circle. - double error; // Represents the least square error of the fitted circle to - // the entire set of points. - int valid; // This element is TRUE if the function achieved the minimum score - // within the number of allowed refinement iterations and FALSE if - // the function did not achieve the minimum score. - int* pointsUsed; // An array of the indexes for the points array indicating - // which points the function used to fit the circle. - int numPointsUsed; // The number of points the function used to fit the - // circle. -} BestCircle2; - -typedef struct OCRSpacingOptions_struct { - int minCharSpacing; // The minimum number of pixels that must be between two - // characters for NI Vision to train or read the - // characters separately. - int minCharSize; // The minimum number of pixels required for an object to be - // a potentially identifiable character. - int maxCharSize; // The maximum number of pixels required for an object to be - // a potentially identifiable character. - int maxHorizontalElementSpacing; // The maximum horizontal spacing, in - // pixels, allowed between character - // elements to train or read the character - // elements as a single character. - int maxVerticalElementSpacing; // The maximum vertical element spacing in - // pixels. - int minBoundingRectWidth; // The minimum possible width, in pixels, for a - // character bounding rectangle. - int maxBoundingRectWidth; // The maximum possible width, in pixels, for a - // character bounding rectangle. - int minBoundingRectHeight; // The minimum possible height, in pixels, for a - // character bounding rectangle. - int maxBoundingRectHeight; // The maximum possible height, in pixels, for a - // character bounding rectangle. - int autoSplit; // Set this element to TRUE to automatically adjust the - // location of the character bounding rectangle when - // characters overlap vertically. -} OCRSpacingOptions; - -typedef struct OCRProcessingOptions_struct { - ThresholdMode mode; // The thresholding mode. - int lowThreshold; // The low threshold value when you set mode to - // IMAQ_FIXED_RANGE. - int highThreshold; // The high threshold value when you set mode to - // IMAQ_FIXED_RANGE. - int blockCount; // The number of blocks for threshold calculation algorithms - // that require blocks. - int fastThreshold; // Set this element to TRUE to use a faster, less accurate - // threshold calculation algorithm. - int biModalCalculation; // Set this element to TRUE to calculate both the low - // and high threshold values when using the fast - // thresholding method. - int darkCharacters; // Set this element to TRUE to read or train dark - // characters on a light background. - int removeParticlesTouchingROI; // Set this element to TRUE to remove the - // particles touching the ROI. - int erosionCount; // The number of erosions to perform. -} OCRProcessingOptions; - -typedef struct ReadTextOptions_struct { - String255 validChars[255]; // An array of strings that specifies the valid - // characters. - int numValidChars; // The number of strings in the validChars array that you - // have initialized. - char substitutionChar; // The character to substitute for objects that the - // function cannot match with any of the trained - // characters. - ReadStrategy readStrategy; // The read strategy, which determines how closely - // the function analyzes images in the reading - // process to match objects with trained - // characters. - int acceptanceLevel; // The minimum acceptance level at which an object is - // considered a trained character. - int aspectRatio; // The maximum aspect ratio variance percentage for valid - // characters. - ReadResolution readResolution; // The read resolution, which determines how - // much of the trained character data the - // function uses to match objects to trained - // characters. -} ReadTextOptions; - -typedef struct CharInfo_struct { - const char* charValue; // Retrieves the character value of the corresponding - // character in the character set. - const Image* charImage; // The image you used to train this character. - const Image* internalImage; // The internal representation that NI Vision - // uses to match objects to this character. -} CharInfo; - -#if !defined(USERINT_HEADER) && !defined(_CVI_RECT_DEFINED) -typedef struct Rect_struct { - int top; // Location of the top edge of the rectangle. - int left; // Location of the left edge of the rectangle. - int height; // Height of the rectangle. - int width; // Width of the rectangle. -} Rect; -#define _CVI_RECT_DEFINED -#endif - -typedef struct CharReport_struct { - const char* character; // The character value. - PointFloat corner[4]; // An array of four points that describes the rectangle - // that surrounds the character. - int reserved; // This element is reserved. - int lowThreshold; // The minimum value of the threshold range used for this - // character. - int highThreshold; // The maximum value of the threshold range used for this - // character. -} CharReport; - -typedef struct ReadTextReport_struct { - const char* readString; // The read string. - const CharReport* characterReport; // An array of reports describing the - // properties of each identified - // character. - int numCharacterReports; // The number of identified characters. -} ReadTextReport; - -#if !defined(USERINT_HEADER) && !defined(_CVI_POINT_DEFINED) -typedef struct Point_struct { - int x; // The x-coordinate of the point. - int y; // The y-coordinate of the point. -} Point; -#define _CVI_POINT_DEFINED -#endif - -typedef struct Annulus_struct { - Point center; // The coordinate location of the center of the annulus. - int innerRadius; // The internal radius of the annulus. - int outerRadius; // The external radius of the annulus. - double startAngle; // The start angle, in degrees, of the annulus. - double endAngle; // The end angle, in degrees, of the annulus. -} Annulus; - -typedef struct EdgeLocationReport_struct { - PointFloat* edges; // The coordinate location of all edges detected by the - // search line. - int numEdges; // The number of points in the edges array. -} EdgeLocationReport; - -typedef struct EdgeOptions_struct { - unsigned - threshold; // Specifies the threshold value for the contrast of the edge. - unsigned width; // The number of pixels that the function averages to find - // the contrast at either side of the edge. - unsigned steepness; // The span, in pixels, of the slope of the edge - // projected along the path specified by the input - // points. - InterpolationMethod subpixelType; // The method for interpolating. - unsigned subpixelDivisions; // The number of samples the function obtains - // from a pixel. -} EdgeOptions; - -typedef struct EdgeReport_struct { - float location; // The location of the edge from the first point in the - // points array. - float contrast; // The contrast at the edge. - PolarityType polarity; // The polarity of the edge. - float reserved; // This element is reserved. - PointFloat coordinate; // The coordinates of the edge. -} EdgeReport; - -typedef struct ExtremeReport_struct { - double location; // The locations of the extreme. - double amplitude; // The amplitude of the extreme. - double secondDerivative; // The second derivative of the extreme. -} ExtremeReport; - -typedef struct FitLineOptions_struct { - float minScore; // Specifies the required quality of the fitted line. - float pixelRadius; // Specifies the neighborhood pixel relationship for the - // initial subset of points being used. - int numRefinements; // Specifies the number of refinement iterations you - // allow the function to perform on the initial subset of - // points. -} FitLineOptions; - -typedef struct DisplayMapping_struct { - MappingMethod method; // Describes the method for converting 16-bit pixels to - // 8-bit pixels. - int minimumValue; // When method is IMAQ_RANGE, minimumValue represents the - // value that is mapped to 0. - int maximumValue; // When method is IMAQ_RANGE, maximumValue represents the - // value that is mapped to 255. - int shiftCount; // When method is IMAQ_DOWNSHIFT, shiftCount represents the - // number of bits the function right-shifts the 16-bit pixel - // values. -} DisplayMapping; - -typedef struct DetectExtremesOptions_struct { - double threshold; // Defines which extremes are too small. - int width; // Specifies the number of consecutive data points the function - // uses in the quadratic least-squares fit. -} DetectExtremesOptions; - -typedef struct ImageInfo_struct { - CalibrationUnit imageUnit; // If you set calibration information with - // imaqSetSimpleCalibrationInfo(), imageUnit is - // the calibration unit. - float stepX; // If you set calibration information with - // imaqSetCalibrationInfo(), stepX is the distance in the - // calibration unit between two pixels in the x direction. - float stepY; // If you set calibration information with - // imaqSetCalibrationInfo(), stepY is the distance in the - // calibration unit between two pixels in the y direction. - ImageType imageType; // The type of the image. - int xRes; // The number of columns in the image. - int yRes; // The number of rows in the image. - int xOffset; // If you set mask offset information with imaqSetMaskOffset(), - // xOffset is the offset of the mask origin in the x direction. - int yOffset; // If you set mask offset information with imaqSetMaskOffset(), - // yOffset is the offset of the mask origin in the y direction. - int border; // The number of border pixels around the image. - int pixelsPerLine; // The number of pixels stored for each line of the image. - void* reserved0; // This element is reserved. - void* reserved1; // This element is reserved. - void* imageStart; // A pointer to pixel (0,0). -} ImageInfo; - -typedef struct LCDOptions_struct { - int litSegments; // Set this parameter to TRUE if the segments are brighter - // than the background. - float threshold; // Determines whether a segment is ON or OFF. - int sign; // Indicates whether the function must read the sign of the - // indicator. - int decimalPoint; // Determines whether to look for a decimal separator after - // each digit. -} LCDOptions; - -typedef struct LCDReport_struct { - const char* text; // A string of the characters of the LCD. - LCDSegments* segmentInfo; // An array of LCDSegment structures describing - // which segments of each digit are on. - int numCharacters; // The number of characters that the function reads. - int reserved; // This element is reserved. -} LCDReport; - -typedef struct LCDSegments_struct { - unsigned a : 1; // True if the a segment is on. - unsigned b : 1; // True if the b segment is on. - unsigned c : 1; // True if the c segment is on. - unsigned d : 1; // True if the d segment is on. - unsigned e : 1; // True if the e segment is on. - unsigned f : 1; // True if the f segment is on. - unsigned g : 1; // True if the g segment is on. - unsigned reserved : 25; // This element is reserved. -} LCDSegments; - -typedef struct LearnCalibrationOptions_struct { - CalibrationMode mode; // Specifies the type of algorithm you want to use to - // reduce distortion in your image. - ScalingMethod method; // Defines the scaling method correction functions use - // to correct the image. - CalibrationROI roi; // Specifies the ROI correction functions use when - // correcting an image. - int learnMap; // Set this element to TRUE if you want the function to - // calculate and store an error map during the learning - // process. - int learnTable; // Set this element to TRUE if you want the function to - // calculate and store the correction table. -} LearnCalibrationOptions; - -typedef struct LearnColorPatternOptions_struct { - LearningMode learnMode; // Specifies the invariance mode the function uses - // when learning the pattern. - ImageFeatureMode featureMode; // Specifies the features the function uses - // when learning the color pattern. - int threshold; // Specifies the saturation threshold the function uses to - // distinguish between two colors that have the same hue - // values. - ColorIgnoreMode ignoreMode; // Specifies whether the function excludes - // certain colors from the color features of the - // template image. - ColorInformation* colorsToIgnore; // An array of ColorInformation structures - // providing a set of colors to exclude - // from the color features of the template - // image. - int numColorsToIgnore; // The number of ColorInformation structures in the - // colorsToIgnore array. -} LearnColorPatternOptions; - -typedef struct Line_struct { - Point start; // The coordinate location of the start of the line. - Point end; // The coordinate location of the end of the line. -} Line; - -typedef struct LinearAverages_struct { - float* columnAverages; // An array containing the mean pixel value of each - // column. - int columnCount; // The number of elements in the columnAverages array. - float* rowAverages; // An array containing the mean pixel value of each row. - int rowCount; // The number of elements in the rowAverages array. - float* risingDiagAverages; // An array containing the mean pixel value of - // each diagonal running from the lower left to - // the upper right of the inspected area of the - // image. - int risingDiagCount; // The number of elements in the risingDiagAverages - // array. - float* fallingDiagAverages; // An array containing the mean pixel value of - // each diagonal running from the upper left to - // the lower right of the inspected area of the - // image. - int fallingDiagCount; // The number of elements in the fallingDiagAverages - // array. -} LinearAverages; - -typedef struct LineProfile_struct { - float* - profileData; // An array containing the value of each pixel in the line. - Rect boundingBox; // The bounding rectangle of the line. - float min; // The smallest pixel value in the line profile. - float max; // The largest pixel value in the line profile. - float mean; // The mean value of the pixels in the line profile. - float stdDev; // The standard deviation of the line profile. - int dataCount; // The size of the profileData array. -} LineProfile; - -typedef struct MatchColorPatternOptions_struct { - MatchingMode matchMode; // Specifies the method to use when looking for the - // color pattern in the image. - ImageFeatureMode featureMode; // Specifies the features to use when looking - // for the color pattern in the image. - int minContrast; // Specifies the minimum contrast expected in the image. - int subpixelAccuracy; // Set this parameter to TRUE to return areas in the - // image that match the pattern area with subpixel - // accuracy. - RotationAngleRange* angleRanges; // An array of angle ranges, in degrees, - // where each range specifies how much you - // expect the pattern to be rotated in the - // image. - int numRanges; // Number of angle ranges in the angleRanges array. - double colorWeight; // Determines the percent contribution of the color score - // to the final color pattern matching score. - ColorSensitivity sensitivity; // Specifies the sensitivity of the color - // information in the image. - SearchStrategy strategy; // Specifies how the color features of the image are - // used during the search phase. - int numMatchesRequested; // Number of valid matches expected. - float minMatchScore; // The minimum score a match can have for the function - // to consider the match valid. -} MatchColorPatternOptions; - -typedef struct HistogramReport_struct { - int* histogram; // An array describing the number of pixels that fell into - // each class. - int histogramCount; // The number of elements in the histogram array. - float min; // The smallest pixel value that the function classified. - float max; // The largest pixel value that the function classified. - float start; // The smallest pixel value that fell into the first class. - float width; // The size of each class. - float mean; // The mean value of the pixels that the function classified. - float stdDev; // The standard deviation of the pixels that the function - // classified. - int numPixels; // The number of pixels that the function classified. -} HistogramReport; - -typedef struct ArcInfo_struct { - Rect boundingBox; // The coordinate location of the bounding box of the arc. - double startAngle; // The counterclockwise angle from the x-axis in degrees - // to the start of the arc. - double endAngle; // The counterclockwise angle from the x-axis in degrees to - // the end of the arc. -} ArcInfo; - -typedef struct AxisReport_struct { - PointFloat origin; // The origin of the coordinate system, which is the - // intersection of the two axes of the coordinate system. - PointFloat mainAxisEnd; // The end of the main axis, which is the result of - // the computation of the intersection of the main - // axis with the rectangular search area. - PointFloat secondaryAxisEnd; // The end of the secondary axis, which is the - // result of the computation of the intersection - // of the secondary axis with the rectangular - // search area. -} AxisReport; - -typedef struct BarcodeInfo_struct { - const char* outputString; // A string containing the decoded barcode data. - int size; // The size of the output string. - char outputChar1; // The contents of this character depend on the barcode - // type. - char outputChar2; // The contents of this character depend on the barcode - // type. - double confidenceLevel; // A quality measure of the decoded barcode ranging - // from 0 to 100, with 100 being the best. - BarcodeType type; // The type of barcode. -} BarcodeInfo; - -typedef struct BCGOptions_struct { - float brightness; // Adjusts the brightness of the image. - float contrast; // Adjusts the contrast of the image. - float gamma; // Performs gamma correction. -} BCGOptions; - -typedef struct BestCircle_struct { - PointFloat center; // The coordinate location of the center of the circle. - double radius; // The radius of the circle. - double area; // The area of the circle. - double perimeter; // The length of the perimeter of the circle. - double error; // Represents the least square error of the fitted circle to - // the entire set of points. -} BestCircle; - -typedef struct BestEllipse_struct { - PointFloat center; // The coordinate location of the center of the ellipse. - PointFloat majorAxisStart; // The coordinate location of the start of the - // major axis of the ellipse. - PointFloat majorAxisEnd; // The coordinate location of the end of the major - // axis of the ellipse. - PointFloat minorAxisStart; // The coordinate location of the start of the - // minor axis of the ellipse. - PointFloat minorAxisEnd; // The coordinate location of the end of the minor - // axis of the ellipse. - double area; // The area of the ellipse. - double perimeter; // The length of the perimeter of the ellipse. -} BestEllipse; - -typedef struct BestLine_struct { - PointFloat start; // The coordinate location of the start of the line. - PointFloat end; // The coordinate location of the end of the line. - LineEquation equation; // Defines the three coefficients of the equation of - // the best fit line. - int valid; // This element is TRUE if the function achieved the minimum score - // within the number of allowed refinement iterations and FALSE if - // the function did not achieve the minimum score. - double error; // Represents the least square error of the fitted line to the - // entire set of points. - int* pointsUsed; // An array of the indexes for the points array indicating - // which points the function used to fit the line. - int numPointsUsed; // The number of points the function used to fit the line. -} BestLine; - -typedef struct BrowserOptions_struct { - int width; // The width to make the browser. - int height; // The height to make the browser image. - int imagesPerLine; // The number of images to place on a single line. - RGBValue backgroundColor; // The background color of the browser. - int frameSize; // Specifies the number of pixels with which to border each - // thumbnail. - BrowserFrameStyle style; // The style for the frame around each thumbnail. - float ratio; // Specifies the width to height ratio of each thumbnail. - RGBValue focusColor; // The color to use to display focused cells. -} BrowserOptions; - -typedef struct CoordinateSystem_struct { - PointFloat origin; // The origin of the coordinate system. - float angle; // The angle, in degrees, of the x-axis of the coordinate system - // relative to the image x-axis. - AxisOrientation axisOrientation; // The direction of the y-axis of the - // coordinate reference system. -} CoordinateSystem; - -typedef struct CalibrationInfo_struct { - float* errorMap; // The error map for the calibration. - int mapColumns; // The number of columns in the error map. - int mapRows; // The number of rows in the error map. - ROI* userRoi; // Specifies the ROI the user provided when learning the - // calibration. - ROI* calibrationRoi; // Specifies the ROI that corresponds to the region of - // the image where the calibration information is - // accurate. - LearnCalibrationOptions options; // Specifies the calibration options the - // user provided when learning the - // calibration. - GridDescriptor grid; // Specifies the scaling constants for the image. - CoordinateSystem system; // Specifies the coordinate system for the real - // world coordinates. - RangeFloat range; // The range of the grayscale the function used to - // represent the circles in the grid image. - float quality; // The quality score of the learning process, which is a value - // between 0-1000. -} CalibrationInfo; - -typedef struct CalibrationPoints_struct { - PointFloat* pixelCoordinates; // The array of pixel coordinates. - PointFloat* realWorldCoordinates; // The array of corresponding real-world - // coordinates. - int numCoordinates; // The number of coordinates in both of the arrays. -} CalibrationPoints; - -typedef struct CaliperOptions_struct { - TwoEdgePolarityType - polarity; // Specifies the edge polarity of the edge pairs. - float separation; // The distance between edge pairs. - float separationDeviation; // Sets the range around the separation value. -} CaliperOptions; - -typedef struct CaliperReport_struct { - float edge1Contrast; // The contrast of the first edge. - PointFloat edge1Coord; // The coordinates of the first edge. - float edge2Contrast; // The contrast of the second edge. - PointFloat edge2Coord; // The coordinates of the second edge. - float separation; // The distance between the two edges. - float reserved; // This element is reserved. -} CaliperReport; - -typedef struct DrawTextOptions_struct { - char fontName[32]; // The font name to use. - int fontSize; // The size of the font. - int bold; // Set this parameter to TRUE to bold text. - int italic; // Set this parameter to TRUE to italicize text. - int underline; // Set this parameter to TRUE to underline text. - int strikeout; // Set this parameter to TRUE to strikeout text. - TextAlignment textAlignment; // Sets the alignment of text. - FontColor fontColor; // Sets the font color. -} DrawTextOptions; - -typedef struct CircleReport_struct { - Point center; // The coordinate point of the center of the circle. - int radius; // The radius of the circle, in pixels. - int area; // The area of the circle, in pixels. -} CircleReport; - -typedef struct ClosedContour_struct { - Point* points; // The points that make up the closed contour. - int numPoints; // The number of points in the array. -} ClosedContour; - -typedef struct ColorHistogramReport_struct { - HistogramReport plane1; // The histogram report of the first color plane. - HistogramReport plane2; // The histogram report of the second plane. - HistogramReport plane3; // The histogram report of the third plane. -} ColorHistogramReport; - -typedef struct ColorInformation_struct { - int infoCount; // The size of the info array. - int saturation; // The saturation level the function uses to learn the color - // information. - double* info; // An array of color information that represents the color - // spectrum analysis of a region of an image in a compact form. -} ColorInformation; - -typedef struct Complex_struct { - float r; // The real part of the value. - float i; // The imaginary part of the value. -} Complex; - -typedef struct ConcentricRakeReport_struct { - ArcInfo* rakeArcs; // An array containing the location of each concentric arc - // line used for edge detection. - int numArcs; // The number of arc lines in the rakeArcs array. - PointFloat* firstEdges; // The coordinate location of all edges detected as - // first edges. - int numFirstEdges; // The number of points in the first edges array. - PointFloat* lastEdges; // The coordinate location of all edges detected as - // last edges. - int numLastEdges; // The number of points in the last edges array. - EdgeLocationReport* allEdges; // An array of reports describing the location - // of the edges located by each concentric rake - // arc line. - int* linesWithEdges; // An array of indices into the rakeArcs array - // indicating the concentric rake arc lines on which the - // function detected at least one edge. - int numLinesWithEdges; // The number of concentric rake arc lines along which - // the function detected edges. -} ConcentricRakeReport; - -typedef struct ConstructROIOptions_struct { - int windowNumber; // The window number of the image window. - const char* windowTitle; // Specifies the message string that the function - // displays in the title bar of the window. - PaletteType type; // The palette type to use. - RGBValue* palette; // If type is IMAQ_PALETTE_USER, this array is the palette - // of colors to use with the window. - int numColors; // If type is IMAQ_PALETTE_USER, this element is the number of - // colors in the palette array. -} ConstructROIOptions; - -typedef struct ContourInfo_struct { - ContourType type; // The contour type. - unsigned numPoints; // The number of points that make up the contour. - Point* points; // The points describing the contour. - RGBValue contourColor; // The contour color. -} ContourInfo; - -typedef union ContourUnion_union { - Point* point; // Use this member when the contour is of type IMAQ_POINT. - Line* line; // Use this member when the contour is of type IMAQ_LINE. - Rect* rect; // Use this member when the contour is of type IMAQ_RECT. - Rect* ovalBoundingBox; // Use this member when the contour is of type - // IMAQ_OVAL. - ClosedContour* closedContour; // Use this member when the contour is of type - // IMAQ_CLOSED_CONTOUR. - OpenContour* openContour; // Use this member when the contour is of type - // IMAQ_OPEN_CONTOUR. - Annulus* annulus; // Use this member when the contour is of type - // IMAQ_ANNULUS. - RotatedRect* rotatedRect; // Use this member when the contour is of type - // IMAQ_ROTATED_RECT. -} ContourUnion; - -typedef struct ContourInfo2_struct { - ContourType type; // The contour type. - RGBValue color; // The contour color. - ContourUnion structure; // The information necessary to describe the contour - // in coordinate space. -} ContourInfo2; - -typedef struct ContourPoint_struct { - double x; // The x-coordinate value in the image. - double y; // The y-coordinate value in the image. - double curvature; // The change in slope at this edge point of the segment. - double xDisplacement; // The x displacement of the current edge pixel from a - // cubic spline fit of the current edge segment. - double yDisplacement; // The y displacement of the current edge pixel from a - // cubic spline fit of the current edge segment. -} ContourPoint; - -typedef struct CoordinateTransform_struct { - Point initialOrigin; // The origin of the initial coordinate system. - float initialAngle; // The angle, in degrees, of the x-axis of the initial - // coordinate system relative to the image x-axis. - Point finalOrigin; // The origin of the final coordinate system. - float finalAngle; // The angle, in degrees, of the x-axis of the final - // coordinate system relative to the image x-axis. -} CoordinateTransform; - -typedef struct CoordinateTransform2_struct { - CoordinateSystem - referenceSystem; // Defines the coordinate system for input coordinates. - CoordinateSystem measurementSystem; // Defines the coordinate system in which - // the function should perform - // measurements. -} CoordinateTransform2; - -typedef struct CannyOptions_struct { - float sigma; // The sigma of the Gaussian smoothing filter that the function - // applies to the image before edge detection. - float upperThreshold; // The upper fraction of pixel values in the image from - // which the function chooses a seed or starting point - // of an edge segment. - float lowerThreshold; // The function multiplies this value by upperThreshold - // to determine the lower threshold for all the pixels - // in an edge segment. - int windowSize; // The window size of the Gaussian filter that the function - // applies to the image. -} CannyOptions; - -typedef struct Range_struct { - int minValue; // The minimum value of the range. - int maxValue; // The maximum value of the range. -} Range; - -typedef struct UserPointSymbol_struct { - int cols; // Number of columns in the symbol. - int rows; // Number of rows in the symbol. - int* pixels; // The pixels of the symbol. -} UserPointSymbol; - -typedef struct View3DOptions_struct { - int sizeReduction; // A divisor the function uses when determining the final - // height and width of the 3D image. - int maxHeight; // Defines the maximum height of a pixel from the image source - // drawn in 3D. - Direction3D direction; // Defines the 3D orientation. - float alpha; // Determines the angle between the horizontal and the baseline. - float beta; // Determines the angle between the horizontal and the second - // baseline. - int border; // Defines the border size. - int background; // Defines the background color. - Plane3D plane; // Indicates the view a function uses to show complex images. -} View3DOptions; - -typedef struct MatchPatternOptions_struct { - MatchingMode mode; // Specifies the method to use when looking for the - // pattern in the image. - int minContrast; // Specifies the minimum contrast expected in the image. - int subpixelAccuracy; // Set this element to TRUE to return areas in the - // image that match the pattern area with subpixel - // accuracy. - RotationAngleRange* angleRanges; // An array of angle ranges, in degrees, - // where each range specifies how much you - // expect the pattern to be rotated in the - // image. - int numRanges; // Number of angle ranges in the angleRanges array. - int numMatchesRequested; // Number of valid matches expected. - int matchFactor; // Controls the number of potential matches that the - // function examines. - float minMatchScore; // The minimum score a match can have for the function - // to consider the match valid. -} MatchPatternOptions; - -typedef struct TIFFFileOptions_struct { - int rowsPerStrip; // Indicates the number of rows that the function writes - // per strip. - PhotometricMode - photoInterp; // Designates which photometric interpretation to use. - TIFFCompressionType compressionType; // Indicates the type of compression to - // use on the TIFF file. -} TIFFFileOptions; - -typedef union Color_union { - RGBValue rgb; // The information needed to describe a color in the RGB (Red, - // Green, and Blue) color space. - HSLValue hsl; // The information needed to describe a color in the HSL (Hue, - // Saturation, and Luminance) color space. - HSVValue hsv; // The information needed to describe a color in the HSI (Hue, - // Saturation, and Value) color space. - HSIValue hsi; // The information needed to describe a color in the HSI (Hue, - // Saturation, and Intensity) color space. - int rawValue; // The integer value for the data in the color union. -} Color; - -typedef union PixelValue_union { - float grayscale; // A grayscale pixel value. - RGBValue rgb; // A RGB pixel value. - HSLValue hsl; // A HSL pixel value. - Complex complex; // A complex pixel value. - RGBU64Value rgbu64; // An unsigned 64-bit RGB pixel value. -} PixelValue; - -typedef struct OpenContour_struct { - Point* points; // The points that make up the open contour. - int numPoints; // The number of points in the array. -} OpenContour; - -typedef struct OverlayTextOptions_struct { - const char* fontName; // The name of the font to use. - int fontSize; // The size of the font. - int bold; // Set this element to TRUE to bold the text. - int italic; // Set this element to TRUE to italicize the text. - int underline; // Set this element to TRUE to underline the text. - int strikeout; // Set this element to TRUE to strikeout the text. - TextAlignment horizontalTextAlignment; // Sets the alignment of the text. - VerticalTextAlignment - verticalTextAlignment; // Sets the vertical alignment for the text. - RGBValue backgroundColor; // Sets the color for the text background pixels. - double angle; // The counterclockwise angle, in degrees, of the text relative - // to the x-axis. -} OverlayTextOptions; - -typedef struct ParticleFilterCriteria_struct { - MeasurementValue parameter; // The morphological measurement that the - // function uses for filtering. - float lower; // The lower bound of the criteria range. - float upper; // The upper bound of the criteria range. - int exclude; // Set this element to TRUE to indicate that a match occurs when - // the value is outside the criteria range. -} ParticleFilterCriteria; - -typedef struct ParticleReport_struct { - int area; // The number of pixels in the particle. - float calibratedArea; // The size of the particle, calibrated to the - // calibration information of the image. - float perimeter; // The length of the perimeter, calibrated to the - // calibration information of the image. - int numHoles; // The number of holes in the particle. - int areaOfHoles; // The total surface area, in pixels, of all the holes in a - // particle. - float perimeterOfHoles; // The length of the perimeter of all the holes in - // the particle calibrated to the calibration - // information of the image. - Rect boundingBox; // The smallest rectangle that encloses the particle. - float sigmaX; // The sum of the particle pixels on the x-axis. - float sigmaY; // The sum of the particle pixels on the y-axis. - float sigmaXX; // The sum of the particle pixels on the x-axis, squared. - float sigmaYY; // The sum of the particle pixels on the y-axis, squared. - float sigmaXY; // The sum of the particle pixels on the x-axis and y-axis. - int longestLength; // The length of the longest horizontal line segment. - Point longestPoint; // The location of the leftmost pixel of the longest - // segment in the particle. - int projectionX; // The length of the particle when projected onto the - // x-axis. - int projectionY; // The length of the particle when projected onto the - // y-axis. - int connect8; // This element is TRUE if the function used connectivity-8 to - // determine if particles are touching. -} ParticleReport; - -typedef struct PatternMatch_struct { - PointFloat position; // The location of the center of the match. - float rotation; // The rotation of the match relative to the template image, - // in degrees. - float scale; // The size of the match relative to the size of the template - // image, expressed as a percentage. - float score; // The accuracy of the match. - PointFloat corner[4]; // An array of four points describing the rectangle - // surrounding the template image. -} PatternMatch; - -typedef struct QuantifyData_struct { - float mean; // The mean value of the pixel values. - float stdDev; // The standard deviation of the pixel values. - float min; // The smallest pixel value. - float max; // The largest pixel value. - float calibratedArea; // The area, calibrated to the calibration information - // of the image. - int pixelArea; // The area, in number of pixels. - float relativeSize; // The proportion, expressed as a percentage, of the - // associated region relative to the whole image. -} QuantifyData; - -typedef struct QuantifyReport_struct { - QuantifyData global; // Statistical data of the whole image. - QuantifyData* regions; // An array of QuantifyData structures containing - // statistical data of each region of the image. - int regionCount; // The number of regions. -} QuantifyReport; - -typedef struct RakeOptions_struct { - int threshold; // Specifies the threshold value for the contrast of the edge. - int width; // The number of pixels that the function averages to find the - // contrast at either side of the edge. - int steepness; // The span, in pixels, of the slope of the edge projected - // along the path specified by the input points. - int subsamplingRatio; // Specifies the number of pixels that separate two - // consecutive search lines. - InterpolationMethod subpixelType; // The method for interpolating. - int subpixelDivisions; // The number of samples the function obtains from a - // pixel. -} RakeOptions; - -typedef struct RakeReport_struct { - LineFloat* rakeLines; // The coordinate location of each of the rake lines - // used by the function. - int numRakeLines; // The number of lines in the rakeLines array. - PointFloat* firstEdges; // The coordinate location of all edges detected as - // first edges. - unsigned int numFirstEdges; // The number of points in the firstEdges array. - PointFloat* lastEdges; // The coordinate location of all edges detected as - // last edges. - unsigned int numLastEdges; // The number of points in the lastEdges array. - EdgeLocationReport* allEdges; // An array of reports describing the location - // of the edges located by each rake line. - int* linesWithEdges; // An array of indices into the rakeLines array - // indicating the rake lines on which the function - // detected at least one edge. - int numLinesWithEdges; // The number of rake lines along which the function - // detected edges. -} RakeReport; - -typedef struct TransformReport_struct { - PointFloat* points; // An array of transformed coordinates. - int* validPoints; // An array of values that describe the validity of each of - // the coordinates according to the region of interest you - // calibrated using either imaqLearnCalibrationGrid() or - // imaqLearnCalibrationPoints(). - int numPoints; // The length of both the points array and the validPoints - // array. -} TransformReport; - -typedef struct ShapeReport_struct { - Rect coordinates; // The bounding rectangle of the object. - Point centroid; // The coordinate location of the centroid of the object. - int size; // The size, in pixels, of the object. - double score; // A value ranging between 1 and 1,000 that specifies how - // similar the object in the image is to the template. -} ShapeReport; - -typedef struct MeterArc_struct { - PointFloat - needleBase; // The coordinate location of the base of the meter needle. - PointFloat* arcCoordPoints; // An array of points describing the coordinate - // location of the meter arc. - int numOfArcCoordPoints; // The number of points in the arcCoordPoints array. - int needleColor; // This element is TRUE when the meter has a light-colored - // needle on a dark background. -} MeterArc; - -typedef struct ThresholdData_struct { - float rangeMin; // The lower boundary of the range to keep. - float rangeMax; // The upper boundary of the range to keep. - float newValue; // If useNewValue is TRUE, newValue is the replacement value - // for pixels within the range. - int useNewValue; // If TRUE, the function sets pixel values within [rangeMin, - // rangeMax] to the value specified in newValue. -} ThresholdData; - -typedef struct StructuringElement_struct { - int matrixCols; // Number of columns in the matrix. - int matrixRows; // Number of rows in the matrix. - int hexa; // Set this element to TRUE if you specify a hexagonal structuring - // element in kernel. - int* kernel; // The values of the structuring element. -} StructuringElement; - -typedef struct SpokeReport_struct { - LineFloat* spokeLines; // The coordinate location of each of the spoke lines - // used by the function. - int numSpokeLines; // The number of lines in the spokeLines array. - PointFloat* firstEdges; // The coordinate location of all edges detected as - // first edges. - int numFirstEdges; // The number of points in the firstEdges array. - PointFloat* lastEdges; // The coordinate location of all edges detected as - // last edges. - int numLastEdges; // The number of points in the lastEdges array. - EdgeLocationReport* allEdges; // An array of reports describing the location - // of the edges located by each spoke line. - int* linesWithEdges; // An array of indices into the spokeLines array - // indicating the rake lines on which the function - // detected at least one edge. - int numLinesWithEdges; // The number of spoke lines along which the function - // detects edges. -} SpokeReport; - -typedef struct SimpleEdgeOptions_struct { - LevelType type; // Determines how the function evaluates the threshold and - // hysteresis values. - int threshold; // The pixel value at which an edge occurs. - int hysteresis; // A value that helps determine edges in noisy images. - EdgeProcess process; // Determines which edges the function looks for. - int subpixel; // Set this element to TRUE to find edges with subpixel - // accuracy by interpolating between points to find the - // crossing of the given threshold. -} SimpleEdgeOptions; - -typedef struct SelectParticleCriteria_struct { - MeasurementValue parameter; // The morphological measurement that the - // function uses for filtering. - float lower; // The lower boundary of the criteria range. - float upper; // The upper boundary of the criteria range. -} SelectParticleCriteria; - -typedef struct SegmentInfo_struct { - int numberOfPoints; // The number of points in the segment. - int isOpen; // If TRUE, the contour is open. - double weight; // The significance of the edge in terms of the gray values - // that constitute the edge. - ContourPoint* points; // The points of the segment. -} SegmentInfo; - -typedef struct RotationAngleRange_struct { - float lower; // The lowest amount of rotation, in degrees, a valid pattern - // can have. - float upper; // The highest amount of rotation, in degrees, a valid pattern - // can have. -} RotationAngleRange; - -typedef struct RotatedRect_struct { - int top; // Location of the top edge of the rectangle before rotation. - int left; // Location of the left edge of the rectangle before rotation. - int height; // Height of the rectangle. - int width; // Width of the rectangle. - double angle; // The rotation, in degrees, of the rectangle. -} RotatedRect; - -typedef struct ROIProfile_struct { - LineProfile report; // Quantifying information about the points along the - // edge of each contour in the ROI. - Point* pixels; // An array of the points along the edge of each contour in - // the ROI. -} ROIProfile; - -typedef struct ToolWindowOptions_struct { - int showSelectionTool; // If TRUE, the selection tool becomes visible. - int showZoomTool; // If TRUE, the zoom tool becomes visible. - int showPointTool; // If TRUE, the point tool becomes visible. - int showLineTool; // If TRUE, the line tool becomes visible. - int showRectangleTool; // If TRUE, the rectangle tool becomes visible. - int showOvalTool; // If TRUE, the oval tool becomes visible. - int showPolygonTool; // If TRUE, the polygon tool becomes visible. - int showClosedFreehandTool; // If TRUE, the closed freehand tool becomes - // visible. - int showPolyLineTool; // If TRUE, the polyline tool becomes visible. - int showFreehandTool; // If TRUE, the freehand tool becomes visible. - int showAnnulusTool; // If TRUE, the annulus becomes visible. - int showRotatedRectangleTool; // If TRUE, the rotated rectangle tool becomes - // visible. - int showPanTool; // If TRUE, the pan tool becomes visible. - int showZoomOutTool; // If TRUE, the zoom out tool becomes visible. - int reserved2; // This element is reserved and should be set to FALSE. - int reserved3; // This element is reserved and should be set to FALSE. - int reserved4; // This element is reserved and should be set to FALSE. -} ToolWindowOptions; - -typedef struct SpokeOptions_struct { - int threshold; // Specifies the threshold value for the contrast of the edge. - int width; // The number of pixels that the function averages to find the - // contrast at either side of the edge. - int steepness; // The span, in pixels, of the slope of the edge projected - // along the path specified by the input points. - double subsamplingRatio; // The angle, in degrees, between each radial search - // line in the spoke. - InterpolationMethod subpixelType; // The method for interpolating. - int subpixelDivisions; // The number of samples the function obtains from a - // pixel. -} SpokeOptions; - -#if !defined __GNUC__ && !defined _M_X64 -#pragma pack(pop) -#endif - -//============================================================================ -// Callback Function Type -//============================================================================ -#ifndef __GNUC__ -typedef void(IMAQ_CALLBACK* EventCallback)(WindowEventType event, - int windowNumber, Tool tool, - Rect rect); -#endif - -//============================================================================ -// Globals -//============================================================================ -#ifndef __GNUC__ -#pragma const_seg("IMAQVisionColorConstants") -#endif -static const RGBValue IMAQ_RGB_TRANSPARENT = {0, 0, 0, 1}; -static const RGBValue IMAQ_RGB_RED = {0, 0, 255, 0}; -static const RGBValue IMAQ_RGB_BLUE = {255, 0, 0, 0}; -static const RGBValue IMAQ_RGB_GREEN = {0, 255, 0, 0}; -static const RGBValue IMAQ_RGB_YELLOW = {0, 255, 255, 0}; -static const RGBValue IMAQ_RGB_WHITE = {255, 255, 255, 0}; -static const RGBValue IMAQ_RGB_BLACK = {0, 0, 0, 0}; -#ifndef __GNUC__ -#pragma const_seg() -#endif - -//============================================================================ -// Backwards Compatibility -//============================================================================ -typedef ColorSensitivity ColorComplexity; -#define IMAQ_COMPLEXITY_LOW IMAQ_SENSITIVITY_LOW -#define IMAQ_COMPLEXITY_MED IMAQ_SENSITIVITY_MED -#define IMAQ_COMPLEXITY_HIGH IMAQ_SENSITIVITY_HIGH -#define ERR_INVALID_COLORCOMPLEXITY ERR_INVALID_COLORSENSITIVITY - -//============================================================================ -// Logical functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqAnd(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqAndConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqCompare(Image* dest, const Image* source, - const Image* compareImage, - ComparisonFunction compare); -IMAQ_FUNC int IMAQ_STDCALL imaqCompareConstant(Image* dest, const Image* source, - PixelValue value, - ComparisonFunction compare); -IMAQ_FUNC int IMAQ_STDCALL -imaqLogicalDifference(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqLogicalDifferenceConstant(Image* dest, - const Image* source, - PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqNand(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqNandConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqNor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqNorConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqOr(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqOrConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqXnor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqXnorConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqXor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqXorConstant(Image* dest, const Image* source, PixelValue value); - -//============================================================================ -// Particle Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqCountParticles(Image* image, int connectivity8, int* numParticles); -IMAQ_FUNC int IMAQ_STDCALL -imaqMeasureParticle(Image* image, int particleNumber, int calibrated, - MeasurementType measurement, double* value); -IMAQ_FUNC MeasureParticlesReport* IMAQ_STDCALL -imaqMeasureParticles(Image* image, - MeasureParticlesCalibrationMode calibrationMode, - const MeasurementType* measurements, - size_t numMeasurements); -IMAQ_FUNC int IMAQ_STDCALL -imaqParticleFilter4(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, int criteriaCount, - const ParticleFilterOptions2* options, const ROI* roi, - int* numParticles); - -//============================================================================ -// Morphology functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqConvexHull(Image* dest, Image* source, int connectivity8); -IMAQ_FUNC int IMAQ_STDCALL imaqDanielssonDistance(Image* dest, Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqFillHoles(Image* dest, const Image* source, int connectivity8); -IMAQ_FUNC CircleReport* IMAQ_STDCALL -imaqFindCircles(Image* dest, Image* source, float minRadius, float maxRadius, - int* numCircles); -IMAQ_FUNC int IMAQ_STDCALL -imaqLabel2(Image* dest, Image* source, int connectivity8, int* particleCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqMorphology(Image* dest, Image* source, MorphologyMethod method, - const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL -imaqRejectBorder(Image* dest, Image* source, int connectivity8); -IMAQ_FUNC int IMAQ_STDCALL imaqSegmentation(Image* dest, Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqSeparation(Image* dest, Image* source, int erosions, - const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL -imaqSimpleDistance(Image* dest, Image* source, - const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL -imaqSizeFilter(Image* dest, Image* source, int connectivity8, int erosions, - SizeType keepSize, const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL -imaqSkeleton(Image* dest, Image* source, SkeletonMethod method); - -//============================================================================ -// Acquisition functions -//============================================================================ -IMAQ_FUNC Image* IMAQ_STDCALL imaqCopyFromRing(SESSION_ID sessionID, - Image* image, int imageToCopy, - int* imageNumber, Rect rect); -IMAQ_FUNC Image* IMAQ_STDCALL imaqEasyAcquire(const char* interfaceName); -IMAQ_FUNC Image* IMAQ_STDCALL -imaqExtractFromRing(SESSION_ID sessionID, int imageToExtract, int* imageNumber); -IMAQ_FUNC Image* IMAQ_STDCALL -imaqGrab(SESSION_ID sessionID, Image* image, int immediate); -IMAQ_FUNC int IMAQ_STDCALL imaqReleaseImage(SESSION_ID sessionID); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupGrab(SESSION_ID sessionID, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupRing(SESSION_ID sessionID, Image** images, - int numImages, int skipCount, - Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupSequence(SESSION_ID sessionID, - Image** images, int numImages, - int skipCount, Rect rect); -IMAQ_FUNC Image* IMAQ_STDCALL -imaqSnap(SESSION_ID sessionID, Image* image, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqStartAcquisition(SESSION_ID sessionID); -IMAQ_FUNC int IMAQ_STDCALL imaqStopAcquisition(SESSION_ID sessionID); - -//============================================================================ -// Arithmetic functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqAbsoluteDifference(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqAbsoluteDifferenceConstant(Image* dest, - const Image* source, - PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqAdd(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqAddConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqAverage(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqAverageConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqDivide2(Image* dest, const Image* sourceA, - const Image* sourceB, - RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL imaqDivideConstant2(Image* dest, const Image* source, - PixelValue value, - RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL -imaqMax(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqMaxConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqMin(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqMinConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqModulo(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqModuloConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqMulDiv(Image* dest, const Image* sourceA, - const Image* sourceB, float value); -IMAQ_FUNC int IMAQ_STDCALL -imaqMultiply(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqMultiplyConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqSubtract(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL -imaqSubtractConstant(Image* dest, const Image* source, PixelValue value); - -//============================================================================ -// Caliper functions -//============================================================================ -IMAQ_FUNC CaliperReport* IMAQ_STDCALL -imaqCaliperTool(const Image* image, const Point* points, int numPoints, - const EdgeOptions* edgeOptions, - const CaliperOptions* caliperOptions, int* numEdgePairs); -IMAQ_FUNC ConcentricRakeReport2* IMAQ_STDCALL -imaqConcentricRake2(Image* image, ROI* roi, ConcentricRakeDirection direction, - EdgeProcess process, int stepSize, - EdgeOptions2* edgeOptions); -IMAQ_FUNC ExtremeReport* IMAQ_STDCALL -imaqDetectExtremes(const double* pixels, int numPixels, DetectionMode mode, - const DetectExtremesOptions* options, int* numExtremes); -IMAQ_FUNC int IMAQ_STDCALL -imaqDetectRotation(const Image* referenceImage, const Image* testImage, - PointFloat referenceCenter, PointFloat testCenter, - int radius, float precision, double* angle); -IMAQ_FUNC EdgeReport2* IMAQ_STDCALL -imaqEdgeTool4(Image* image, ROI* roi, EdgeProcess processType, - EdgeOptions2* edgeOptions, const unsigned int reverseDirection); -IMAQ_FUNC FindEdgeReport* IMAQ_STDCALL -imaqFindEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, - const CoordinateSystem* newSystem, - const FindEdgeOptions2* findEdgeOptions, - const StraightEdgeOptions* straightEdgeOptions); -IMAQ_FUNC int IMAQ_STDCALL -imaqFindTransformRect2(Image* image, const ROI* roi, FindTransformMode mode, - CoordinateSystem* baseSystem, - CoordinateSystem* newSystem, - const FindTransformRectOptions2* findTransformOptions, - const StraightEdgeOptions* straightEdgeOptions, - AxisReport* axisReport); -IMAQ_FUNC int IMAQ_STDCALL -imaqFindTransformRects2(Image* image, const ROI* primaryROI, - const ROI* secondaryROI, FindTransformMode mode, - CoordinateSystem* baseSystem, - CoordinateSystem* newSystem, - const FindTransformRectsOptions2* findTransformOptions, - const StraightEdgeOptions* primaryStraightEdgeOptions, - const StraightEdgeOptions* secondaryStraightEdgeOptions, - AxisReport* axisReport); -IMAQ_FUNC int IMAQ_STDCALL -imaqLineGaugeTool2(const Image* image, Point start, Point end, - LineGaugeMethod method, const EdgeOptions* edgeOptions, - const CoordinateTransform2* transform, float* distance); -IMAQ_FUNC RakeReport2* IMAQ_STDCALL -imaqRake2(Image* image, ROI* roi, RakeDirection direction, EdgeProcess process, - int stepSize, EdgeOptions2* edgeOptions); -IMAQ_FUNC PointFloat* IMAQ_STDCALL -imaqSimpleEdge(const Image* image, const Point* points, int numPoints, - const SimpleEdgeOptions* options, int* numEdges); -IMAQ_FUNC SpokeReport2* IMAQ_STDCALL -imaqSpoke2(Image* image, ROI* roi, SpokeDirection direction, - EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions); -IMAQ_FUNC StraightEdgeReport2* IMAQ_STDCALL -imaqStraightEdge(const Image* image, const ROI* roi, - SearchDirection searchDirection, - const EdgeOptions2* edgeOptions, - const StraightEdgeOptions* straightEdgeOptions); -IMAQ_FUNC StraightEdgeReport2* IMAQ_STDCALL -imaqStraightEdge2(const Image* image, const ROI* roi, - SearchDirection searchDirection, - const EdgeOptions2* edgeOptions, - const StraightEdgeOptions* straightEdgeOptions, - unsigned int optimizedMode); - -//============================================================================ -// Spatial Filters functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCannyEdgeFilter(Image* dest, const Image* source, - const CannyOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqConvolve2(Image* dest, Image* source, float* kernel, int matrixRows, - int matrixCols, float normalize, Image* mask, - RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL imaqCorrelate(Image* dest, Image* source, - const Image* templateImage, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqEdgeFilter(Image* dest, Image* source, - OutlineMethod method, - const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqLowPass(Image* dest, Image* source, int width, - int height, float tolerance, - const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqMedianFilter(Image* dest, Image* source, - int width, int height, - const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqNthOrderFilter(Image* dest, Image* source, - int width, int height, int n, - const Image* mask); - -//============================================================================ -// Drawing functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqDrawLineOnImage(Image* dest, const Image* source, - DrawMode mode, Point start, - Point end, float newPixelValue); -IMAQ_FUNC int IMAQ_STDCALL -imaqDrawShapeOnImage(Image* dest, const Image* source, Rect rect, DrawMode mode, - ShapeMode shape, float newPixelValue); -IMAQ_FUNC int IMAQ_STDCALL imaqDrawTextOnImage(Image* dest, const Image* source, - Point coord, const char* text, - const DrawTextOptions* options, - int* fontNameUsed); - -//============================================================================ -// Interlacing functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqInterlaceCombine(Image* frame, const Image* odd, const Image* even); -IMAQ_FUNC int IMAQ_STDCALL -imaqInterlaceSeparate(const Image* frame, Image* odd, Image* even); - -//============================================================================ -// Image Information functions -//============================================================================ -IMAQ_FUNC char** IMAQ_STDCALL -imaqEnumerateCustomKeys(const Image* image, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetBitDepth(const Image* image, unsigned int* bitDepth); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetBytesPerPixel(const Image* image, int* byteCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetImageInfo(const Image* image, ImageInfo* info); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetImageSize(const Image* image, int* width, int* height); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetImageType(const Image* image, ImageType* type); -IMAQ_FUNC int IMAQ_STDCALL imaqGetMaskOffset(const Image* image, Point* offset); -IMAQ_FUNC void* IMAQ_STDCALL -imaqGetPixelAddress(const Image* image, Point pixel); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetVisionInfoTypes(const Image* image, unsigned int* present); -IMAQ_FUNC int IMAQ_STDCALL imaqIsImageEmpty(const Image* image, int* empty); -IMAQ_FUNC void* IMAQ_STDCALL -imaqReadCustomData(const Image* image, const char* key, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL imaqRemoveCustomData(Image* image, const char* key); -IMAQ_FUNC int IMAQ_STDCALL -imaqRemoveVisionInfo2(const Image* image, unsigned int info); -IMAQ_FUNC int IMAQ_STDCALL imaqSetBitDepth(Image* image, unsigned int bitDepth); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetImageSize(Image* image, int width, int height); -IMAQ_FUNC int IMAQ_STDCALL imaqSetMaskOffset(Image* image, Point offset); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteCustomData(Image* image, const char* key, - const void* data, - unsigned int size); - -//============================================================================ -// Display functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAreToolsContextSensitive(int* sensitive); -IMAQ_FUNC int IMAQ_STDCALL imaqCloseWindow(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL -imaqDisplayImage(const Image* image, int windowNumber, int resize); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetLastKey(char* keyPressed, int* windowNumber, int* modifiers); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetSystemWindowHandle(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowCenterPos(int windowNumber, Point* centerPosition); -IMAQ_FUNC int IMAQ_STDCALL imaqSetToolContextSensitivity(int sensitive); -IMAQ_FUNC int IMAQ_STDCALL imaqShowWindow(int windowNumber, int visible); - -//============================================================================ -// Image Manipulation functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCast(Image* dest, const Image* source, - ImageType type, const float* lookup, - int shift); -IMAQ_FUNC int IMAQ_STDCALL -imaqCopyRect(Image* dest, const Image* source, Rect rect, Point destLoc); -IMAQ_FUNC int IMAQ_STDCALL imaqDuplicate(Image* dest, const Image* source); -IMAQ_FUNC void* IMAQ_STDCALL imaqFlatten(const Image* image, FlattenType type, - CompressionType compression, - int quality, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL -imaqFlip(Image* dest, const Image* source, FlipAxis axis); -IMAQ_FUNC int IMAQ_STDCALL -imaqMask(Image* dest, const Image* source, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqResample(Image* dest, const Image* source, - int newWidth, int newHeight, - InterpolationMethod method, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL -imaqRotate2(Image* dest, const Image* source, float angle, PixelValue fill, - InterpolationMethod method, int maintainSize); -IMAQ_FUNC int IMAQ_STDCALL imaqScale(Image* dest, const Image* source, - int xScale, int yScale, - ScalingMode scaleMode, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqShift(Image* dest, const Image* source, - int shiftX, int shiftY, PixelValue fill); -IMAQ_FUNC int IMAQ_STDCALL imaqTranspose(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqUnflatten(Image* image, const void* data, unsigned int size); -IMAQ_FUNC int IMAQ_STDCALL -imaqUnwrapImage(Image* dest, const Image* source, Annulus annulus, - RectOrientation orientation, InterpolationMethod method); -IMAQ_FUNC int IMAQ_STDCALL -imaqView3D(Image* dest, Image* source, const View3DOptions* options); - -//============================================================================ -// File I/O functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCloseAVI(AVISession session); -IMAQ_FUNC AVISession IMAQ_STDCALL -imaqCreateAVI(const char* fileName, const char* compressionFilter, int quality, - unsigned int framesPerSecond, unsigned int maxDataSize); -IMAQ_FUNC int IMAQ_STDCALL imaqGetAVIInfo(AVISession session, AVIInfo* info); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetFileInfo(const char* fileName, CalibrationUnit* calibrationUnit, - float* calibrationX, float* calibrationY, int* width, - int* height, ImageType* imageType); -IMAQ_FUNC FilterName* IMAQ_STDCALL imaqGetFilterNames(int* numFilters); -IMAQ_FUNC char** IMAQ_STDCALL -imaqLoadImagePopup(const char* defaultDirectory, const char* defaultFileSpec, - const char* fileTypeList, const char* title, - int allowMultiplePaths, ButtonLabel buttonLabel, - int restrictDirectory, int restrictExtension, - int allowCancel, int allowMakeDirectory, int* cancelled, - int* numPaths); -IMAQ_FUNC AVISession IMAQ_STDCALL imaqOpenAVI(const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL imaqReadAVIFrame(Image* image, AVISession session, - unsigned int frameNum, void* data, - unsigned int* dataSize); -IMAQ_FUNC int IMAQ_STDCALL imaqReadFile(Image* image, const char* fileName, - RGBValue* colorTable, int* numColors); -IMAQ_FUNC int IMAQ_STDCALL -imaqReadVisionFile(Image* image, const char* fileName, RGBValue* colorTable, - int* numColors); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteAVIFrame(Image* image, AVISession session, - const void* data, - unsigned int dataLength); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteBMPFile(const Image* image, - const char* fileName, int compress, - const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteFile(const Image* image, - const char* fileName, - const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL -imaqWriteJPEGFile(const Image* image, const char* fileName, - unsigned int quality, void* colorTable); -IMAQ_FUNC int IMAQ_STDCALL -imaqWriteJPEG2000File(const Image* image, const char* fileName, int lossless, - float compressionRatio, - const JPEG2000FileAdvancedOptions* advancedOptions, - const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL -imaqWritePNGFile2(const Image* image, const char* fileName, - unsigned int compressionSpeed, const RGBValue* colorTable, - int useBitDepth); -IMAQ_FUNC int IMAQ_STDCALL -imaqWriteTIFFFile(const Image* image, const char* fileName, - const TIFFFileOptions* options, const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteVisionFile(const Image* image, - const char* fileName, - const RGBValue* colorTable); - -//============================================================================ -// Analytic Geometry functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqBuildCoordinateSystem(const Point* points, ReferenceMode mode, - AxisOrientation orientation, - CoordinateSystem* system); -IMAQ_FUNC BestCircle2* IMAQ_STDCALL -imaqFitCircle2(const PointFloat* points, int numPoints, - const FitCircleOptions* options); -IMAQ_FUNC BestEllipse2* IMAQ_STDCALL -imaqFitEllipse2(const PointFloat* points, int numPoints, - const FitEllipseOptions* options); -IMAQ_FUNC BestLine* IMAQ_STDCALL imaqFitLine(const PointFloat* points, - int numPoints, - const FitLineOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqGetAngle(PointFloat start1, PointFloat end1, - PointFloat start2, PointFloat end2, - float* angle); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetBisectingLine(PointFloat start1, PointFloat end1, PointFloat start2, - PointFloat end2, PointFloat* bisectStart, - PointFloat* bisectEnd); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetDistance(PointFloat point1, PointFloat point2, float* distance); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetIntersection(PointFloat start1, PointFloat end1, PointFloat start2, - PointFloat end2, PointFloat* intersection); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetMidLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point, - PointFloat* midLineStart, PointFloat* midLineEnd); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetPerpendicularLine(PointFloat refLineStart, PointFloat refLineEnd, - PointFloat point, PointFloat* perpLineStart, - PointFloat* perpLineEnd, double* distance); -IMAQ_FUNC SegmentInfo* IMAQ_STDCALL -imaqGetPointsOnContour(const Image* image, int* numSegments); -IMAQ_FUNC Point* IMAQ_STDCALL -imaqGetPointsOnLine(Point start, Point end, int* numPoints); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetPolygonArea(const PointFloat* points, int numPoints, float* area); -IMAQ_FUNC float* IMAQ_STDCALL -imaqInterpolatePoints(const Image* image, const Point* points, int numPoints, - InterpolationMethod method, int subpixel, - int* interpCount); - -//============================================================================ -// Clipboard functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClipboardToImage(Image* dest, RGBValue* palette); -IMAQ_FUNC int IMAQ_STDCALL -imaqImageToClipboard(const Image* image, const RGBValue* palette); - -//============================================================================ -// Border functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqFillBorder(Image* image, BorderMethod method); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetBorderSize(const Image* image, int* borderSize); -IMAQ_FUNC int IMAQ_STDCALL imaqSetBorderSize(Image* image, int size); - -//============================================================================ -// Image Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqArrayToImage(Image* image, const void* array, int numCols, int numRows); -IMAQ_FUNC Image* IMAQ_STDCALL imaqCreateImage(ImageType type, int borderSize); -IMAQ_FUNC void* IMAQ_STDCALL -imaqImageToArray(const Image* image, Rect rect, int* columns, int* rows); - -//============================================================================ -// Color Processing functions -//============================================================================ -IMAQ_FUNC Color2 IMAQ_STDCALL -imaqChangeColorSpace2(const Color2* sourceColor, ColorMode sourceSpace, - ColorMode destSpace, double offset, - const CIEXYZValue* whiteReference); -IMAQ_FUNC int IMAQ_STDCALL -imaqColorBCGTransform(Image* dest, const Image* source, - const BCGOptions* redOptions, - const BCGOptions* greenOptions, - const BCGOptions* blueOptions, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqColorEqualize(Image* dest, const Image* source, int colorEqualization); -IMAQ_FUNC ColorHistogramReport* IMAQ_STDCALL -imaqColorHistogram2(Image* image, int numClasses, ColorMode mode, - const CIEXYZValue* whiteReference, Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqColorLookup(Image* dest, const Image* source, ColorMode mode, - const Image* mask, const short* plane1, const short* plane2, - const short* plane3); -IMAQ_FUNC int IMAQ_STDCALL -imaqColorThreshold(Image* dest, const Image* source, int replaceValue, - ColorMode mode, const Range* plane1Range, - const Range* plane2Range, const Range* plane3Range); -IMAQ_FUNC SupervisedColorSegmentationReport* IMAQ_STDCALL -imaqSupervisedColorSegmentation(ClassifierSession* session, Image* labelImage, - const Image* srcImage, const ROI* roi, - const ROILabel* labelIn, - unsigned int numLabelIn, int maxDistance, - int minIdentificationScore, - const ColorSegmenationOptions* segmentOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqGetColorSegmentationMaxDistance( - ClassifierSession* session, const ColorSegmenationOptions* segmentOptions, - SegmentationDistanceLevel distLevel, int* maxDistance); - -//============================================================================ -// Transform functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqBCGTransform(Image* dest, const Image* source, - const BCGOptions* options, - const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqEqualize(Image* dest, const Image* source, - float min, float max, - const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqInverse(Image* dest, const Image* source, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqMathTransform(Image* dest, const Image* source, - MathTransformMethod method, - float rangeMin, float rangeMax, - float power, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqWatershedTransform(Image* dest, const Image* source, int connectivity8, - int* zoneCount); -IMAQ_FUNC int IMAQ_STDCALL imaqLookup2(Image* dest, const Image* source, - const int* table, const Image* mask); - -//============================================================================ -// Window Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqAreScrollbarsVisible(int windowNumber, int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqBringWindowToTop(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqGetMousePos(Point* position, int* windowNumber); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowBackground(int windowNumber, WindowBackgroundFillStyle* fillStyle, - WindowBackgroundHatchStyle* hatchStyle, - RGBValue* fillColor, RGBValue* backgroundColor); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowDisplayMapping(int windowNum, DisplayMapping* mapping); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowGrid(int windowNumber, int* xResolution, int* yResolution); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowHandle(int* handle); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowPos(int windowNumber, Point* position); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowSize(int windowNumber, int* width, int* height); -IMAQ_FUNC char* IMAQ_STDCALL imaqGetWindowTitle(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowZoom2(int windowNumber, float* xZoom, float* yZoom); -IMAQ_FUNC int IMAQ_STDCALL -imaqIsWindowNonTearing(int windowNumber, int* nonTearing); -IMAQ_FUNC int IMAQ_STDCALL imaqIsWindowVisible(int windowNumber, int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqMoveWindow(int windowNumber, Point position); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupWindow(int windowNumber, int configuration); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowBackground(int windowNumber, WindowBackgroundFillStyle fillStyle, - WindowBackgroundHatchStyle hatchStyle, - const RGBValue* fillColor, - const RGBValue* backgroundColor); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowDisplayMapping(int windowNumber, const DisplayMapping* mapping); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowGrid(int windowNumber, int xResolution, int yResolution); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowMaxContourCount(int windowNumber, unsigned int maxContourCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowNonTearing(int windowNumber, int nonTearing); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowPalette(int windowNumber, PaletteType type, - const RGBValue* palette, int numColors); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowSize(int windowNumber, int width, int height); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowThreadPolicy(WindowThreadPolicy policy); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowTitle(int windowNumber, const char* title); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowZoomToFit(int windowNumber, int zoomToFit); -IMAQ_FUNC int IMAQ_STDCALL imaqShowScrollbars(int windowNumber, int visible); -IMAQ_FUNC int IMAQ_STDCALL -imaqZoomWindow2(int windowNumber, float xZoom, float yZoom, Point center); - -//============================================================================ -// Utilities functions -//============================================================================ -IMAQ_FUNC const float* IMAQ_STDCALL -imaqGetKernel(KernelFamily family, int size, int number); -IMAQ_FUNC Annulus IMAQ_STDCALL -imaqMakeAnnulus(Point center, int innerRadius, int outerRadius, - double startAngle, double endAngle); -IMAQ_FUNC Point IMAQ_STDCALL imaqMakePoint(int xCoordinate, int yCoordinate); -IMAQ_FUNC PointFloat IMAQ_STDCALL -imaqMakePointFloat(float xCoordinate, float yCoordinate); -IMAQ_FUNC Rect IMAQ_STDCALL -imaqMakeRect(int top, int left, int height, int width); -IMAQ_FUNC Rect IMAQ_STDCALL -imaqMakeRectFromRotatedRect(RotatedRect rotatedRect); -IMAQ_FUNC RotatedRect IMAQ_STDCALL -imaqMakeRotatedRect(int top, int left, int height, int width, double angle); -IMAQ_FUNC RotatedRect IMAQ_STDCALL imaqMakeRotatedRectFromRect(Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqMulticoreOptions(MulticoreOperation operation, - unsigned int* customNumCores); - -//============================================================================ -// Tool Window functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCloseToolWindow(void); -IMAQ_FUNC int IMAQ_STDCALL imaqGetCurrentTool(Tool* currentTool); -IMAQ_FUNC int IMAQ_STDCALL imaqGetLastEvent(WindowEventType* type, - int* windowNumber, Tool* tool, - Rect* rect); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetToolWindowHandle(void); -IMAQ_FUNC int IMAQ_STDCALL imaqGetToolWindowPos(Point* position); -IMAQ_FUNC int IMAQ_STDCALL imaqIsToolWindowVisible(int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqMoveToolWindow(Point position); -IMAQ_FUNC int IMAQ_STDCALL imaqSetCurrentTool(Tool currentTool); -#ifndef __GNUC__ -IMAQ_FUNC int IMAQ_STDCALL -imaqSetEventCallback(EventCallback callback, int synchronous); -#endif -IMAQ_FUNC int IMAQ_STDCALL imaqSetToolColor(const RGBValue* color); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetupToolWindow(int showCoordinates, int maxIconsPerLine, - const ToolWindowOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqShowToolWindow(int visible); - -//============================================================================ -// Meter functions -//============================================================================ -IMAQ_FUNC MeterArc* IMAQ_STDCALL -imaqGetMeterArc(int lightNeedle, MeterArcMode mode, const ROI* roi, - PointFloat base, PointFloat start, PointFloat end); -IMAQ_FUNC int IMAQ_STDCALL -imaqReadMeter(const Image* image, const MeterArc* arcInfo, double* percentage, - PointFloat* endOfNeedle); - -//============================================================================ -// Calibration functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqCopyCalibrationInfo2(Image* dest, Image* source, Point offset); -IMAQ_FUNC int IMAQ_STDCALL -imaqCorrectCalibratedImage(Image* dest, const Image* source, PixelValue fill, - InterpolationMethod method, const ROI* roi); -IMAQ_FUNC CalibrationInfo* IMAQ_STDCALL -imaqGetCalibrationInfo2(const Image* image); -IMAQ_FUNC CalibrationInfo* IMAQ_STDCALL -imaqGetCalibrationInfo3(Image* image, unsigned int isGetErrorMap); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnCalibrationGrid(Image* image, const ROI* roi, - const LearnCalibrationOptions* options, - const GridDescriptor* grid, - const CoordinateSystem* system, - const RangeFloat* range, float* quality); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnCalibrationPoints(Image* image, const CalibrationPoints* points, - const ROI* roi, - const LearnCalibrationOptions* options, - const GridDescriptor* grid, - const CoordinateSystem* system, float* quality); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetCoordinateSystem(Image* image, const CoordinateSystem* system); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetSimpleCalibration(Image* image, ScalingMethod method, int learnTable, - const GridDescriptor* grid, - const CoordinateSystem* system); -IMAQ_FUNC TransformReport* IMAQ_STDCALL -imaqTransformPixelToRealWorld(const Image* image, - const PointFloat* pixelCoordinates, - int numCoordinates); -IMAQ_FUNC TransformReport* IMAQ_STDCALL -imaqTransformRealWorldToPixel(const Image* image, - const PointFloat* realWorldCoordinates, - int numCoordinates); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetSimpleCalibration2(Image* image, const GridDescriptor* gridDescriptor); -IMAQ_FUNC int IMAQ_STDCALL -imaqCalibrationSetAxisInfo(Image* image, CoordinateSystem* axisInfo); -IMAQ_FUNC int IMAQ_STDCALL -imaqCalibrationGetThumbnailImage(Image* templateImage, Image* image, - CalibrationThumbnailType type, - unsigned int index); -IMAQ_FUNC GetCalibrationInfoReport* IMAQ_STDCALL -imaqCalibrationGetCalibrationInfo(Image* image, unsigned int isGetErrorMap); -IMAQ_FUNC GetCameraParametersReport* IMAQ_STDCALL -imaqCalibrationGetCameraParameters(Image* templateImage); -IMAQ_FUNC int IMAQ_STDCALL imaqCalibrationCompactInformation(Image* image); - -//============================================================================ -// Pixel Manipulation functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqArrayToComplexPlane(Image* dest, const Image* source, - const float* newPixels, ComplexPlane plane); -IMAQ_FUNC float* IMAQ_STDCALL -imaqComplexPlaneToArray(const Image* image, ComplexPlane plane, Rect rect, - int* rows, int* columns); -IMAQ_FUNC int IMAQ_STDCALL imaqExtractColorPlanes(const Image* image, - ColorMode mode, Image* plane1, - Image* plane2, Image* plane3); -IMAQ_FUNC int IMAQ_STDCALL -imaqExtractComplexPlane(Image* dest, const Image* source, ComplexPlane plane); -IMAQ_FUNC int IMAQ_STDCALL -imaqFillImage(Image* image, PixelValue value, const Image* mask); -IMAQ_FUNC void* IMAQ_STDCALL -imaqGetLine(const Image* image, Point start, Point end, int* numPoints); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetPixel(const Image* image, Point pixel, PixelValue* value); -IMAQ_FUNC int IMAQ_STDCALL -imaqReplaceColorPlanes(Image* dest, const Image* source, ColorMode mode, - const Image* plane1, const Image* plane2, - const Image* plane3); -IMAQ_FUNC int IMAQ_STDCALL -imaqReplaceComplexPlane(Image* dest, const Image* source, - const Image* newValues, ComplexPlane plane); -IMAQ_FUNC int IMAQ_STDCALL imaqSetLine(Image* image, const void* array, - int arraySize, Point start, Point end); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetPixel(Image* image, Point coord, PixelValue value); - -//============================================================================ -// Color Matching functions -//============================================================================ -IMAQ_FUNC ColorInformation* IMAQ_STDCALL -imaqLearnColor(const Image* image, const ROI* roi, ColorSensitivity sensitivity, - int saturation); -IMAQ_FUNC int* IMAQ_STDCALL imaqMatchColor(const Image* image, - const ColorInformation* info, - const ROI* roi, int* numScores); - -//============================================================================ -// Frequency Domain Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqAttenuate(Image* dest, const Image* source, AttenuateMode highlow); -IMAQ_FUNC int IMAQ_STDCALL imaqConjugate(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqFFT(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqFlipFrequencies(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqInverseFFT(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqTruncate(Image* dest, const Image* source, - TruncateMode highlow, - float ratioToKeep); - -//============================================================================ -// Barcode I/O functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqGradeDataMatrixBarcodeAIM(const Image* image, AIMGradeReport* report); -IMAQ_FUNC BarcodeInfo* IMAQ_STDCALL -imaqReadBarcode(const Image* image, BarcodeType type, const ROI* roi, - int validate); -IMAQ_FUNC DataMatrixReport* IMAQ_STDCALL imaqReadDataMatrixBarcode2( - Image* image, const ROI* roi, DataMatrixGradingMode prepareForGrading, - const DataMatrixDescriptionOptions* descriptionOptions, - const DataMatrixSizeOptions* sizeOptions, - const DataMatrixSearchOptions* searchOptions); -IMAQ_FUNC Barcode2DInfo* IMAQ_STDCALL -imaqReadPDF417Barcode(const Image* image, const ROI* roi, - Barcode2DSearchMode searchMode, - unsigned int* numBarcodes); -IMAQ_FUNC QRCodeReport* IMAQ_STDCALL -imaqReadQRCode(Image* image, const ROI* roi, QRGradingMode reserved, - const QRCodeDescriptionOptions* descriptionOptions, - const QRCodeSizeOptions* sizeOptions, - const QRCodeSearchOptions* searchOptions); - -//============================================================================ -// LCD functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqFindLCDSegments(ROI* roi, const Image* image, const LCDOptions* options); -IMAQ_FUNC LCDReport* IMAQ_STDCALL -imaqReadLCD(const Image* image, const ROI* roi, const LCDOptions* options); - -//============================================================================ -// Shape Matching functions -//============================================================================ -IMAQ_FUNC ShapeReport* IMAQ_STDCALL -imaqMatchShape(Image* dest, Image* source, const Image* templateImage, - int scaleInvariant, int connectivity8, double tolerance, - int* numMatches); - -//============================================================================ -// Contours functions -//============================================================================ -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddAnnulusContour(ROI* roi, Annulus annulus); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddClosedContour(ROI* roi, const Point* points, int numPoints); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddLineContour(ROI* roi, Point start, Point end); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddOpenContour(ROI* roi, const Point* points, int numPoints); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddOvalContour(ROI* roi, Rect boundingBox); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddPointContour(ROI* roi, Point point); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddRectContour(ROI* roi, Rect rect); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddRotatedRectContour2(ROI* roi, RotatedRect rect); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqCopyContour(ROI* destRoi, const ROI* sourceRoi, ContourID id); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqGetContour(const ROI* roi, unsigned int index); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetContourColor(const ROI* roi, ContourID id, RGBValue* contourColor); -IMAQ_FUNC int IMAQ_STDCALL imaqGetContourCount(const ROI* roi); -IMAQ_FUNC ContourInfo2* IMAQ_STDCALL -imaqGetContourInfo2(const ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL -imaqMoveContour(ROI* roi, ContourID id, int deltaX, int deltaY); -IMAQ_FUNC int IMAQ_STDCALL imaqRemoveContour(ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetContourColor(ROI* roi, ContourID id, const RGBValue* color); - -//============================================================================ -// Regions of Interest functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqConstructROI2(const Image* image, ROI* roi, Tool initialTool, - const ToolWindowOptions* tools, - const ConstructROIOptions2* options, int* okay); -IMAQ_FUNC ROI* IMAQ_STDCALL imaqCreateROI(void); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetROIBoundingBox(const ROI* roi, Rect* boundingBox); -IMAQ_FUNC int IMAQ_STDCALL imaqGetROIColor(const ROI* roi, RGBValue* roiColor); -IMAQ_FUNC ROI* IMAQ_STDCALL imaqGetWindowROI(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqSetROIColor(ROI* roi, const RGBValue* color); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowROI(int windowNumber, const ROI* roi); - -//============================================================================ -// Image Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqCentroid(const Image* image, PointFloat* centroid, const Image* mask); -IMAQ_FUNC Curve* IMAQ_STDCALL -imaqExtractCurves(const Image* image, const ROI* roi, - const CurveOptions* curveOptions, unsigned int* numCurves); -IMAQ_FUNC HistogramReport* IMAQ_STDCALL -imaqHistogram(const Image* image, int numClasses, float min, float max, - const Image* mask); -IMAQ_FUNC LinearAverages* IMAQ_STDCALL -imaqLinearAverages2(Image* image, LinearAveragesMode mode, Rect rect); -IMAQ_FUNC LineProfile* IMAQ_STDCALL -imaqLineProfile(const Image* image, Point start, Point end); -IMAQ_FUNC QuantifyReport* IMAQ_STDCALL -imaqQuantify(const Image* image, const Image* mask); - -//============================================================================ -// Error Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClearError(void); -IMAQ_FUNC char* IMAQ_STDCALL imaqGetErrorText(int errorCode); -IMAQ_FUNC int IMAQ_STDCALL imaqGetLastError(void); -IMAQ_FUNC const char* IMAQ_STDCALL imaqGetLastErrorFunc(void); -IMAQ_FUNC int IMAQ_STDCALL imaqSetError(int errorCode, const char* function); - -//============================================================================ -// Threshold functions -//============================================================================ -IMAQ_FUNC ThresholdData* IMAQ_STDCALL -imaqAutoThreshold2(Image* dest, const Image* source, int numClasses, - ThresholdMethod method, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqLocalThreshold(Image* dest, const Image* source, unsigned int windowWidth, - unsigned int windowHeight, LocalThresholdMethod method, - double deviationWeight, ObjectType type, float replaceValue); -IMAQ_FUNC int IMAQ_STDCALL imaqMagicWand(Image* dest, const Image* source, - Point coord, float tolerance, - int connectivity8, float replaceValue); -IMAQ_FUNC int IMAQ_STDCALL imaqMultithreshold(Image* dest, const Image* source, - const ThresholdData* ranges, - int numRanges); -IMAQ_FUNC int IMAQ_STDCALL imaqThreshold(Image* dest, const Image* source, - float rangeMin, float rangeMax, - int useNewValue, float newValue); - -//============================================================================ -// Memory Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqDispose(void* object); - -//============================================================================ -// Pattern Matching functions -//============================================================================ -IMAQ_FUNC CircleMatch* IMAQ_STDCALL -imaqDetectCircles(const Image* image, const CircleDescriptor* circleDescriptor, - const CurveOptions* curveOptions, - const ShapeDetectionOptions* shapeDetectionOptions, - const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC EllipseMatch* IMAQ_STDCALL -imaqDetectEllipses(const Image* image, - const EllipseDescriptor* ellipseDescriptor, - const CurveOptions* curveOptions, - const ShapeDetectionOptions* shapeDetectionOptions, - const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC LineMatch* IMAQ_STDCALL -imaqDetectLines(const Image* image, const LineDescriptor* lineDescriptor, - const CurveOptions* curveOptions, - const ShapeDetectionOptions* shapeDetectionOptions, - const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC RectangleMatch* IMAQ_STDCALL -imaqDetectRectangles(const Image* image, - const RectangleDescriptor* rectangleDescriptor, - const CurveOptions* curveOptions, - const ShapeDetectionOptions* shapeDetectionOptions, - const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC FeatureData* IMAQ_STDCALL -imaqGetGeometricFeaturesFromCurves(const Curve* curves, unsigned int numCurves, - const FeatureType* featureTypes, - unsigned int numFeatureTypes, - unsigned int* numFeatures); -IMAQ_FUNC FeatureData* IMAQ_STDCALL -imaqGetGeometricTemplateFeatureInfo(const Image* pattern, - unsigned int* numFeatures); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnColorPattern(Image* image, const LearnColorPatternOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGeometricPattern( - Image* image, PointFloat originOffset, const CurveOptions* curveOptions, - const LearnGeometricPatternAdvancedOptions* advancedLearnOptions, - const Image* mask); -IMAQ_FUNC MultipleGeometricPattern* IMAQ_STDCALL -imaqLearnMultipleGeometricPatterns(const Image** patterns, - unsigned int numberOfPatterns, - const String255* labels); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnPattern3(Image* image, LearningMode learningMode, - LearnPatternAdvancedOptions* advancedOptions, - const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL -imaqMatchColorPattern(const Image* image, Image* pattern, - const MatchColorPatternOptions* options, Rect searchRect, - int* numMatches); -IMAQ_FUNC GeometricPatternMatch2* IMAQ_STDCALL imaqMatchGeometricPattern2( - const Image* image, const Image* pattern, const CurveOptions* curveOptions, - const MatchGeometricPatternOptions* matchOptions, - const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions, - const ROI* roi, int* numMatches); -IMAQ_FUNC GeometricPatternMatch2* IMAQ_STDCALL -imaqMatchMultipleGeometricPatterns( - const Image* image, const MultipleGeometricPattern* multiplePattern, - const ROI* roi, int* numMatches); -IMAQ_FUNC MultipleGeometricPattern* IMAQ_STDCALL -imaqReadMultipleGeometricPatternFile(const char* fileName, - String255 description); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL -imaqRefineMatches(const Image* image, const Image* pattern, - const PatternMatch* candidatesIn, int numCandidatesIn, - MatchPatternOptions* options, - MatchPatternAdvancedOptions* advancedOptions, - int* numCandidatesOut); -IMAQ_FUNC int IMAQ_STDCALL imaqSetMultipleGeometricPatternsOptions( - MultipleGeometricPattern* multiplePattern, const char* label, - const CurveOptions* curveOptions, - const MatchGeometricPatternOptions* matchOptions, - const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteMultipleGeometricPatternFile( - const MultipleGeometricPattern* multiplePattern, const char* fileName, - const char* description); -IMAQ_FUNC GeometricPatternMatch3* IMAQ_STDCALL imaqMatchGeometricPattern3( - const Image* image, const Image* pattern, const CurveOptions* curveOptions, - const MatchGeometricPatternOptions* matchOptions, - const MatchGeometricPatternAdvancedOptions3* advancedMatchOptions, - const ROI* roi, size_t* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGeometricPattern2( - Image* image, PointFloat originOffset, double angleOffset, - const CurveOptions* curveOptions, - const LearnGeometricPatternAdvancedOptions2* advancedLearnOptions, - const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL -imaqMatchPattern3(const Image* image, const Image* pattern, - const MatchPatternOptions* options, - const MatchPatternAdvancedOptions* advancedOptions, - const ROI* roi, int* numMatches); - -//============================================================================ -// Overlay functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClearOverlay(Image* image, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqCopyOverlay(Image* dest, const Image* source, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetOverlayProperties(const Image* image, const char* group, - TransformBehaviors* transformBehaviors); -IMAQ_FUNC int IMAQ_STDCALL -imaqMergeOverlay(Image* dest, const Image* source, const RGBValue* palette, - unsigned int numColors, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayArc(Image* image, const ArcInfo* arc, - const RGBValue* color, - DrawMode drawMode, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayBitmap(Image* image, Point destLoc, const RGBValue* bitmap, - unsigned int numCols, unsigned int numRows, - const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayClosedContour(Image* image, const Point* points, int numPoints, - const RGBValue* color, DrawMode drawMode, - const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayLine(Image* image, Point start, Point end, - const RGBValue* color, - const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayMetafile(Image* image, - const void* metafile, Rect rect, - const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayOpenContour(Image* image, const Point* points, int numPoints, - const RGBValue* color, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayOval(Image* image, Rect boundingBox, - const RGBValue* color, - DrawMode drawMode, char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayPoints(Image* image, const Point* points, int numPoints, - const RGBValue* colors, int numColors, PointSymbol symbol, - const UserPointSymbol* userSymbol, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayRect(Image* image, Rect rect, const RGBValue* color, - DrawMode drawMode, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayROI(Image* image, const ROI* roi, PointSymbol symbol, - const UserPointSymbol* userSymbol, const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqOverlayText(Image* image, Point origin, const char* text, - const RGBValue* color, const OverlayTextOptions* options, - const char* group); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetOverlayProperties(Image* image, const char* group, - TransformBehaviors* transformBehaviors); - -//============================================================================ -// OCR functions -//============================================================================ -IMAQ_FUNC CharSet* IMAQ_STDCALL imaqCreateCharSet(void); -IMAQ_FUNC int IMAQ_STDCALL imaqDeleteChar(CharSet* set, int index); -IMAQ_FUNC int IMAQ_STDCALL imaqGetCharCount(const CharSet* set); -IMAQ_FUNC CharInfo2* IMAQ_STDCALL -imaqGetCharInfo2(const CharSet* set, int index); -IMAQ_FUNC int IMAQ_STDCALL -imaqReadOCRFile(const char* fileName, CharSet* set, String255 setDescription, - ReadTextOptions* readOptions, - OCRProcessingOptions* processingOptions, - OCRSpacingOptions* spacingOptions); -IMAQ_FUNC ReadTextReport3* IMAQ_STDCALL -imaqReadText3(const Image* image, const CharSet* set, const ROI* roi, - const ReadTextOptions* readOptions, - const OCRProcessingOptions* processingOptions, - const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int IMAQ_STDCALL -imaqRenameChar(CharSet* set, int index, const char* newCharValue); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetReferenceChar(const CharSet* set, int index, int isReferenceChar); -IMAQ_FUNC int IMAQ_STDCALL -imaqTrainChars(const Image* image, CharSet* set, int index, - const char* charValue, const ROI* roi, - const OCRProcessingOptions* processingOptions, - const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int* IMAQ_STDCALL -imaqVerifyPatterns(const Image* image, const CharSet* set, - const String255* expectedPatterns, int patternCount, - const ROI* roi, int* numScores); -IMAQ_FUNC int* IMAQ_STDCALL -imaqVerifyText(const Image* image, const CharSet* set, - const char* expectedString, const ROI* roi, int* numScores); -IMAQ_FUNC int IMAQ_STDCALL -imaqWriteOCRFile(const char* fileName, const CharSet* set, - const char* setDescription, const ReadTextOptions* readOptions, - const OCRProcessingOptions* processingOptions, - const OCRSpacingOptions* spacingOptions); - -//============================================================================ -// Geometric Matching functions -//============================================================================ -IMAQ_FUNC ExtractContourReport* IMAQ_STDCALL -imaqExtractContour(Image* image, const ROI* roi, - ExtractContourDirection direction, - CurveParameters* curveParams, - const ConnectionConstraint* connectionConstraintParams, - unsigned int numOfConstraints, - ExtractContourSelection selection, Image* contourImage); -IMAQ_FUNC int IMAQ_STDCALL -imaqContourOverlay(Image* image, const Image* contourImage, - const ContourOverlaySettings* pointsSettings, - const ContourOverlaySettings* eqnSettings, - const char* groupName); -IMAQ_FUNC ContourComputeCurvatureReport* IMAQ_STDCALL -imaqContourComputeCurvature(const Image* contourImage, unsigned int kernel); -IMAQ_FUNC CurvatureAnalysisReport* IMAQ_STDCALL -imaqContourClassifyCurvature(const Image* contourImage, unsigned int kernel, - RangeLabel* curvatureClasses, - unsigned int numCurvatureClasses); -IMAQ_FUNC ComputeDistancesReport* IMAQ_STDCALL -imaqContourComputeDistances(const Image* targetImage, - const Image* templateImage, - const SetupMatchPatternData* matchSetupData, - unsigned int smoothingKernel); -IMAQ_FUNC ClassifyDistancesReport* IMAQ_STDCALL imaqContourClassifyDistances( - const Image* targetImage, const Image* templateImage, - const SetupMatchPatternData* matchSetupData, unsigned int smoothingKernel, - const RangeLabel* distanceRanges, unsigned int numDistanceRanges); -IMAQ_FUNC ContourInfoReport* IMAQ_STDCALL -imaqContourInfo(const Image* contourImage); -IMAQ_FUNC SetupMatchPatternData* IMAQ_STDCALL imaqContourSetupMatchPattern( - MatchMode* matchMode, unsigned int enableSubPixelAccuracy, - CurveParameters* curveParams, unsigned int useLearnCurveParameters, - const RangeSettingDouble* rangeSettings, unsigned int numRangeSettings); -IMAQ_FUNC int IMAQ_STDCALL imaqContourAdvancedSetupMatchPattern( - SetupMatchPatternData* matchSetupData, - GeometricAdvancedSetupDataOption* geometricOptions, - unsigned int numGeometricOptions); -IMAQ_FUNC ContourFitLineReport* IMAQ_STDCALL -imaqContourFitLine(Image* image, double pixelRadius); -IMAQ_FUNC PartialCircle* IMAQ_STDCALL -imaqContourFitCircle(Image* image, double pixelRadius, int rejectOutliers); -IMAQ_FUNC PartialEllipse* IMAQ_STDCALL -imaqContourFitEllipse(Image* image, double pixelRadius, int rejectOutliers); -IMAQ_FUNC ContourFitSplineReport* IMAQ_STDCALL -imaqContourFitSpline(Image* image, int degree, int numberOfControlPoints); -IMAQ_FUNC ContourFitPolynomialReport* IMAQ_STDCALL -imaqContourFitPolynomial(Image* image, int order); - -//============================================================================ -// Edge Detection functions -//============================================================================ -IMAQ_FUNC FindCircularEdgeReport* IMAQ_STDCALL -imaqFindCircularEdge2(Image* image, const ROI* roi, - const CoordinateSystem* baseSystem, - const CoordinateSystem* newSystem, - const FindCircularEdgeOptions* edgeOptions, - const CircleFitOptions* circleFitOptions); -IMAQ_FUNC FindConcentricEdgeReport* IMAQ_STDCALL imaqFindConcentricEdge2( - Image* image, const ROI* roi, const CoordinateSystem* baseSystem, - const CoordinateSystem* newSystem, - const FindConcentricEdgeOptions* edgeOptions, - const ConcentricEdgeFitOptions* concentricEdgeFitOptions); - -//============================================================================ -// Morphology Reconstruction functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqGrayMorphologyReconstruct(Image* dstImage, Image* srcImage, - const Image* markerImage, PointFloat* points, - int numOfPoints, - MorphologyReconstructOperation operation, - const StructuringElement* structuringElement, - const ROI* roi); -IMAQ_FUNC int IMAQ_STDCALL -imaqMorphologyReconstruct(Image* dstImage, Image* srcImage, - const Image* markerImage, PointFloat* points, - int numOfPoints, - MorphologyReconstructOperation operation, - Connectivity connectivity, const ROI* roi); - -//============================================================================ -// Texture functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqDetectTextureDefect(ClassifierSession* session, Image* destImage, - const Image* srcImage, const ROI* roi, - int initialStepSize, int finalStepSize, - unsigned char defectPixelValue, - double minClassificationScore); -IMAQ_FUNC int IMAQ_STDCALL imaqClassificationTextureDefectOptions( - ClassifierSession* session, WindowSize* windowOptions, - WaveletOptions* waveletOptions, void** bandsUsed, int* numBandsUsed, - CooccurrenceOptions* cooccurrenceOptions, unsigned char setOperation); -IMAQ_FUNC int IMAQ_STDCALL -imaqCooccurrenceMatrix(const Image* srcImage, const ROI* roi, int levelPixel, - const DisplacementVector* displacementVec, - void* featureOptionArray, - unsigned int featureOptionArraySize, - void** cooccurrenceMatrixArray, - int* coocurrenceMatrixRows, int* coocurrenceMatrixCols, - void** featureVectorArray, int* featureVectorArraySize); -IMAQ_FUNC ExtractTextureFeaturesReport* IMAQ_STDCALL -imaqExtractTextureFeatures(const Image* srcImage, const ROI* roi, - const WindowSize* windowOptions, - const WaveletOptions* waveletOptions, - void* waveletBands, unsigned int numWaveletBands, - const CooccurrenceOptions* cooccurrenceOptions, - unsigned char useWindow); -IMAQ_FUNC WaveletBandsReport* IMAQ_STDCALL -imaqExtractWaveletBands(const Image* srcImage, - const WaveletOptions* waveletOptions, - void* waveletBands, unsigned int numWaveletBands); - -//============================================================================ -// Regions of Interest Manipulation functions -//============================================================================ -IMAQ_FUNC ROI* IMAQ_STDCALL imaqMaskToROI(const Image* mask, int* withinLimit); -IMAQ_FUNC ROIProfile* IMAQ_STDCALL -imaqROIProfile(const Image* image, const ROI* roi); -IMAQ_FUNC int IMAQ_STDCALL imaqROIToMask(Image* mask, const ROI* roi, - int fillValue, const Image* imageModel, - int* inSpace); -IMAQ_FUNC int IMAQ_STDCALL imaqTransformROI2(ROI* roi, - const CoordinateSystem* baseSystem, - const CoordinateSystem* newSystem); -IMAQ_FUNC LabelToROIReport* IMAQ_STDCALL -imaqLabelToROI(const Image* image, const unsigned int* labelsIn, - unsigned int numLabelsIn, int maxNumVectors, - int isExternelEdges); - -//============================================================================ -// Morphology functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqGrayMorphology(Image* dest, Image* source, MorphologyMethod method, - const StructuringElement* structuringElement); - -//============================================================================ -// Classification functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqAddClassifierSample(Image* image, ClassifierSession* session, - const ROI* roi, const char* sampleClass, - double* featureVector, unsigned int vectorSize); -IMAQ_FUNC ClassifierReportAdvanced* IMAQ_STDCALL -imaqAdvanceClassify(Image* image, const ClassifierSession* session, - const ROI* roi, double* featureVector, - unsigned int vectorSize); -IMAQ_FUNC ClassifierReport* IMAQ_STDCALL -imaqClassify(Image* image, const ClassifierSession* session, const ROI* roi, - double* featureVector, unsigned int vectorSize); -IMAQ_FUNC ClassifierSession* IMAQ_STDCALL -imaqCreateClassifier(ClassifierType type); -IMAQ_FUNC int IMAQ_STDCALL -imaqDeleteClassifierSample(ClassifierSession* session, int index); -IMAQ_FUNC ClassifierAccuracyReport* IMAQ_STDCALL -imaqGetClassifierAccuracy(const ClassifierSession* session); -IMAQ_FUNC ClassifierSampleInfo* IMAQ_STDCALL -imaqGetClassifierSampleInfo(const ClassifierSession* session, int index, - int* numSamples); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetColorClassifierOptions(const ClassifierSession* session, - ColorOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetNearestNeighborOptions(const ClassifierSession* session, - NearestNeighborOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqGetParticleClassifierOptions2( - const ClassifierSession* session, - ParticleClassifierPreprocessingOptions2* preprocessingOptions, - ParticleClassifierOptions* options); -IMAQ_FUNC ClassifierSession* IMAQ_STDCALL -imaqReadClassifierFile(ClassifierSession* session, const char* fileName, - ReadClassifierFileMode mode, ClassifierType* type, - ClassifierEngineType* engine, String255 description); -IMAQ_FUNC int IMAQ_STDCALL -imaqRelabelClassifierSample(ClassifierSession* session, int index, - const char* newClass); -IMAQ_FUNC int IMAQ_STDCALL imaqSetParticleClassifierOptions2( - ClassifierSession* session, - const ParticleClassifierPreprocessingOptions2* preprocessingOptions, - const ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetColorClassifierOptions(ClassifierSession* session, - const ColorOptions* options); -IMAQ_FUNC NearestNeighborTrainingReport* IMAQ_STDCALL -imaqTrainNearestNeighborClassifier(ClassifierSession* session, - const NearestNeighborOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqWriteClassifierFile(const ClassifierSession* session, const char* fileName, - WriteClassifierFileMode mode, - const String255 description); - -//============================================================================ -// Measure Distances functions -//============================================================================ -IMAQ_FUNC ClampMax2Report* IMAQ_STDCALL -imaqClampMax2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, - const CoordinateSystem* newSystem, - const CurveOptions* curveSettings, - const ClampSettings* clampSettings, - const ClampOverlaySettings* clampOverlaySettings); - -//============================================================================ -// Inspection functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL -imaqCompareGoldenTemplate(const Image* image, const Image* goldenTemplate, - Image* brightDefects, Image* darkDefects, - const InspectionAlignment* alignment, - const InspectionOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGoldenTemplate(Image* goldenTemplate, - PointFloat originOffset, - const Image* mask); -//============================================================================ -// Obsolete functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqRotate(Image* dest, const Image* source, - float angle, PixelValue fill, - InterpolationMethod method); -IMAQ_FUNC int IMAQ_STDCALL -imaqWritePNGFile(const Image* image, const char* fileName, - unsigned int compressionSpeed, const RGBValue* colorTable); -IMAQ_FUNC ParticleReport* IMAQ_STDCALL -imaqSelectParticles(const Image* image, const ParticleReport* reports, - int reportCount, int rejectBorder, - const SelectParticleCriteria* criteria, int criteriaCount, - int* selectedCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqParticleFilter(Image* dest, Image* source, - const ParticleFilterCriteria* criteria, int criteriaCount, - int rejectMatches, int connectivity8); -IMAQ_FUNC ParticleReport* IMAQ_STDCALL -imaqGetParticleInfo(Image* image, int connectivity8, ParticleInfoMode mode, - int* reportCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqCalcCoeff(const Image* image, const ParticleReport* report, - MeasurementValue parameter, float* coefficient); -IMAQ_FUNC EdgeReport* IMAQ_STDCALL -imaqEdgeTool(const Image* image, const Point* points, int numPoints, - const EdgeOptions* options, int* numEdges); -IMAQ_FUNC CircleReport* IMAQ_STDCALL -imaqCircles(Image* dest, const Image* source, float minRadius, float maxRadius, - int* numCircles); -IMAQ_FUNC int IMAQ_STDCALL -imaqLabel(Image* dest, Image* source, int connectivity8, int* particleCount); -IMAQ_FUNC int IMAQ_STDCALL -imaqFitEllipse(const PointFloat* points, int numPoints, BestEllipse* ellipse); -IMAQ_FUNC int IMAQ_STDCALL -imaqFitCircle(const PointFloat* points, int numPoints, BestCircle* circle); -IMAQ_FUNC Color IMAQ_STDCALL imaqChangeColorSpace(const Color* sourceColor, - ColorMode sourceSpace, - ColorMode destSpace); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL -imaqMatchPattern(const Image* image, Image* pattern, - const MatchPatternOptions* options, Rect searchRect, - int* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqConvex(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqIsVisionInfoPresent(const Image* image, VisionInfoType type, int* present); -IMAQ_FUNC int IMAQ_STDCALL -imaqLineGaugeTool(const Image* image, Point start, Point end, - LineGaugeMethod method, const EdgeOptions* edgeOptions, - const CoordinateTransform* reference, float* distance); -IMAQ_FUNC int IMAQ_STDCALL imaqBestCircle(const PointFloat* points, - int numPoints, PointFloat* center, - double* radius); -IMAQ_FUNC int IMAQ_STDCALL -imaqSavePattern(const Image* pattern, const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL -imaqLoadPattern(Image* pattern, const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL imaqTransformROI(ROI* roi, Point originStart, - float angleStart, Point originFinal, - float angleFinal); -IMAQ_FUNC int IMAQ_STDCALL imaqCoordinateReference(const Point* points, - ReferenceMode mode, - Point* origin, float* angle); -IMAQ_FUNC ContourInfo* IMAQ_STDCALL -imaqGetContourInfo(const ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetWindowOverlay(int windowNumber, const Overlay* overlay); -IMAQ_FUNC Overlay* IMAQ_STDCALL imaqCreateOverlayFromROI(const ROI* roi); -IMAQ_FUNC Overlay* IMAQ_STDCALL -imaqCreateOverlayFromMetafile(const void* metafile); -IMAQ_FUNC int IMAQ_STDCALL -imaqSetCalibrationInfo(Image* image, CalibrationUnit unit, float xDistance, - float yDistance); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetCalibrationInfo(const Image* image, CalibrationUnit* unit, - float* xDistance, float* yDistance); -IMAQ_FUNC int IMAQ_STDCALL -imaqConstructROI(const Image* image, ROI* roi, Tool initialTool, - const ToolWindowOptions* tools, - const ConstructROIOptions* options, int* okay); -IMAQ_FUNC int IMAQ_STDCALL imaqGetParticleClassifierOptions( - const ClassifierSession* session, - ParticleClassifierPreprocessingOptions* preprocessingOptions, - ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqZoomWindow(int windowNumber, int xZoom, int yZoom, Point center); -IMAQ_FUNC int IMAQ_STDCALL -imaqGetWindowZoom(int windowNumber, int* xZoom, int* yZoom); -IMAQ_FUNC int IMAQ_STDCALL -imaqParticleFilter3(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, int criteriaCount, - const ParticleFilterOptions* options, const ROI* roi, - int* numParticles); -IMAQ_FUNC ReadTextReport2* IMAQ_STDCALL -imaqReadText2(const Image* image, const CharSet* set, const ROI* roi, - const ReadTextOptions* readOptions, - const OCRProcessingOptions* processingOptions, - const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnPattern2(Image* image, LearningMode learningMode, - LearnPatternAdvancedOptions* advancedOptions); -IMAQ_FUNC int IMAQ_STDCALL -imaqConvolve(Image* dest, Image* source, const float* kernel, int matrixRows, - int matrixCols, float normalize, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL -imaqDivideConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL -imaqDivide(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC EdgeReport2* IMAQ_STDCALL -imaqEdgeTool3(const Image* image, const ROI* roi, EdgeProcess processType, - const EdgeOptions2* edgeOptions); -IMAQ_FUNC ConcentricRakeReport* IMAQ_STDCALL -imaqConcentricRake(const Image* image, const ROI* roi, - ConcentricRakeDirection direction, EdgeProcess process, - const RakeOptions* options); -IMAQ_FUNC SpokeReport* IMAQ_STDCALL -imaqSpoke(const Image* image, const ROI* roi, SpokeDirection direction, - EdgeProcess process, const SpokeOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqLearnPattern(Image* image, LearningMode learningMode); -IMAQ_FUNC int IMAQ_STDCALL imaqLookup(Image* dest, const Image* source, - const short* table, const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL -imaqMatchPattern2(const Image* image, const Image* pattern, - const MatchPatternOptions* options, - const MatchPatternAdvancedOptions* advancedOptions, - Rect searchRect, int* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqSetParticleClassifierOptions( - ClassifierSession* session, - const ParticleClassifierPreprocessingOptions* preprocessingOptions, - const ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL -imaqCopyCalibrationInfo(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL -imaqParticleFilter2(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, int criteriaCount, - int rejectMatches, int connectivity8, int* numParticles); -IMAQ_FUNC EdgeReport* IMAQ_STDCALL -imaqEdgeTool2(const Image* image, const Point* points, int numPoints, - EdgeProcess process, const EdgeOptions* options, int* numEdges); -IMAQ_FUNC ContourID IMAQ_STDCALL -imaqAddRotatedRectContour(ROI* roi, RotatedRect rect); -IMAQ_FUNC Barcode2DInfo* IMAQ_STDCALL -imaqReadDataMatrixBarcode(const Image* image, const ROI* roi, - const DataMatrixOptions* options, - unsigned int* numBarcodes); -IMAQ_FUNC LinearAverages* IMAQ_STDCALL -imaqLinearAverages(const Image* image, Rect rect); -IMAQ_FUNC GeometricPatternMatch* IMAQ_STDCALL imaqMatchGeometricPattern( - const Image* image, const Image* pattern, const CurveOptions* curveOptions, - const MatchGeometricPatternOptions* matchOptions, - const MatchGeometricPatternAdvancedOptions* advancedMatchOptions, - const ROI* roi, int* numMatches); -IMAQ_FUNC CharInfo* IMAQ_STDCALL imaqGetCharInfo(const CharSet* set, int index); -IMAQ_FUNC ReadTextReport* IMAQ_STDCALL -imaqReadText(const Image* image, const CharSet* set, const ROI* roi, - const ReadTextOptions* readOptions, - const OCRProcessingOptions* processingOptions, - const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC ThresholdData* IMAQ_STDCALL -imaqAutoThreshold(Image* dest, Image* source, int numClasses, - ThresholdMethod method); -IMAQ_FUNC ColorHistogramReport* IMAQ_STDCALL -imaqColorHistogram(Image* image, int numClasses, ColorMode mode, - const Image* mask); -IMAQ_FUNC RakeReport* IMAQ_STDCALL -imaqRake(const Image* image, const ROI* roi, RakeDirection direction, - EdgeProcess process, const RakeOptions* options); - -IMAQ_FUNC int IMAQ_STDCALL Priv_ReadJPEGString_C(Image* image, - const unsigned char* string, - unsigned int stringLength); -#endif diff --git a/wpilibc/athena/src/CameraServer.cpp b/wpilibc/athena/src/CameraServer.cpp deleted file mode 100644 index 483bc6f501..0000000000 --- a/wpilibc/athena/src/CameraServer.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "CameraServer.h" - -#include -#include -#include - -#include -#include -#include - -#include "Utility.h" -#include "WPIErrors.h" - -using namespace frc; - -constexpr uint8_t CameraServer::kMagicNumber[]; - -CameraServer* CameraServer::GetInstance() { - static CameraServer instance; - return &instance; -} - -CameraServer::CameraServer() - : m_camera(), - m_serverThread(&CameraServer::Serve, this), - m_captureThread(), - m_imageMutex(), - m_newImageVariable(), - m_dataPool(3), - m_quality(50), - m_autoCaptureStarted(false), - m_hwClient(true), - m_imageData(nullptr, 0, 0, false) { - for (int i = 0; i < 3; i++) m_dataPool.push_back(new uint8_t[kMaxImageSize]); -} - -void CameraServer::FreeImageData( - std::tuple imageData) { - if (std::get<3>(imageData)) { - imaqDispose(std::get<0>(imageData)); - } else if (std::get<0>(imageData) != nullptr) { - std::lock_guard lock(m_imageMutex); - m_dataPool.push_back(std::get<0>(imageData)); - } -} - -void CameraServer::SetImageData(uint8_t* data, int size, int start, - bool imaqData) { - std::lock_guard lock(m_imageMutex); - FreeImageData(m_imageData); - m_imageData = std::make_tuple(data, size, start, imaqData); - m_newImageVariable.notify_all(); -} - -void CameraServer::SetImage(Image const* image) { - uint32_t dataSize = 0; - uint8_t* data = reinterpret_cast( - imaqFlatten(image, IMAQ_FLATTEN_IMAGE, IMAQ_COMPRESSION_JPEG, - 10 * m_quality, &dataSize)); - - // If we're using a HW camera, then find the start of the data - bool hwClient; - { - // Make a local copy of the hwClient variable so that we can safely use it. - std::lock_guard lock(m_imageMutex); - hwClient = m_hwClient; - } - uint32_t start = 0; - if (hwClient) { - while (start < dataSize - 1) { - if (data[start] == 0xFF && data[start + 1] == 0xD8) - break; - else - start++; - } - } - dataSize -= start; - - wpi_assert(dataSize > 2); - SetImageData(data, dataSize, start, true); -} - -void CameraServer::AutoCapture() { - Image* frame = imaqCreateImage(IMAQ_IMAGE_RGB, 0); - - while (true) { - bool hwClient; - uint8_t* data = nullptr; - { - std::lock_guard lock(m_imageMutex); - hwClient = m_hwClient; - if (hwClient) { - data = m_dataPool.back(); - m_dataPool.pop_back(); - } - } - - if (hwClient) { - int size = m_camera->GetImageData(data, kMaxImageSize); - SetImageData(data, size); - } else { - m_camera->GetImage(frame); - SetImage(frame); - } - } -} - -void CameraServer::StartAutomaticCapture(char const* cameraName) { - std::shared_ptr camera = - std::make_shared(cameraName, true); - camera->OpenCamera(); - StartAutomaticCapture(camera); -} - -void CameraServer::StartAutomaticCapture(std::shared_ptr camera) { - std::lock_guard lock(m_imageMutex); - if (m_autoCaptureStarted) return; - - m_camera = camera; - m_camera->StartCapture(); - - m_captureThread = std::thread(&CameraServer::AutoCapture, this); - m_captureThread.detach(); - m_autoCaptureStarted = true; -} - -bool CameraServer::IsAutoCaptureStarted() { - std::lock_guard lock(m_imageMutex); - return m_autoCaptureStarted; -} - -void CameraServer::SetSize(int size) { - std::lock_guard lock(m_imageMutex); - if (!m_camera) return; - if (size == kSize160x120) - m_camera->SetSize(160, 120); - else if (size == kSize320x240) - m_camera->SetSize(320, 240); - else if (size == kSize640x480) - m_camera->SetSize(640, 480); -} - -void CameraServer::SetQuality(int quality) { - std::lock_guard lock(m_imageMutex); - m_quality = quality > 100 ? 100 : quality; -} - -int CameraServer::GetQuality() { - std::lock_guard lock(m_imageMutex); - return m_quality; -} - -void CameraServer::Serve() { - int sock = socket(AF_INET, SOCK_STREAM, 0); - - if (sock == -1) { - wpi_setErrnoError(); - return; - } - - int reuseAddr = 1; - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, - sizeof(reuseAddr)) == -1) - wpi_setErrnoError(); - - sockaddr_in address, clientAddress; - - std::memset(&address, 0, sizeof(address)); - address.sin_family = AF_INET; - address.sin_addr.s_addr = htonl(INADDR_ANY); - address.sin_port = htons(kPort); - - if (bind(sock, reinterpret_cast(&address), sizeof(address)) == -1) - wpi_setErrnoError(); - - if (listen(sock, 10) == -1) wpi_setErrnoError(); - - while (true) { - socklen_t clientAddressLen = sizeof(clientAddress); - - int conn = accept(sock, reinterpret_cast(&clientAddress), - &clientAddressLen); - if (conn == -1) { - wpi_setErrnoError(); - continue; - } - - Request req; - char reqBuf[sizeof(req)]; - size_t reqPos = 0; - - while (reqPos < sizeof(req)) { - ssize_t sizeRead = read(conn, &reqBuf[reqPos], sizeof(req) - reqPos); - if (sizeRead < 0) break; - reqPos += sizeRead; - } - - if (reqPos < sizeof(req)) { - wpi_setErrnoError(); - close(conn); - continue; - } - - std::memcpy(&req, reqBuf, sizeof(req)); - req.fps = ntohl(req.fps); - req.compression = ntohl(req.compression); - req.size = ntohl(req.size); - - // TODO: Support the SW Compression. The rest of the code below will work as - // though this check isn't here - if (req.compression != kHardwareCompression) { - wpi_setWPIErrorWithContext(IncompatibleState, - "Choose \"USB Camera HW\" on the dashboard"); - close(conn); - continue; - } - - { - // Wait for the camera to be setw - std::unique_lock lock(m_imageMutex); - if (!m_camera) { - std::cout << "Camera not yet ready, awaiting first image" << std::endl; - m_newImageVariable.wait(lock); - } - m_hwClient = req.compression == kHardwareCompression; - if (!m_hwClient) - SetQuality(100 - req.compression); - else if (m_camera) - m_camera->SetFPS(req.fps); - SetSize(req.size); - } - - auto period = std::chrono::microseconds(1000000) / req.fps; - while (true) { - auto startTime = std::chrono::steady_clock::now(); - std::tuple imageData; - { - std::unique_lock lock(m_imageMutex); - m_newImageVariable.wait(lock); - imageData = m_imageData; - m_imageData = std::make_tuple(nullptr, 0, 0, false); - } - - int size = std::get<1>(imageData); - int netSize = htonl(size); - int start = std::get<2>(imageData); - uint8_t* data = std::get<0>(imageData); - - if (data == nullptr) continue; - - if (write(conn, kMagicNumber, sizeof(kMagicNumber)) == -1) { - wpi_setErrnoErrorWithContext( - "[CameraServer] Error sending magic number"); - FreeImageData(imageData); - break; - } - if (write(conn, &netSize, sizeof(netSize)) == -1) { - wpi_setErrnoErrorWithContext("[CameraServer] Error sending image size"); - FreeImageData(imageData); - break; - } - if (write(conn, &data[start], sizeof(uint8_t) * size) == -1) { - wpi_setErrnoErrorWithContext("[CameraServer] Error sending image data"); - FreeImageData(imageData); - break; - } - FreeImageData(imageData); - std::this_thread::sleep_until(startTime + period); - } - close(conn); - } - close(sock); -} diff --git a/wpilibc/athena/src/USBCamera.cpp b/wpilibc/athena/src/USBCamera.cpp deleted file mode 100644 index 2317f91602..0000000000 --- a/wpilibc/athena/src/USBCamera.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "USBCamera.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "Utility.h" - -using namespace frc; - -// This macro expands the given imaq function to ensure that it is called and -// properly checked for an error, calling the wpi_setImaqErrorWithContext -// macro -// To call it, just give the name of the function and the arguments -#define SAFE_IMAQ_CALL(funName, ...) \ - { \ - int error = funName(__VA_ARGS__); \ - if (error != IMAQdxErrorSuccess) \ - wpi_setImaqErrorWithContext(error, #funName); \ - } - -/** - * Helper function to determine the size of a jpeg. The general structure of - * how to parse a jpeg for length can be found in this stackoverflow article: - * http://stackoverflow.com/a/1602428. Be sure to also read the comments for - * the SOS flag explanation. - */ -int USBCamera::GetJpegSize(void* buffer, int buffSize) { - uint8_t* data = static_cast(buffer); - if (!wpi_assert(data[0] == 0xff && data[1] == 0xd8)) return 0; - int pos = 2; - while (pos < buffSize) { - // All control markers start with 0xff, so if this isn't present, - // the JPEG is not valid - if (!wpi_assert(data[pos] == 0xff)) return 0; - int t = data[pos + 1]; - // These are RST markers. We just skip them and move onto the next marker - if (t == 0x01 || (t >= 0xd0 && t <= 0xd7)) { - pos += 2; - } else if (t == 0xd9) { - // End of Image, add 2 for this and 0-indexed - return pos + 2; - } else if (!wpi_assert(t != 0xd8)) { - // Another start of image, invalid image - return 0; - } else if (t == 0xda) { - // SOS marker. The next two bytes are a 16-bit big-endian int that is - // the length of the SOS header, skip that - int len = (static_cast(data[pos + 2]) & 0xff) << 8 | - (static_cast(data[pos + 3]) & 0xff); - pos += len + 2; - // The next marker is the first marker that is 0xff followed by a non-RST - // element. 0xff followed by 0x00 is an escaped 0xff. 0xd0-0xd7 are RST - // markers - while (data[pos] != 0xff || data[pos + 1] == 0x00 || - (data[pos + 1] >= 0xd0 && data[pos + 1] <= 0xd7)) { - pos += 1; - if (pos >= buffSize) return 0; - } - } else { - // This is one of several possible markers. The next two bytes are a - // 16-bit - // big-endian int with the length of the marker header, skip that then - // continue searching - int len = (static_cast(data[pos + 2]) & 0xff) << 8 | - (static_cast(data[pos + 3]) & 0xff); - pos += len + 2; - } - } - - return 0; -} - -USBCamera::USBCamera(std::string name, bool useJpeg) - : m_name(name), m_useJpeg(useJpeg) {} - -void USBCamera::OpenCamera() { - std::lock_guard lock(m_mutex); - for (int i = 0; i < 3; i++) { - uInt32 id = 0; - // Can't use SAFE_IMAQ_CALL here because we only error on the third time - IMAQdxError error = IMAQdxOpenCamera( - m_name.c_str(), IMAQdxCameraControlModeController, &id); - if (error != IMAQdxErrorSuccess) { - // Only error on the 3rd try - if (i >= 2) wpi_setImaqErrorWithContext(error, "IMAQdxOpenCamera"); - // Sleep for a few seconds to ensure the error has been dealt with - std::this_thread::sleep_for(std::chrono::milliseconds(2000)); - } else { - m_id = id; - m_open = true; - return; - } - } -} - -void USBCamera::CloseCamera() { - std::lock_guard lock(m_mutex); - if (!m_open) return; - SAFE_IMAQ_CALL(IMAQdxCloseCamera, m_id); - m_id = 0; - m_open = false; -} - -void USBCamera::StartCapture() { - std::lock_guard lock(m_mutex); - if (!m_open || m_active) return; - SAFE_IMAQ_CALL(IMAQdxConfigureGrab, m_id); - SAFE_IMAQ_CALL(IMAQdxStartAcquisition, m_id); - m_active = true; -} - -void USBCamera::StopCapture() { - std::lock_guard lock(m_mutex); - if (!m_open || !m_active) return; - SAFE_IMAQ_CALL(IMAQdxStopAcquisition, m_id); - SAFE_IMAQ_CALL(IMAQdxUnconfigureAcquisition, m_id); - m_active = false; -} - -void USBCamera::UpdateSettings() { - std::lock_guard lock(m_mutex); - bool wasActive = m_active; - - if (wasActive) StopCapture(); - if (m_open) CloseCamera(); - OpenCamera(); - - uInt32 count = 0; - uInt32 currentMode = 0; - SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, nullptr, &count, - ¤tMode); - auto modes = std::make_unique(count); - SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, modes.get(), &count, - ¤tMode); - - // Groups are: - // 0 - width - // 1 - height - // 2 - format - // 3 - fps - std::regex reMode("([0-9]+)\\s*x\\s*([0-9]+)\\s+(.*?)\\s+([0-9.]+)\\s*fps"); - IMAQdxVideoMode* foundMode = nullptr; - IMAQdxVideoMode* currentModePtr = &modes[currentMode]; - double foundFps = 1000.0; - - // Loop through the modes, and find the match with the lowest fps - for (uint32_t i = 0; i < count; i++) { - std::cmatch m; - if (!std::regex_match(modes[i].Name, m, reMode)) continue; - int width = static_cast(std::stoul(m[1].str())); - int height = static_cast(std::stoul(m[2].str())); - if (width != m_width) continue; - if (height != m_height) continue; - double fps = std::atof(m[4].str().c_str()); - if (fps < m_fps) continue; - if (fps > foundFps) continue; - bool isJpeg = - m[3].str().compare("jpeg") == 0 || m[3].str().compare("JPEG") == 0; - if ((m_useJpeg && !isJpeg) || (!m_useJpeg && isJpeg)) continue; - foundMode = &modes[i]; - foundFps = fps; - } - if (foundMode != nullptr) { - if (foundMode->Value != currentModePtr->Value) { - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, IMAQdxAttributeVideoMode, - IMAQdxValueTypeU32, foundMode->Value); - } - } - - if (m_whiteBalance.compare(AUTO) == 0) { - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_WB_MODE, - IMAQdxValueTypeString, AUTO); - } else { - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_WB_MODE, - IMAQdxValueTypeString, MANUAL); - if (m_whiteBalanceValuePresent) - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_WB_VALUE, - IMAQdxValueTypeU32, m_whiteBalanceValue); - } - - if (m_exposure.compare(AUTO) == 0) { - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_EX_MODE, - IMAQdxValueTypeString, - std::string("AutoAperaturePriority").c_str()); - } else { - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_EX_MODE, - IMAQdxValueTypeString, MANUAL); - if (m_exposureValuePresent) { - double minv = 0.0; - double maxv = 0.0; - SAFE_IMAQ_CALL(IMAQdxGetAttributeMinimum, m_id, ATTR_EX_VALUE, - IMAQdxValueTypeF64, &minv); - SAFE_IMAQ_CALL(IMAQdxGetAttributeMaximum, m_id, ATTR_EX_VALUE, - IMAQdxValueTypeF64, &maxv); - double val = - minv + (maxv - minv) * (static_cast(m_exposureValue) / 100.0); - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_EX_VALUE, - IMAQdxValueTypeF64, val); - } - } - - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_BR_MODE, IMAQdxValueTypeString, - MANUAL); - double minv = 0.0; - double maxv = 0.0; - SAFE_IMAQ_CALL(IMAQdxGetAttributeMinimum, m_id, ATTR_BR_VALUE, - IMAQdxValueTypeF64, &minv); - SAFE_IMAQ_CALL(IMAQdxGetAttributeMaximum, m_id, ATTR_BR_VALUE, - IMAQdxValueTypeF64, &maxv); - double val = - minv + (maxv - minv) * (static_cast(m_brightness) / 100.0); - SAFE_IMAQ_CALL(IMAQdxSetAttribute, m_id, ATTR_BR_VALUE, IMAQdxValueTypeF64, - val); - - if (wasActive) StartCapture(); -} - -void USBCamera::SetFPS(double fps) { - std::lock_guard lock(m_mutex); - if (m_fps != fps) { - m_needSettingsUpdate = true; - m_fps = fps; - } -} - -void USBCamera::SetSize(int width, int height) { - std::lock_guard lock(m_mutex); - if (m_width != width || m_height != height) { - m_needSettingsUpdate = true; - m_width = width; - m_height = height; - } -} - -void USBCamera::SetBrightness(int brightness) { - std::lock_guard lock(m_mutex); - if (m_brightness != brightness) { - m_needSettingsUpdate = true; - m_brightness = brightness; - } -} - -int USBCamera::GetBrightness() { - std::lock_guard lock(m_mutex); - return m_brightness; -} - -void USBCamera::SetWhiteBalanceAuto() { - std::lock_guard lock(m_mutex); - m_whiteBalance = AUTO; - m_whiteBalanceValue = 0; - m_whiteBalanceValuePresent = false; - m_needSettingsUpdate = true; -} - -void USBCamera::SetWhiteBalanceHoldCurrent() { - std::lock_guard lock(m_mutex); - m_whiteBalance = MANUAL; - m_whiteBalanceValue = 0; - m_whiteBalanceValuePresent = false; - m_needSettingsUpdate = true; -} - -void USBCamera::SetWhiteBalanceManual(int whiteBalance) { - std::lock_guard lock(m_mutex); - m_whiteBalance = MANUAL; - m_whiteBalanceValue = whiteBalance; - m_whiteBalanceValuePresent = true; - m_needSettingsUpdate = true; -} - -void USBCamera::SetExposureAuto() { - std::lock_guard lock(m_mutex); - m_exposure = AUTO; - m_exposureValue = 0; - m_exposureValuePresent = false; - m_needSettingsUpdate = true; -} - -void USBCamera::SetExposureHoldCurrent() { - std::lock_guard lock(m_mutex); - m_exposure = MANUAL; - m_exposureValue = 0; - m_exposureValuePresent = false; - m_needSettingsUpdate = true; -} - -void USBCamera::SetExposureManual(int level) { - std::lock_guard lock(m_mutex); - m_exposure = MANUAL; - if (level > 100) - m_exposureValue = 100; - else - m_exposureValue = level; - m_exposureValuePresent = true; - m_needSettingsUpdate = true; -} - -void USBCamera::GetImage(Image* image) { - std::lock_guard lock(m_mutex); - if (m_needSettingsUpdate || m_useJpeg) { - m_needSettingsUpdate = false; - m_useJpeg = false; - UpdateSettings(); - } - // BufNum is not actually used for anything at our level, since we are - // waiting until the next image is ready anyway - uInt32 bufNum; - SAFE_IMAQ_CALL(IMAQdxGrab, m_id, image, 1, &bufNum); -} - -int USBCamera::GetImageData(void* buffer, int bufferSize) { - std::lock_guard lock(m_mutex); - if (m_needSettingsUpdate || !m_useJpeg) { - m_needSettingsUpdate = false; - m_useJpeg = true; - UpdateSettings(); - } - // BufNum is not actually used for anything at our level - uInt32 bufNum; - SAFE_IMAQ_CALL(IMAQdxGetImageData, m_id, buffer, bufferSize, - IMAQdxBufferNumberModeLast, 0, &bufNum); - return GetJpegSize(buffer, bufferSize); -} diff --git a/wpilibc/athena/src/Utility.cpp b/wpilibc/athena/src/Utility.cpp index ea9b1ad8ad..37e52334ce 100644 --- a/wpilibc/athena/src/Utility.cpp +++ b/wpilibc/athena/src/Utility.cpp @@ -17,7 +17,6 @@ #include "ErrorBase.h" #include "HAL/HAL.h" -#include "nivision.h" using namespace frc; diff --git a/wpilibc/athena/src/Vision/AxisCamera.cpp b/wpilibc/athena/src/Vision/AxisCamera.cpp deleted file mode 100644 index 5f56bcbb69..0000000000 --- a/wpilibc/athena/src/Vision/AxisCamera.cpp +++ /dev/null @@ -1,620 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/AxisCamera.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "Timer.h" -#include "WPIErrors.h" - -using namespace frc; - -static const int kMaxPacketSize = 1536; -static const int kImageBufferAllocationIncrement = 1000; - -static const std::string kWhiteBalanceStrings[] = { - "auto", "hold", "fixed_outdoor1", "fixed_outdoor2", - "fixed_indoor", "fixed_fluor1", "fixed_fluor2", -}; - -static const std::string kExposureControlStrings[] = { - "auto", "hold", "flickerfree50", "flickerfree60", -}; - -static const std::string kResolutionStrings[] = { - "640x480", "480x360", "320x240", "240x180", "176x144", "160x120", -}; - -static const std::string kRotationStrings[] = { - "0", "180", -}; - -/** - * AxisCamera constructor. - * - * @param cameraHost The host to find the camera at, typically an IP address - */ -AxisCamera::AxisCamera(std::string const& cameraHost) - : m_cameraHost(cameraHost) { - m_captureThread = std::thread(&AxisCamera::Capture, this); -} - -AxisCamera::~AxisCamera() { - m_done = true; - m_captureThread.join(); -} - -/* - * Return true if the latest image from the camera has not been retrieved by - * calling GetImage() yet. - * - * @return true if the image has not been retrieved yet. - */ -bool AxisCamera::IsFreshImage() const { return m_freshImage; } - -/** - * Get an image from the camera and store it in the provided image. - * - * @param image The imaq image to store the result in. This must be an HSL or - * RGB image. - * @return 1 upon success, zero on a failure - */ -int AxisCamera::GetImage(Image* image) { - if (m_imageData.size() == 0) { - return 0; - } - - std::lock_guard lock(m_imageDataMutex); - - Priv_ReadJPEGString_C(image, m_imageData.data(), m_imageData.size()); - - m_freshImage = false; - - return 1; -} - -/** - * Get an image from the camera and store it in the provided image. - * - * @param image The image to store the result in. This must be an HSL or RGB - * image - * @return 1 upon success, zero on a failure - */ -int AxisCamera::GetImage(ColorImage* image) { - return GetImage(image->GetImaqImage()); -} - -/** - * Instantiate a new image object and fill it with the latest image from the - * camera. - * - * The returned pointer is owned by the caller and is their responsibility to - * delete. - * - * @return a pointer to an HSLImage object - */ -HSLImage* AxisCamera::GetImage() { - auto image = new HSLImage(); - GetImage(image); - return image; -} - -/** - * Copy an image into an existing buffer. - * - * This copies an image into an existing buffer rather than creating a new image - * in memory. That way a new image is only allocated when the image being copied - * is larger than the destination. - * - * This method is called by the PCVideoServer class. - * - * @param imageData The destination image. - * @param numBytes The size of the destination image. - * @return 0 if failed (no source image or no memory), 1 if success. - */ -int AxisCamera::CopyJPEG(char** destImage, int& destImageSize, - int& destImageBufferSize) { - std::lock_guard lock(m_imageDataMutex); - if (destImage == nullptr) { - wpi_setWPIErrorWithContext(NullParameter, "destImage must not be nullptr"); - return 0; - } - - if (m_imageData.size() == 0) return 0; // if no source image - - // if current destination buffer too small - if (static_cast(destImageBufferSize) < m_imageData.size()) { - if (*destImage != nullptr) delete[] * destImage; - destImageBufferSize = m_imageData.size() + kImageBufferAllocationIncrement; - *destImage = new char[destImageBufferSize]; - if (*destImage == nullptr) return 0; - } - // copy this image into destination buffer - if (*destImage == nullptr) { - wpi_setWPIErrorWithContext(NullParameter, "*destImage must not be nullptr"); - } - - std::copy(m_imageData.begin(), m_imageData.end(), *destImage); - destImageSize = m_imageData.size(); - - return 1; -} - -/** - * Request a change in the brightness of the camera images. - * - * @param brightness valid values 0 .. 100 - */ -void AxisCamera::WriteBrightness(int brightness) { - if (brightness < 0 || brightness > 100) { - wpi_setWPIErrorWithContext(ParameterOutOfRange, - "Brightness must be from 0 to 100"); - return; - } - - std::lock_guard lock(m_parametersMutex); - - if (m_brightness != brightness) { - m_brightness = brightness; - m_parametersDirty = true; - } -} - -/** - * @return The configured brightness of the camera images - */ -int AxisCamera::GetBrightness() { - std::lock_guard lock(m_parametersMutex); - return m_brightness; -} - -/** - * Request a change in the white balance on the camera. - * - * @param whiteBalance Valid values from the WhiteBalance enum. - */ -void AxisCamera::WriteWhiteBalance(AxisCamera::WhiteBalance whiteBalance) { - std::lock_guard lock(m_parametersMutex); - - if (m_whiteBalance != whiteBalance) { - m_whiteBalance = whiteBalance; - m_parametersDirty = true; - } -} - -/** - * @return The configured white balances of the camera images - */ -AxisCamera::WhiteBalance AxisCamera::GetWhiteBalance() { - std::lock_guard lock(m_parametersMutex); - return m_whiteBalance; -} - -/** - * Request a change in the color level of the camera images. - * - * @param colorLevel valid values are 0 .. 100 - */ -void AxisCamera::WriteColorLevel(int colorLevel) { - if (colorLevel < 0 || colorLevel > 100) { - wpi_setWPIErrorWithContext(ParameterOutOfRange, - "Color level must be from 0 to 100"); - return; - } - - std::lock_guard lock(m_parametersMutex); - - if (m_colorLevel != colorLevel) { - m_colorLevel = colorLevel; - m_parametersDirty = true; - } -} - -/** - * @return The configured color level of the camera images - */ -int AxisCamera::GetColorLevel() { - std::lock_guard lock(m_parametersMutex); - return m_colorLevel; -} - -/** - * Request a change in the camera's exposure mode. - * - * @param exposureControl A mode to write in the Exposure enum. - */ -void AxisCamera::WriteExposureControl( - AxisCamera::ExposureControl exposureControl) { - std::lock_guard lock(m_parametersMutex); - - if (m_exposureControl != exposureControl) { - m_exposureControl = exposureControl; - m_parametersDirty = true; - } -} - -/** - * @return The configured exposure control mode of the camera - */ -AxisCamera::ExposureControl AxisCamera::GetExposureControl() { - std::lock_guard lock(m_parametersMutex); - return m_exposureControl; -} - -/** - * Request a change in the exposure priority of the camera. - * - * @param exposurePriority Valid values are 0, 50, 100. - * 0 = Prioritize image quality - * 50 = None - * 100 = Prioritize frame rate - */ -void AxisCamera::WriteExposurePriority(int exposurePriority) { - if (exposurePriority != 0 && exposurePriority != 50 && - exposurePriority != 100) { - wpi_setWPIErrorWithContext(ParameterOutOfRange, - "Exposure priority must be from 0, 50, or 100"); - return; - } - - std::lock_guard lock(m_parametersMutex); - - if (m_exposurePriority != exposurePriority) { - m_exposurePriority = exposurePriority; - m_parametersDirty = true; - } -} - -/** - * @return The configured exposure priority of the camera - */ -int AxisCamera::GetExposurePriority() { - std::lock_guard lock(m_parametersMutex); - return m_exposurePriority; -} - -/** - * Write the maximum frames per second that the camera should send - * Write 0 to send as many as possible. - * - * @param maxFPS The number of frames the camera should send in a second, - * exposure permitting. - */ -void AxisCamera::WriteMaxFPS(int maxFPS) { - std::lock_guard lock(m_parametersMutex); - - if (m_maxFPS != maxFPS) { - m_maxFPS = maxFPS; - m_parametersDirty = true; - m_streamDirty = true; - } -} - -/** - * @return The configured maximum FPS of the camera - */ -int AxisCamera::GetMaxFPS() { - std::lock_guard lock(m_parametersMutex); - return m_maxFPS; -} - -/** - * Write resolution value to camera. - * - * @param resolution The camera resolution value to write to the camera. - */ -void AxisCamera::WriteResolution(AxisCamera::Resolution resolution) { - std::lock_guard lock(m_parametersMutex); - - if (m_resolution != resolution) { - m_resolution = resolution; - m_parametersDirty = true; - m_streamDirty = true; - } -} - -/** - * @return The configured resolution of the camera (not necessarily the same - * resolution as the most recent image, if it was changed recently.) - */ -AxisCamera::Resolution AxisCamera::GetResolution() { - std::lock_guard lock(m_parametersMutex); - return m_resolution; -} - -/** - * Write the rotation value to the camera. - * - * If you mount your camera upside down, use this to adjust the image for you. - * - * @param rotation The angle to rotate the camera - * (AxisCamera::Rotation::k0 - * or AxisCamera::Rotation::k180) - */ -void AxisCamera::WriteRotation(AxisCamera::Rotation rotation) { - std::lock_guard lock(m_parametersMutex); - - if (m_rotation != rotation) { - m_rotation = rotation; - m_parametersDirty = true; - m_streamDirty = true; - } -} - -/** - * @return The configured rotation mode of the camera - */ -AxisCamera::Rotation AxisCamera::GetRotation() { - std::lock_guard lock(m_parametersMutex); - return m_rotation; -} - -/** - * Write the compression value to the camera. - * - * @param compression Values between 0 and 100. - */ -void AxisCamera::WriteCompression(int compression) { - if (compression < 0 || compression > 100) { - wpi_setWPIErrorWithContext(ParameterOutOfRange, - "Compression must be from 0 to 100"); - return; - } - - std::lock_guard lock(m_parametersMutex); - - if (m_compression != compression) { - m_compression = compression; - m_parametersDirty = true; - m_streamDirty = true; - } -} - -/** - * @return The configured compression level of the camera - */ -int AxisCamera::GetCompression() { - std::lock_guard lock(m_parametersMutex); - return m_compression; -} - -/** - * Method called in the capture thread to receive images from the camera - */ -void AxisCamera::Capture() { - int consecutiveErrors = 0; - - // Loop on trying to setup the camera connection. This happens in a background - // thread so it shouldn't effect the operation of user programs. - while (!m_done) { - std::string requestString = - "GET /mjpg/video.mjpg HTTP/1.1\n" - "User-Agent: HTTPStreamClient\n" - "Connection: Keep-Alive\n" - "Cache-Control: no-cache\n" - "Authorization: Basic RlJDOkZSQw==\n\n"; - m_captureMutex.lock(); - m_cameraSocket = CreateCameraSocket(requestString, consecutiveErrors > 5); - if (m_cameraSocket != -1) { - ReadImagesFromCamera(); - consecutiveErrors = 0; - } else { - consecutiveErrors++; - } - m_captureMutex.unlock(); - Wait(0.5); - } -} - -/** - * This function actually reads the images from the camera. - */ -void AxisCamera::ReadImagesFromCamera() { - char* imgBuffer = nullptr; - int imgBufferLength = 0; - - // TODO: these recv calls must be non-blocking. Otherwise if the camera - // fails during a read, the code hangs and never retries when the camera comes - // back up. - - int counter = 2; - while (!m_done) { - char initialReadBuffer[kMaxPacketSize] = ""; - char intermediateBuffer[1]; - char* trailingPtr = initialReadBuffer; - int trailingCounter = 0; - while (counter) { - // TODO: fix me... this cannot be the most efficient way to approach this, - // reading one byte at a time. - if (recv(m_cameraSocket, intermediateBuffer, 1, 0) == -1) { - wpi_setErrnoErrorWithContext("Failed to read image header"); - close(m_cameraSocket); - return; - } - std::strncat(initialReadBuffer, intermediateBuffer, 1); - // trailingCounter ensures that we start looking for the 4 byte string - // after - // there is at least 4 bytes total. Kind of obscure. - // look for 2 blank lines (\r\n) - if (nullptr != std::strstr(trailingPtr, "\r\n\r\n")) { - --counter; - } - if (++trailingCounter >= 4) { - trailingPtr++; - } - } - counter = 1; - char* contentLength = std::strstr(initialReadBuffer, "Content-Length: "); - if (contentLength == nullptr) { - wpi_setWPIErrorWithContext(IncompatibleMode, - "No content-length token found in packet"); - close(m_cameraSocket); - if (imgBuffer) delete[] imgBuffer; - return; - } - contentLength = contentLength + 16; // skip past "content length" - int readLength = std::atol(contentLength); // get the image byte count - - // Make sure buffer is large enough - if (imgBufferLength < readLength) { - if (imgBuffer) delete[] imgBuffer; - imgBufferLength = readLength + kImageBufferAllocationIncrement; - imgBuffer = new char[imgBufferLength]; - if (imgBuffer == nullptr) { - imgBufferLength = 0; - continue; - } - } - - // Read the image data for "Content-Length" bytes - int bytesRead = 0; - int remaining = readLength; - while (bytesRead < readLength) { - int bytesThisRecv = - recv(m_cameraSocket, &imgBuffer[bytesRead], remaining, 0); - bytesRead += bytesThisRecv; - remaining -= bytesThisRecv; - } - - // Update image - { - std::lock_guard lock(m_imageDataMutex); - - m_imageData.assign(imgBuffer, imgBuffer + imgBufferLength); - m_freshImage = true; - } - - if (WriteParameters()) { - break; - } - } - - close(m_cameraSocket); -} - -/** - * Send a request to the camera to set all of the parameters. This is called - * in the capture thread between each frame. This strategy avoids making lots - * of redundant HTTP requests, accounts for failed initial requests, and - * avoids blocking calls in the main thread unless necessary. - * - * This method does nothing if no parameters have been modified since it last - * completely successfully. - * - * @return true if the stream should be restarted due to a - * parameter changing. - */ -bool AxisCamera::WriteParameters() { - if (m_parametersDirty) { - std::stringstream request; - request << "GET /axis-cgi/admin/param.cgi?action=update"; - - m_parametersMutex.lock(); - request << "&ImageSource.I0.Sensor.Brightness=" << m_brightness; - request << "&ImageSource.I0.Sensor.WhiteBalance=" - << kWhiteBalanceStrings[m_whiteBalance]; - request << "&ImageSource.I0.Sensor.ColorLevel=" << m_colorLevel; - request << "&ImageSource.I0.Sensor.Exposure=" - << kExposureControlStrings[m_exposureControl]; - request << "&ImageSource.I0.Sensor.ExposurePriority=" << m_exposurePriority; - request << "&Image.I0.Stream.FPS=" << m_maxFPS; - request << "&Image.I0.Appearance.Resolution=" - << kResolutionStrings[m_resolution]; - request << "&Image.I0.Appearance.Compression=" << m_compression; - request << "&Image.I0.Appearance.Rotation=" << kRotationStrings[m_rotation]; - m_parametersMutex.unlock(); - - request << " HTTP/1.1" << std::endl; - request << "User-Agent: HTTPStreamClient" << std::endl; - request << "Connection: Keep-Alive" << std::endl; - request << "Cache-Control: no-cache" << std::endl; - request << "Authorization: Basic RlJDOkZSQw==" << std::endl; - request << std::endl; - - int socket = CreateCameraSocket(request.str(), false); - if (socket == -1) { - wpi_setErrnoErrorWithContext("Error setting camera parameters"); - } else { - close(socket); - m_parametersDirty = false; - - if (m_streamDirty) { - m_streamDirty = false; - return true; - } - } - } - - return false; -} - -/** - * Create a socket connected to camera. - * - * Used to create a connection to the camera for both capturing images and - * setting parameters. - * - * @param requestString The initial request string to send upon successful - * connection. - * @param setError If true, rais an error if there's a problem creating the - * connection. This is only enabled after several - * unsucessful connections, so a single one doesn't cause - * an error message to be printed if it immediately - * recovers. - * @return -1 if failed, socket handle if successful. - */ -int AxisCamera::CreateCameraSocket(std::string const& requestString, - bool setError) { - struct addrinfo* address = nullptr; - int camSocket; - - /* create socket */ - if ((camSocket = socket(AF_INET, SOCK_STREAM, 0)) == -1) { - if (setError) - wpi_setErrnoErrorWithContext("Failed to create the camera socket"); - return -1; - } - - if (getaddrinfo(m_cameraHost.c_str(), "80", nullptr, &address) == -1) { - if (setError) { - wpi_setErrnoErrorWithContext("Failed to create the camera socket"); - close(camSocket); - } - return -1; - } - - /* connect to server */ - if (connect(camSocket, address->ai_addr, address->ai_addrlen) == -1) { - if (setError) - wpi_setErrnoErrorWithContext("Failed to connect to the camera"); - freeaddrinfo(address); - close(camSocket); - return -1; - } - - freeaddrinfo(address); - - int sent = send(camSocket, requestString.c_str(), requestString.size(), 0); - if (sent == -1) { - if (setError) - wpi_setErrnoErrorWithContext("Failed to send a request to the camera"); - close(camSocket); - return -1; - } - - return camSocket; -} diff --git a/wpilibc/athena/src/Vision/BaeUtilities.cpp b/wpilibc/athena/src/Vision/BaeUtilities.cpp deleted file mode 100644 index 54942e01f0..0000000000 --- a/wpilibc/athena/src/Vision/BaeUtilities.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/BaeUtilities.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "Servo.h" -#include "Timer.h" - -namespace frc { - -/** @file - * Utility functions - */ - -/** - * debug output flag options: - * DEBUG_OFF, DEBUG_MOSTLY_OFF, DEBUG_SCREEN_ONLY, DEBUG_FILE_ONLY, - * DEBUG_SCREEN_AND_FILE - */ -static DebugOutputType dprintfFlag = DEBUG_OFF; - -/** - * Set the debug flag to print to screen, file on cRIO, both or neither. - * - * @param tempString The format string. - */ -void SetDebugFlag(DebugOutputType flag) { dprintfFlag = flag; } - -/** - * Debug print to a file and/or a terminal window. - * - * Call like you would call printf. - * Set functionName in the function if you want the correct function name to - * print out. - * The file line number will also be printed. - * - * @param tempString The format string. - */ -void dprintf(const char* tempString, ...) { - va_list args; /* Input argument list */ - int line_number; /* Line number passed in argument */ - int type; - const char* functionName; /* Format passed in argument */ - const char* fmt; /* Format passed in argument */ - char text[512]; /* Text string */ - std::FILE* outfile_fd; /* Output file pointer */ - char filepath[128]; /* Text string */ - int fatalFlag = 0; - const char* filename; - int index; - int tempStringLen; - - if (dprintfFlag == DEBUG_OFF) { - return; - } - - va_start(args, tempString); - - tempStringLen = std::strlen(tempString); - filename = tempString; - for (index = 0; index < tempStringLen; index++) { - if (tempString[index] == ' ') { - std::printf("ERROR in dprintf: malformed calling sequence (%s)\n", - tempString); - va_end(args); - return; - } - if (tempString[index] == '\\' || tempString[index] == '/') - filename = tempString + index + 1; - } - - /* Extract function name */ - functionName = va_arg(args, const char*); - - /* Extract line number from argument list */ - line_number = va_arg(args, int); - - /* Extract information type from argument list */ - type = va_arg(args, int); - - /* Extract format from argument list */ - fmt = va_arg(args, const char*); - - std::vsprintf(text, fmt, args); - - va_end(args); - - /* Format output statement */ - std::stringstream ss; - ss << std::setfill('0') << std::setw(4); - ss << "[" << filename << ":" << functionName << "@" << line_number << "] "; - switch (type) { - case DEBUG_TYPE: - ss << "DEBUG"; - break; - case INFO_TYPE: - ss << "INFO"; - break; - case ERROR_TYPE: - ss << "ERROR"; - break; - case CRITICAL_TYPE: - ss << "CRITICAL"; - break; - case FATAL_TYPE: - fatalFlag = 1; - ss << "FATAL"; - break; - default: - std::printf("ERROR in dprintf: malformed calling sequence\n"); - return; - break; - } - ss << " " << text << "\n"; - - std::snprintf(filepath, sizeof(filepath), "%s.debug", filename); - - /* Write output statement */ - switch (dprintfFlag) { - default: - case DEBUG_OFF: - break; - case DEBUG_MOSTLY_OFF: - if (fatalFlag) { - if ((outfile_fd = std::fopen(filepath, "a+")) != nullptr) { - std::fwrite(ss.str().c_str(), sizeof(char), ss.str().length(), - outfile_fd); - std::fclose(outfile_fd); - } - } - break; - case DEBUG_SCREEN_ONLY: - std::printf("%s", ss.str().c_str()); - break; - case DEBUG_FILE_ONLY: - if ((outfile_fd = std::fopen(filepath, "a+")) != nullptr) { - std::fwrite(ss.str().c_str(), sizeof(char), ss.str().length(), - outfile_fd); - std::fclose(outfile_fd); - } - break; - case DEBUG_SCREEN_AND_FILE: // BOTH - std::printf("%s", ss.str().c_str()); - if ((outfile_fd = std::fopen(filepath, "a+")) != nullptr) { - std::fwrite(ss.str().c_str(), sizeof(char), ss.str().length(), - outfile_fd); - std::fclose(outfile_fd); - } - break; - } -} - -/** - * @brief Normalizes a value in a range, used for drive input. - * @param position The position in the range, starting at 0 - * @param range The size of the range that position is in - * @return The normalized position from -1 to +1 - */ -double RangeToNormalized(double position, int range) { - return position * 2.0 / static_cast(range) - 1.0; -} - -/** - * @brief Convert a normalized value to the corresponding value in a range. - * This is used to convert normalized values to the servo command range. - * @param normalizedValue The normalized value (in the -1 to +1 range) - * @param minRange The minimum of the range (0 is default) - * @param maxRange The maximum of the range (1 is default) - * @return The value in the range corresponding to the input normalized value - */ -float NormalizeToRange(float normalizedValue, float minRange, float maxRange) { - float range = maxRange - minRange; - float temp = static_cast(normalizedValue / 2.0 + 0.5) * range; - return (temp + minRange); -} -float NormalizeToRange(float normalizedValue) { - return static_cast(normalizedValue / 2.0 + 0.5); -} - -/** - * @brief Displays an activity indicator to console. - * Call this function like you would call std::printf. - * @param fmt The format string -*/ -void ShowActivity(char* fmt, ...) { - static char activity_indication_string[] = "|/-\\"; - static int ai = 3; - va_list args; - char text[1024]; - - va_start(args, fmt); - - std::vsprintf(text, fmt, args); - - ai = ai == 3 ? 0 : ai + 1; - - std::printf("%c %s \r", activity_indication_string[ai], text); - std::fflush(stdout); - - va_end(args); -} - -#define PI 3.14159265358979 -/** - * @brief Calculate sine wave increments (-1.0 to 1.0). - * The first time this is called, it sets up the time increment. Subsequent - * calls will give values along the sine wave depending on current time. If - * the wave is stopped and restarted, it must be reinitialized with a new - * "first call". - * - * @param period length of time to complete a complete wave - * @param sinStart Where to start the sine wave (0.0 = 2 pi, pi/2 = 1.0, etc.) - */ -double SinPosition(double* period, double sinStart) { - double rtnVal; - static double sinePeriod = 0.0; - static double timestamp; - double sinArg; - - // 1st call - if (period != nullptr) { - sinePeriod = *period; - timestamp = GetTime(); - return 0.0; - } - - // Multiplying by 2*pi to the time difference makes sinePeriod work if it's - // measured in seconds. - // Adding sinStart to the part multiplied by PI, but not by 2, allows it to - // work as described in the comments. - sinArg = PI * ((2.0 * (GetTime() - timestamp)) + sinStart) / sinePeriod; - rtnVal = std::sin(sinArg); - return (rtnVal); -} - -/** - * @brief Find the elapsed time since a specified time. - * @param startTime The starting time - * @return How long it has been since the starting time - */ -double ElapsedTime(double startTime) { - double realTime = GetTime(); - return (realTime - startTime); -} - -/** - * @brief Initialize pan parameters - * @param period The number of seconds to complete one pan - */ -void panInit() { - double period = 3.0; // number of seconds for one complete pan - SinPosition(&period, 0.0); // initial call to set up time -} - -void panInit(double period) { - if (period < 0.0) period = 3.0; - SinPosition(&period, 0.0); // initial call to set up time -} - -/** - * @brief Move the horizontal servo back and forth. - * @param panServo The servo object to move - * @param sinStart The position on the sine wave to begin the pan - */ -void panForTarget(Servo* panServo) { panForTarget(panServo, 0.0); } - -void panForTarget(Servo* panServo, double sinStart) { - float normalizedSinPosition = - static_cast(SinPosition(nullptr, sinStart)); - float newServoPosition = NormalizeToRange(normalizedSinPosition); - panServo->Set(newServoPosition); - // ShowActivity ("pan x: normalized %f newServoPosition = %f" , - // normalizedSinPosition, newServoPosition ); -} - -/** @brief Read a file and return non-comment output string - * - * Call the first time with 0 lineNumber to get the number of lines to read - * Then call with each lineNumber to get one camera parameter. There should - * be one property=value entry on each line, i.e. "exposure=auto" - * - * @param inputFile filename to read - * @param outputString one string - * @param lineNumber if 0, return number of lines; else return that line - * number - * @return int number of lines or -1 if error - **/ -int processFile(char* inputFile, char* outputString, int lineNumber) { - std::FILE* infile; - const int kStringSize = 80; // max size of one line in file - char inputStr[kStringSize]; - inputStr[0] = '\0'; - int lineCount = 0; - - if (lineNumber < 0) return (-1); - - if ((infile = std::fopen(inputFile, "r")) == nullptr) { - std::printf("Fatal error opening file %s\n", inputFile); - return (0); - } - - while (!std::feof(infile)) { - if (std::fgets(inputStr, kStringSize, infile) != nullptr) { - // Skip empty lines - if (emptyString(inputStr)) continue; - // Skip comment lines - if (inputStr[0] == '#' || inputStr[0] == '!') continue; - - lineCount++; - if (lineNumber == 0) { - continue; - } else { - if (lineCount == lineNumber) break; - } - } - } - - // close file - std::fclose(infile); - // if number lines requested return the count - if (lineNumber == 0) return (lineCount); - // check for input out of range - if (lineNumber > lineCount) return (-1); - // return the line selected; lineCount guaranteed to be greater than zero - stripString(inputStr); - std::strncpy(outputString, inputStr, kStringSize); - return (lineCount); -} - -/** - * Ignore empty string. - * @param string to check if empty - **/ -int emptyString(char* string) { - int i, len; - - if (string == nullptr) return (1); - - len = std::strlen(string); - for (i = 0; i < len; i++) { - // Ignore the following characters - if (string[i] == '\n' || string[i] == '\r' || string[i] == '\t' || - string[i] == ' ') - continue; - return (0); - } - return (1); -} - -/** - * Remove special characters from string. - * @param string to process - **/ -void stripString(char* string) { - int i, j, len; - - if (string == nullptr) return; - - len = std::strlen(string); - for (i = 0, j = 0; i < len; i++) { - // Remove the following characters from the string - if (string[i] == '\n' || string[i] == '\r' || string[i] == '\"') continue; - // Copy anything else - string[j++] = string[i]; - } - string[j] = '\0'; -} - -} // namespace frc diff --git a/wpilibc/athena/src/Vision/BinaryImage.cpp b/wpilibc/athena/src/Vision/BinaryImage.cpp deleted file mode 100644 index f5ecdfa645..0000000000 --- a/wpilibc/athena/src/Vision/BinaryImage.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/BinaryImage.h" - -#include - -#include "WPIErrors.h" - -using namespace frc; - -/** - * Get then number of particles for the image. - * - * @return the number of particles found for the image. - */ -int BinaryImage::GetNumberParticles() { - int numParticles = 0; - int success = imaqCountParticles(m_imaqImage, 1, &numParticles); - wpi_setImaqErrorWithContext(success, "Error counting particles"); - return numParticles; -} - -/** - * Get a single particle analysis report. - * - * Get one (of possibly many) particle analysis reports for an image. - * - * @param particleNumber Which particle analysis report to return. - * @return the selected particle analysis report - */ -ParticleAnalysisReport BinaryImage::GetParticleAnalysisReport( - int particleNumber) { - ParticleAnalysisReport par; - GetParticleAnalysisReport(particleNumber, &par); - return par; -} - -/** - * Get a single particle analysis report. - * - * Get one (of possibly many) particle analysis reports for an image. - * This version could be more efficient when copying many reports. - * - * @param particleNumber Which particle analysis report to return. - * @param par the selected particle analysis report - */ -void BinaryImage::GetParticleAnalysisReport(int particleNumber, - ParticleAnalysisReport* par) { - int success; - int numParticles = 0; - - success = imaqGetImageSize(m_imaqImage, &par->imageWidth, &par->imageHeight); - wpi_setImaqErrorWithContext(success, "Error getting image size"); - if (StatusIsFatal()) return; - - success = imaqCountParticles(m_imaqImage, 1, &numParticles); - wpi_setImaqErrorWithContext(success, "Error counting particles"); - if (StatusIsFatal()) return; - - if (particleNumber >= numParticles) { - wpi_setWPIErrorWithContext(ParameterOutOfRange, "particleNumber"); - return; - } - - par->particleIndex = particleNumber; - // Don't bother measuring the rest of the particle if one fails - bool good = ParticleMeasurement(particleNumber, IMAQ_MT_CENTER_OF_MASS_X, - &par->center_mass_x); - good = good && ParticleMeasurement(particleNumber, IMAQ_MT_CENTER_OF_MASS_Y, - &par->center_mass_y); - good = good && - ParticleMeasurement(particleNumber, IMAQ_MT_AREA, &par->particleArea); - good = good && ParticleMeasurement(particleNumber, IMAQ_MT_BOUNDING_RECT_TOP, - &par->boundingRect.top); - good = good && ParticleMeasurement(particleNumber, IMAQ_MT_BOUNDING_RECT_LEFT, - &par->boundingRect.left); - good = - good && ParticleMeasurement(particleNumber, IMAQ_MT_BOUNDING_RECT_HEIGHT, - &par->boundingRect.height); - good = - good && ParticleMeasurement(particleNumber, IMAQ_MT_BOUNDING_RECT_WIDTH, - &par->boundingRect.width); - good = good && ParticleMeasurement(particleNumber, IMAQ_MT_AREA_BY_IMAGE_AREA, - &par->particleToImagePercent); - good = good && ParticleMeasurement(particleNumber, - IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA, - &par->particleQuality); - - if (good) { - /* normalized position (-1 to 1) */ - par->center_mass_x_normalized = - NormalizeFromRange(par->center_mass_x, par->imageWidth); - par->center_mass_y_normalized = - NormalizeFromRange(par->center_mass_y, par->imageHeight); - } -} - -/** - * Get an ordered vector of particles for the image. - * - * Create a vector of particle analysis reports sorted by size for an image. - * The vector contains the actual report structures. - * - * @return a pointer to the vector of particle analysis reports. The caller - * must delete the vector when finished using it. - */ -std::vector* -BinaryImage::GetOrderedParticleAnalysisReports() { - auto particles = new std::vector; - int particleCount = GetNumberParticles(); - for (int particleIndex = 0; particleIndex < particleCount; particleIndex++) { - particles->push_back(GetParticleAnalysisReport(particleIndex)); - } - // TODO: This is pretty inefficient since each compare in the sort copies - // both reports being compared... do it manually instead... while we're - // at it, we should provide a version that allows a preallocated buffer of - // ParticleAnalysisReport structures - std::sort(particles->begin(), particles->end(), CompareParticleSizes); - return particles; -} - -/** - * Write a binary image to flash. - * - * Writes the binary image to flash on the cRIO for later inspection. - * - * @param fileName the name of the image file written to the flash. - */ -void BinaryImage::Write(const char* fileName) { - RGBValue colorTable[256]; - std::memset(colorTable, 0, sizeof(colorTable)); - colorTable[0].R = 0; - colorTable[1].R = 255; - colorTable[0].G = colorTable[1].G = 0; - colorTable[0].B = colorTable[1].B = 0; - colorTable[0].alpha = colorTable[1].alpha = 0; - imaqWriteFile(m_imaqImage, fileName, colorTable); -} - -/** - * Measure a single parameter for an image. - * - * Get the measurement for a single parameter about an image by calling the - * imaqMeasureParticle function for the selected parameter. - * - * @param particleNumber which particle in the set of particles - * @param whatToMeasure the imaq MeasurementType (what to measure) - * @param result the value of the measurement - * @return false on failure, true on success - */ -bool BinaryImage::ParticleMeasurement(int particleNumber, - MeasurementType whatToMeasure, - int* result) { - double resultDouble; - bool success = - ParticleMeasurement(particleNumber, whatToMeasure, &resultDouble); - *result = static_cast(resultDouble); - return success; -} - -/** - * Measure a single parameter for an image. - * - * Get the measurement for a single parameter about an image by calling the - * imaqMeasureParticle function for the selected parameter. - * - * @param particleNumber which particle in the set of particles - * @param whatToMeasure the imaq MeasurementType (what to measure) - * @param result the value of the measurement - * @returns true on failure, false on success - */ -bool BinaryImage::ParticleMeasurement(int particleNumber, - MeasurementType whatToMeasure, - double* result) { - int success; - success = imaqMeasureParticle(m_imaqImage, particleNumber, 0, whatToMeasure, - result); - wpi_setImaqErrorWithContext(success, "Error measuring particle"); - return !StatusIsFatal(); -} - -// Normalizes to [-1,1] -double BinaryImage::NormalizeFromRange(double position, int range) { - return position * 2.0 / static_cast(range) - 1.0; -} - -/** - * The compare helper function for sort. - * - * This function compares two particle analysis reports as a helper for the sort - * function. - * - * @param particle1 The first particle to compare - * @param particle2 the second particle to compare - * @returns true if particle1 is greater than particle2 - */ -bool BinaryImage::CompareParticleSizes(ParticleAnalysisReport particle1, - ParticleAnalysisReport particle2) { - // we want descending sort order - return particle1.particleToImagePercent > particle2.particleToImagePercent; -} - -BinaryImage* BinaryImage::RemoveSmallObjects(bool connectivity8, int erosions) { - auto result = new BinaryImage(); - int success = - imaqSizeFilter(result->GetImaqImage(), m_imaqImage, connectivity8, - erosions, IMAQ_KEEP_LARGE, nullptr); - wpi_setImaqErrorWithContext(success, "Error in RemoveSmallObjects"); - return result; -} - -BinaryImage* BinaryImage::RemoveLargeObjects(bool connectivity8, int erosions) { - auto result = new BinaryImage(); - int success = - imaqSizeFilter(result->GetImaqImage(), m_imaqImage, connectivity8, - erosions, IMAQ_KEEP_SMALL, nullptr); - wpi_setImaqErrorWithContext(success, "Error in RemoveLargeObjects"); - return result; -} - -BinaryImage* BinaryImage::ConvexHull(bool connectivity8) { - auto result = new BinaryImage(); - int success = - imaqConvexHull(result->GetImaqImage(), m_imaqImage, connectivity8); - wpi_setImaqErrorWithContext(success, "Error in convex hull operation"); - return result; -} - -BinaryImage* BinaryImage::ParticleFilter(ParticleFilterCriteria2* criteria, - int criteriaCount) { - auto result = new BinaryImage(); - int numParticles; - ParticleFilterOptions2 filterOptions = {0, 0, 0, 1}; - int success = imaqParticleFilter4(result->GetImaqImage(), m_imaqImage, - criteria, criteriaCount, &filterOptions, - nullptr, &numParticles); - wpi_setImaqErrorWithContext(success, "Error in particle filter operation"); - return result; -} diff --git a/wpilibc/athena/src/Vision/ColorImage.cpp b/wpilibc/athena/src/Vision/ColorImage.cpp deleted file mode 100644 index 77deec9131..0000000000 --- a/wpilibc/athena/src/Vision/ColorImage.cpp +++ /dev/null @@ -1,488 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/ColorImage.h" - -#include "WPIErrors.h" - -using namespace frc; - -ColorImage::ColorImage(ImageType type) : ImageBase(type) {} - -/** - * Perform a threshold operation on a ColorImage. - * - * Perform a threshold operation on a ColorImage using the ColorMode supplied - * as a parameter. - * - * @param colorMode The type of colorspace this operation should be performed in - * @return a pointer to a binary image - */ -BinaryImage* ColorImage::ComputeThreshold(ColorMode colorMode, int low1, - int high1, int low2, int high2, - int low3, int high3) { - auto result = new BinaryImage(); - Range range1 = {low1, high1}, range2 = {low2, high2}, range3 = {low3, high3}; - - int success = imaqColorThreshold(result->GetImaqImage(), m_imaqImage, 1, - colorMode, &range1, &range2, &range3); - wpi_setImaqErrorWithContext(success, "ImaqThreshold error"); - return result; -} - -/** - * Perform a threshold in RGB space. - * - * @param redLow Red low value - * @param redHigh Red high value - * @param greenLow Green low value - * @param greenHigh Green high value - * @param blueLow Blue low value - * @param blueHigh Blue high value - * @return A pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdRGB(int redLow, int redHigh, int greenLow, - int greenHigh, int blueLow, - int blueHigh) { - return ComputeThreshold(IMAQ_RGB, redLow, redHigh, greenLow, greenHigh, - blueLow, blueHigh); -} - -/** - * Perform a threshold in RGB space. - * - * @param threshold a reference to the Threshold object to use. - * @return A pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdRGB(Threshold& t) { - return ComputeThreshold(IMAQ_RGB, t.plane1Low, t.plane1High, t.plane2Low, - t.plane2High, t.plane3Low, t.plane3High); -} - -/** - * Perform a threshold in HSL space. - * - * @param hueLow Low value for hue - * @param hueHigh High value for hue - * @param saturationLow Low value for saturation - * @param saturationHigh High value for saturation - * @param luminenceLow Low value for luminence - * @param luminenceHigh High value for luminence - * @return a pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSL(int hueLow, int hueHigh, - int saturationLow, int saturationHigh, - int luminenceLow, int luminenceHigh) { - return ComputeThreshold(IMAQ_HSL, hueLow, hueHigh, saturationLow, - saturationHigh, luminenceLow, luminenceHigh); -} - -/** - * Perform a threshold in HSL space. - * - * @param threshold a reference to the Threshold object to use. - * @return A pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSL(Threshold& t) { - return ComputeThreshold(IMAQ_HSL, t.plane1Low, t.plane1High, t.plane2Low, - t.plane2High, t.plane3Low, t.plane3High); -} - -/** - * Perform a threshold in HSV space. - * - * @param hueLow Low value for hue - * @param hueHigh High value for hue - * @param saturationLow Low value for saturation - * @param saturationHigh High value for saturation - * @param valueLow Low value - * @param valueHigh High value - * @return a pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSV(int hueLow, int hueHigh, - int saturationLow, int saturationHigh, - int valueLow, int valueHigh) { - return ComputeThreshold(IMAQ_HSV, hueLow, hueHigh, saturationLow, - saturationHigh, valueLow, valueHigh); -} - -/** - * Perform a threshold in HSV space. - * - * @param threshold a reference to the Threshold object to use. - * @return A pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSV(Threshold& t) { - return ComputeThreshold(IMAQ_HSV, t.plane1Low, t.plane1High, t.plane2Low, - t.plane2High, t.plane3Low, t.plane3High); -} - -/** - * Perform a threshold in HSI space. - * - * @param hueLow Low value for hue - * @param hueHigh High value for hue - * @param saturationLow Low value for saturation - * @param saturationHigh High value for saturation - * @param valueLow Low intensity - * @param valueHigh High intensity - * @return a pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSI(int hueLow, int hueHigh, - int saturationLow, int saturationHigh, - int intensityLow, int intensityHigh) { - return ComputeThreshold(IMAQ_HSI, hueLow, hueHigh, saturationLow, - saturationHigh, intensityLow, intensityHigh); -} - -/** - * Perform a threshold in HSI space. - * - * @param threshold a reference to the Threshold object to use. - * @return A pointer to a BinaryImage that represents the result of the - * threshold operation. - */ -BinaryImage* ColorImage::ThresholdHSI(Threshold& t) { - return ComputeThreshold(IMAQ_HSI, t.plane1Low, t.plane1High, t.plane2Low, - t.plane2High, t.plane3Low, t.plane3High); -} - -/** - * Extract a color plane from the image. - * - * @param mode The ColorMode to use for the plane extraction - * @param planeNumber Which plane is to be extracted - * @return A pointer to a MonoImage that represents the extracted plane. - */ -MonoImage* ColorImage::ExtractColorPlane(ColorMode mode, int planeNumber) { - auto result = new MonoImage(); - if (m_imaqImage == nullptr) wpi_setWPIError(NullParameter); - int success = imaqExtractColorPlanes( - m_imaqImage, mode, (planeNumber == 1) ? result->GetImaqImage() : nullptr, - (planeNumber == 2) ? result->GetImaqImage() : nullptr, - (planeNumber == 3) ? result->GetImaqImage() : nullptr); - wpi_setImaqErrorWithContext(success, "Imaq ExtractColorPlanes failed"); - return result; -} - -/** - * Extract the first color plane for an image. - * - * @param mode The color mode in which to operate - * @return a pointer to a MonoImage that is the extracted plane. - */ -MonoImage* ColorImage::ExtractFirstColorPlane(ColorMode mode) { - return ExtractColorPlane(mode, 1); -} - -/** - * Extract the second color plane for an image. - * - * @param mode The color mode in which to operate - * @return a pointer to a MonoImage that is the extracted plane. - */ -MonoImage* ColorImage::ExtractSecondColorPlane(ColorMode mode) { - return ExtractColorPlane(mode, 2); -} - -/** - * Extract the third color plane for an image. - * - * @param mode The color mode in which to operate - * @return a pointer to a MonoImage that is the extracted plane. - */ -MonoImage* ColorImage::ExtractThirdColorPlane(ColorMode mode) { - return ExtractColorPlane(mode, 3); -} - -/** - * Extract the red plane from an RGB image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetRedPlane() { - return ExtractFirstColorPlane(IMAQ_RGB); -} - -/** - * Extract the green plane from an RGB image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetGreenPlane() { - return ExtractSecondColorPlane(IMAQ_RGB); -} - -/** - * Extract the blue plane from an RGB image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetBluePlane() { - return ExtractThirdColorPlane(IMAQ_RGB); -} - -/** - * Extract the Hue plane from an HSL image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetHSLHuePlane() { - return ExtractFirstColorPlane(IMAQ_HSL); -} - -/** - * Extract the Hue plane from an HSV image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetHSVHuePlane() { - return ExtractFirstColorPlane(IMAQ_HSV); -} - -/** - * Extract the Hue plane from an HSI image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetHSIHuePlane() { - return ExtractFirstColorPlane(IMAQ_HSI); -} - -/** - * Extract the Luminance plane from an HSL image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetLuminancePlane() { - return ExtractThirdColorPlane(IMAQ_HSL); -} - -/** - * Extract the Value plane from an HSV image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetValuePlane() { - return ExtractThirdColorPlane(IMAQ_HSV); -} - -/** - * Extract the Intensity plane from an HSI image. - * - * @return a pointer to a MonoImage that is the extraced plane. - */ -MonoImage* ColorImage::GetIntensityPlane() { - return ExtractThirdColorPlane(IMAQ_HSI); -} - -/** - * Replace a plane in the ColorImage with a MonoImage. - * - * Replaces a single plane in the image with a MonoImage. - * - * @param mode The ColorMode in which to operate - * @param plane The pointer to the replacement plane as a MonoImage - * @param planeNumber The plane number (1, 2, 3) to replace - */ -void ColorImage::ReplacePlane(ColorMode mode, MonoImage* plane, - int planeNumber) { - int success = imaqReplaceColorPlanes( - m_imaqImage, reinterpret_cast(m_imaqImage), mode, - (planeNumber == 1) ? plane->GetImaqImage() : nullptr, - (planeNumber == 2) ? plane->GetImaqImage() : nullptr, - (planeNumber == 3) ? plane->GetImaqImage() : nullptr); - wpi_setImaqErrorWithContext(success, "Imaq ReplaceColorPlanes failed"); -} - -/** - * Replace the first color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceFirstColorPlane(ColorMode mode, MonoImage* plane) { - ReplacePlane(mode, plane, 1); -} - -/** - * Replace the second color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceSecondColorPlane(ColorMode mode, MonoImage* plane) { - ReplacePlane(mode, plane, 2); -} - -/** - * Replace the third color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceThirdColorPlane(ColorMode mode, MonoImage* plane) { - ReplacePlane(mode, plane, 3); -} - -/** - * Replace the red color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceRedPlane(MonoImage* plane) { - ReplaceFirstColorPlane(IMAQ_RGB, plane); -} - -/** - * Replace the green color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceGreenPlane(MonoImage* plane) { - ReplaceSecondColorPlane(IMAQ_RGB, plane); -} - -/** - * Replace the blue color plane with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceBluePlane(MonoImage* plane) { - ReplaceThirdColorPlane(IMAQ_RGB, plane); -} - -/** - * Replace the Hue color plane in a HSL image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSLHuePlane(MonoImage* plane) { - return ReplaceFirstColorPlane(IMAQ_HSL, plane); -} - -/** - * Replace the Hue color plane in a HSV image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSVHuePlane(MonoImage* plane) { - return ReplaceFirstColorPlane(IMAQ_HSV, plane); -} - -/** - * Replace the first Hue plane in a HSI image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSIHuePlane(MonoImage* plane) { - return ReplaceFirstColorPlane(IMAQ_HSI, plane); -} - -/** - * Replace the Saturation color plane in an HSL image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSLSaturationPlane(MonoImage* plane) { - return ReplaceSecondColorPlane(IMAQ_HSL, plane); -} - -/** - * Replace the Saturation color plane in a HSV image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSVSaturationPlane(MonoImage* plane) { - return ReplaceSecondColorPlane(IMAQ_HSV, plane); -} - -/** - * Replace the Saturation color plane in a HSI image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceHSISaturationPlane(MonoImage* plane) { - return ReplaceSecondColorPlane(IMAQ_HSI, plane); -} - -/** - * Replace the Luminance color plane in an HSL image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceLuminancePlane(MonoImage* plane) { - return ReplaceThirdColorPlane(IMAQ_HSL, plane); -} - -/** - * Replace the Value color plane in an HSV with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceValuePlane(MonoImage* plane) { - return ReplaceThirdColorPlane(IMAQ_HSV, plane); -} - -/** - * Replace the Intensity color plane in a HSI image with a MonoImage. - * - * @param mode The color mode in which to operate. - * @param plane A pointer to a MonoImage that will replace the specified color - * plane. - */ -void ColorImage::ReplaceIntensityPlane(MonoImage* plane) { - return ReplaceThirdColorPlane(IMAQ_HSI, plane); -} - -// TODO: frcColorEqualize(Image* dest, const Image* source, int -// colorEqualization) needs to be modified -// The colorEqualization parameter is discarded and is set to TRUE in the call -// to imaqColorEqualize. -void ColorImage::Equalize(bool allPlanes) { - // Note that this call uses NI-defined TRUE and FALSE - int success = imaqColorEqualize(m_imaqImage, - reinterpret_cast(m_imaqImage), - (allPlanes) ? TRUE : FALSE); - wpi_setImaqErrorWithContext(success, "Imaq ColorEqualize error"); -} - -void ColorImage::ColorEqualize() { Equalize(true); } - -void ColorImage::LuminanceEqualize() { Equalize(false); } diff --git a/wpilibc/athena/src/Vision/FrcError.cpp b/wpilibc/athena/src/Vision/FrcError.cpp deleted file mode 100644 index 5eb4def1c7..0000000000 --- a/wpilibc/athena/src/Vision/FrcError.cpp +++ /dev/null @@ -1,2406 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/FrcError.h" - -#include "nivision.h" - -namespace frc { - -/** - * Get the error code returned from the NI Vision library - * @return The last error code. - */ -int GetLastVisionError() { return imaqGetLastError(); } - -/** - * Get the error text for an NI Vision error code. - * - * Note: imaqGetErrorText() is not supported on real time system, so - * so relevant strings are hardcoded here - the maintained version is - * in the LabWindows/CVI help file. - * - * @param errorCode The error code to find the text for. - * @return The error text - */ -const char* GetVisionErrorText(int errorCode) { - const char* errorText; - - switch (errorCode) { - default: { - errorText = "UNKNOWN_ERROR"; - break; - } - case -1074395138: { - errorText = "ERR_OCR_REGION_TOO_SMALL"; - break; - } - case -1074395139: { - errorText = "ERR_IMAQ_QR_DIMENSION_INVALID"; - break; - } - case -1074395140: { - errorText = "ERR_OCR_CHAR_REPORT_CORRUPTED"; - break; - } - case -1074395141: { - errorText = "ERR_OCR_NO_TEXT_FOUND"; - break; - } - case -1074395142: { - errorText = "ERR_QR_DETECTION_MODELTYPE"; - break; - } - case -1074395143: { - errorText = "ERR_QR_DETECTION_MODE"; - break; - } - case -1074395144: { - errorText = "ERR_QR_INVALID_BARCODE"; - break; - } - case -1074395145: { - errorText = "ERR_QR_INVALID_READ"; - break; - } - case -1074395146: { - errorText = "ERR_QR_DETECTION_VERSION"; - break; - } - case -1074395147: { - errorText = "ERR_BARCODE_RSSLIMITED"; - break; - } - case -1074395148: { - errorText = "ERR_OVERLAY_GROUP_NOT_FOUND"; - break; - } - case -1074395149: { - errorText = "ERR_DUPLICATE_TRANSFORM_TYPE"; - break; - } - case -1074395151: { - errorText = "ERR_OCR_CORRECTION_FAILED"; - break; - } - case -1074395155: { - errorText = "ERR_OCR_ORIENT_DETECT_FAILED"; - break; - } - case -1074395156: { - errorText = "ERR_OCR_SKEW_DETECT_FAILED"; - break; - } - case -1074395158: { - errorText = "ERR_OCR_INVALID_CONTRASTMODE"; - break; - } - case -1074395159: { - errorText = "ERR_OCR_INVALID_TOLERANCE"; - break; - } - case -1074395160: { - errorText = "ERR_OCR_INVALID_MAXPOINTSIZE"; - break; - } - case -1074395161: { - errorText = "ERR_OCR_INVALID_CORRECTIONLEVEL"; - break; - } - case -1074395162: { - errorText = "ERR_OCR_INVALID_CORRECTIONMODE"; - break; - } - case -1074395163: { - errorText = "ERR_OCR_INVALID_CHARACTERPREFERENCE"; - break; - } - case -1074395164: { - errorText = "ERR_OCR_ADD_WORD_FAILED"; - break; - } - case -1074395165: { - errorText = "ERR_OCR_WTS_DIR_NOT_FOUND"; - break; - } - case -1074395166: { - errorText = "ERR_OCR_BIN_DIR_NOT_FOUND"; - break; - } - case -1074395167: { - errorText = "ERR_OCR_INVALID_OUTPUTDELIMITER"; - break; - } - case -1074395168: { - errorText = "ERR_OCR_INVALID_AUTOCORRECTIONMODE"; - break; - } - case -1074395169: { - errorText = "ERR_OCR_INVALID_RECOGNITIONMODE"; - break; - } - case -1074395170: { - errorText = "ERR_OCR_INVALID_CHARACTERTYPE"; - break; - } - case -1074395171: { - errorText = "ERR_OCR_INI_FILE_NOT_FOUND"; - break; - } - case -1074395172: { - errorText = "ERR_OCR_INVALID_CHARACTERSET"; - break; - } - case -1074395173: { - errorText = "ERR_OCR_INVALID_LANGUAGE"; - break; - } - case -1074395174: { - errorText = "ERR_OCR_INVALID_AUTOORIENTMODE"; - break; - } - case -1074395175: { - errorText = "ERR_OCR_BAD_USER_DICTIONARY"; - break; - } - case -1074395178: { - errorText = "ERR_OCR_RECOGNITION_FAILED"; - break; - } - case -1074395179: { - errorText = "ERR_OCR_PREPROCESSING_FAILED"; - break; - } - case -1074395200: { - errorText = "ERR_OCR_INVALID_PARAMETER"; - break; - } - case -1074395201: { - errorText = "ERR_OCR_LOAD_LIBRARY"; - break; - } - case -1074395203: { - errorText = "ERR_OCR_LIB_INIT"; - break; - } - case -1074395210: { - errorText = "ERR_OCR_CANNOT_MATCH_TEXT_TEMPLATE"; - break; - } - case -1074395211: { - errorText = "ERR_OCR_BAD_TEXT_TEMPLATE"; - break; - } - case -1074395212: { - errorText = "ERR_OCR_TEMPLATE_WRONG_SIZE"; - break; - } - case -1074395233: { - errorText = "ERR_TEMPLATE_IMAGE_TOO_LARGE"; - break; - } - case -1074395234: { - errorText = "ERR_TEMPLATE_IMAGE_TOO_SMALL"; - break; - } - case -1074395235: { - errorText = "ERR_TEMPLATE_IMAGE_CONTRAST_TOO_LOW"; - break; - } - case -1074395237: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_SHIFT_1"; - break; - } - case -1074395238: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_NOSHIFT"; - break; - } - case -1074395239: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_SHIFT"; - break; - } - case -1074395240: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_ROTATION_1"; - break; - } - case -1074395241: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_NOROTATION"; - break; - } - case -1074395242: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_ROTATION"; - break; - } - case -1074395243: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_4"; - break; - } - case -1074395244: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_3"; - break; - } - case -1074395245: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_2"; - break; - } - case -1074395246: { - errorText = "ERR_TEMPLATE_DESCRIPTOR_1"; - break; - } - case -1074395247: { - errorText = "ERR_TEMPLATE_DESCRIPTOR"; - break; - } - case -1074395248: { - errorText = "ERR_TOO_MANY_ROTATION_ANGLE_RANGES"; - break; - } - case -1074395249: { - errorText = "ERR_ROTATION_ANGLE_RANGE_TOO_LARGE"; - break; - } - case -1074395250: { - errorText = "ERR_MATCH_SETUP_DATA"; - break; - } - case -1074395251: { - errorText = "ERR_INVALID_MATCH_MODE"; - break; - } - case -1074395252: { - errorText = "ERR_LEARN_SETUP_DATA"; - break; - } - case -1074395253: { - errorText = "ERR_INVALID_LEARN_MODE"; - break; - } - case -1074395256: { - errorText = "ERR_EVEN_WINDOW_SIZE"; - break; - } - case -1074395257: { - errorText = "ERR_INVALID_EDGE_DIR"; - break; - } - case -1074395258: { - errorText = "ERR_BAD_FILTER_WIDTH"; - break; - } - case -1074395260: { - errorText = "ERR_HEAP_TRASHED"; - break; - } - case -1074395261: { - errorText = "ERR_GIP_RANGE"; - break; - } - case -1074395262: { - errorText = "ERR_LCD_BAD_MATCH"; - break; - } - case -1074395263: { - errorText = "ERR_LCD_NO_SEGMENTS"; - break; - } - case -1074395265: { - errorText = "ERR_BARCODE"; - break; - } - case -1074395267: { - errorText = "ERR_COMPLEX_ROOT"; - break; - } - case -1074395268: { - errorText = "ERR_LINEAR_COEFF"; - break; - } - case -1074395269: { - errorText = "ERR_NULL_POINTER"; - break; - } - case -1074395270: { - errorText = "ERR_DIV_BY_ZERO"; - break; - } - case -1074395275: { - errorText = "ERR_INVALID_BROWSER_IMAGE"; - break; - } - case -1074395276: { - errorText = "ERR_LINES_PARALLEL"; - break; - } - case -1074395277: { - errorText = "ERR_BARCODE_CHECKSUM"; - break; - } - case -1074395278: { - errorText = "ERR_LCD_NOT_NUMERIC"; - break; - } - case -1074395279: { - errorText = "ERR_ROI_NOT_POLYGON"; - break; - } - case -1074395280: { - errorText = "ERR_ROI_NOT_RECT"; - break; - } - case -1074395281: { - errorText = "ERR_IMAGE_SMALLER_THAN_BORDER"; - break; - } - case -1074395282: { - errorText = "ERR_CANT_DRAW_INTO_VIEWER"; - break; - } - case -1074395283: { - errorText = "ERR_INVALID_RAKE_DIRECTION"; - break; - } - case -1074395284: { - errorText = "ERR_INVALID_EDGE_PROCESS"; - break; - } - case -1074395285: { - errorText = "ERR_INVALID_SPOKE_DIRECTION"; - break; - } - case -1074395286: { - errorText = "ERR_INVALID_CONCENTRIC_RAKE_DIRECTION"; - break; - } - case -1074395287: { - errorText = "ERR_INVALID_LINE"; - break; - } - case -1074395290: { - errorText = "ERR_SHAPEMATCH_BADTEMPLATE"; - break; - } - case -1074395291: { - errorText = "ERR_SHAPEMATCH_BADIMAGEDATA"; - break; - } - case -1074395292: { - errorText = "ERR_POINTS_ARE_COLLINEAR"; - break; - } - case -1074395293: { - errorText = "ERR_CONTOURID_NOT_FOUND"; - break; - } - case -1074395294: { - errorText = "ERR_CONTOUR_INDEX_OUT_OF_RANGE"; - break; - } - case -1074395295: { - errorText = "ERR_INVALID_INTERPOLATIONMETHOD_INTERPOLATEPOINTS"; - break; - } - case -1074395296: { - errorText = "ERR_INVALID_BARCODETYPE"; - break; - } - case -1074395297: { - errorText = "ERR_INVALID_PARTICLEINFOMODE"; - break; - } - case -1074395298: { - errorText = "ERR_COMPLEXPLANE_NOT_REAL_OR_IMAGINARY"; - break; - } - case -1074395299: { - errorText = "ERR_INVALID_COMPLEXPLANE"; - break; - } - case -1074395300: { - errorText = "ERR_INVALID_METERARCMODE"; - break; - } - case -1074395301: { - errorText = "ERR_ROI_NOT_2_LINES"; - break; - } - case -1074395302: { - errorText = "ERR_INVALID_THRESHOLDMETHOD"; - break; - } - case -1074395303: { - errorText = "ERR_INVALID_NUM_OF_CLASSES"; - break; - } - case -1074395304: { - errorText = "ERR_INVALID_MATHTRANSFORMMETHOD"; - break; - } - case -1074395305: { - errorText = "ERR_INVALID_REFERENCEMODE"; - break; - } - case -1074395306: { - errorText = "ERR_INVALID_TOOL"; - break; - } - case -1074395307: { - errorText = "ERR_PRECISION_NOT_GTR_THAN_0"; - break; - } - case -1074395308: { - errorText = "ERR_INVALID_COLORSENSITIVITY"; - break; - } - case -1074395309: { - errorText = "ERR_INVALID_WINDOW_THREAD_POLICY"; - break; - } - case -1074395310: { - errorText = "ERR_INVALID_PALETTE_TYPE"; - break; - } - case -1074395311: { - errorText = "ERR_INVALID_COLOR_SPECTRUM"; - break; - } - case -1074395312: { - errorText = "ERR_LCD_CALIBRATE"; - break; - } - case -1074395313: { - errorText = "ERR_WRITE_FILE_NOT_SUPPORTED"; - break; - } - case -1074395316: { - errorText = "ERR_INVALID_KERNEL_CODE"; - break; - } - case -1074395317: { - errorText = "ERR_UNDEF_POINT"; - break; - } - case -1074395318: { - errorText = "ERR_INSF_POINTS"; - break; - } - case -1074395319: { - errorText = "ERR_INVALID_SUBPIX_TYPE"; - break; - } - case -1074395320: { - errorText = "ERR_TEMPLATE_EMPTY"; - break; - } - case -1074395321: { - errorText = "ERR_INVALID_MORPHOLOGYMETHOD"; - break; - } - case -1074395322: { - errorText = "ERR_INVALID_TEXTALIGNMENT"; - break; - } - case -1074395323: { - errorText = "ERR_INVALID_FONTCOLOR"; - break; - } - case -1074395324: { - errorText = "ERR_INVALID_SHAPEMODE"; - break; - } - case -1074395325: { - errorText = "ERR_INVALID_DRAWMODE"; - break; - } - case -1074395326: { - errorText = "ERR_INVALID_DRAWMODE_FOR_LINE"; - break; - } - case -1074395327: { - errorText = "ERR_INVALID_SCALINGMODE"; - break; - } - case -1074395328: { - errorText = "ERR_INVALID_INTERPOLATIONMETHOD"; - break; - } - case -1074395329: { - errorText = "ERR_INVALID_OUTLINEMETHOD"; - break; - } - case -1074395330: { - errorText = "ERR_INVALID_BORDER_SIZE"; - break; - } - case -1074395331: { - errorText = "ERR_INVALID_BORDERMETHOD"; - break; - } - case -1074395332: { - errorText = "ERR_INVALID_COMPAREFUNCTION"; - break; - } - case -1074395333: { - errorText = "ERR_INVALID_VERTICAL_TEXT_ALIGNMENT"; - break; - } - case -1074395334: { - errorText = "ERR_INVALID_CONVERSIONSTYLE"; - break; - } - case -1074395335: { - errorText = "ERR_DISPATCH_STATUS_CONFLICT"; - break; - } - case -1074395336: { - errorText = "ERR_UNKNOWN_ALGORITHM"; - break; - } - case -1074395340: { - errorText = "ERR_INVALID_SIZETYPE"; - break; - } - case -1074395343: { - errorText = "ERR_FILE_FILENAME_NULL"; - break; - } - case -1074395345: { - errorText = "ERR_INVALID_FLIPAXIS"; - break; - } - case -1074395346: { - errorText = "ERR_INVALID_INTERPOLATIONMETHOD_FOR_ROTATE"; - break; - } - case -1074395347: { - errorText = "ERR_INVALID_3DDIRECTION"; - break; - } - case -1074395348: { - errorText = "ERR_INVALID_3DPLANE"; - break; - } - case -1074395349: { - errorText = "ERR_INVALID_SKELETONMETHOD"; - break; - } - case -1074395350: { - errorText = "ERR_INVALID_VISION_INFO"; - break; - } - case -1074395351: { - errorText = "ERR_INVALID_RECT"; - break; - } - case -1074395352: { - errorText = "ERR_INVALID_FEATURE_MODE"; - break; - } - case -1074395353: { - errorText = "ERR_INVALID_SEARCH_STRATEGY"; - break; - } - case -1074395354: { - errorText = "ERR_INVALID_COLOR_WEIGHT"; - break; - } - case -1074395355: { - errorText = "ERR_INVALID_NUM_MATCHES_REQUESTED"; - break; - } - case -1074395356: { - errorText = "ERR_INVALID_MIN_MATCH_SCORE"; - break; - } - case -1074395357: { - errorText = "ERR_INVALID_COLOR_IGNORE_MODE"; - break; - } - case -1074395360: { - errorText = "ERR_COMPLEX_PLANE"; - break; - } - case -1074395361: { - errorText = "ERR_INVALID_STEEPNESS"; - break; - } - case -1074395362: { - errorText = "ERR_INVALID_WIDTH"; - break; - } - case -1074395363: { - errorText = "ERR_INVALID_SUBSAMPLING_RATIO"; - break; - } - case -1074395364: { - errorText = "ERR_IGNORE_COLOR_SPECTRUM_SET"; - break; - } - case -1074395365: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSPECTRUM"; - break; - } - case -1074395366: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHAPE"; - break; - } - case -1074395367: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_5"; - break; - } - case -1074395368: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_4"; - break; - } - case -1074395369: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_3"; - break; - } - case -1074395370: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_2"; - break; - } - case -1074395371: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_1"; - break; - } - case -1074395372: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_NOROTATION"; - break; - } - case -1074395373: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION"; - break; - } - case -1074395374: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_2"; - break; - } - case -1074395375: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_1"; - break; - } - case -1074395376: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHIFT"; - break; - } - case -1074395377: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT"; - break; - } - case -1074395378: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_6"; - break; - } - case -1074395379: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_5"; - break; - } - case -1074395380: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_4"; - break; - } - case -1074395381: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_3"; - break; - } - case -1074395382: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_2"; - break; - } - case -1074395383: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR_1"; - break; - } - case -1074395384: { - errorText = "ERR_COLOR_TEMPLATE_DESCRIPTOR"; - break; - } - case -1074395385: { - errorText = "ERR_COLOR_ROTATION_REQUIRES_SHAPE_FEATURE"; - break; - } - case -1074395386: { - errorText = "ERR_COLOR_MATCH_SETUP_DATA_SHAPE"; - break; - } - case -1074395387: { - errorText = "ERR_COLOR_MATCH_SETUP_DATA"; - break; - } - case -1074395388: { - errorText = "ERR_COLOR_LEARN_SETUP_DATA_SHAPE"; - break; - } - case -1074395389: { - errorText = "ERR_COLOR_LEARN_SETUP_DATA"; - break; - } - case -1074395390: { - errorText = "ERR_COLOR_TEMPLATE_IMAGE_LUMINANCE_CONTRAST_TOO_LOW"; - break; - } - case -1074395391: { - errorText = "ERR_COLOR_TEMPLATE_IMAGE_HUE_CONTRAST_TOO_LOW"; - break; - } - case -1074395392: { - errorText = "ERR_COLOR_TEMPLATE_IMAGE_TOO_LARGE"; - break; - } - case -1074395393: { - errorText = "ERR_COLOR_TEMPLATE_IMAGE_TOO_SMALL"; - break; - } - case -1074395394: { - errorText = "ERR_COLOR_SPECTRUM_MASK"; - break; - } - case -1074395395: { - errorText = "ERR_COLOR_IMAGE_REQUIRED"; - break; - } - case -1074395397: { - errorText = "ERR_COMPLEX_IMAGE_REQUIRED"; - break; - } - case -1074395399: { - errorText = "ERR_MULTICORE_INVALID_ARGUMENT"; - break; - } - case -1074395400: { - errorText = "ERR_MULTICORE_OPERATION"; - break; - } - case -1074395401: { - errorText = "ERR_INVALID_MATCHFACTOR"; - break; - } - case -1074395402: { - errorText = "ERR_INVALID_MAXPOINTS"; - break; - } - case -1074395403: { - errorText = "ERR_EXTRAINFO_VERSION"; - break; - } - case -1074395404: { - errorText = "ERR_INVALID_INTERPOLATIONMETHOD_FOR_UNWRAP"; - break; - } - case -1074395405: { - errorText = "ERR_INVALID_TEXTORIENTATION"; - break; - } - case -1074395406: { - errorText = "ERR_COORDSYS_NOT_FOUND"; - break; - } - case -1074395407: { - errorText = "ERR_INVALID_CONTRAST"; - break; - } - case -1074395408: { - errorText = "ERR_INVALID_DETECTION_MODE"; - break; - } - case -1074395409: { - errorText = "ERR_INVALID_SUBPIXEL_DIVISIONS"; - break; - } - case -1074395410: { - errorText = "ERR_INVALID_ICONS_PER_LINE"; - break; - } - case -1074395549: { - errorText = "ERR_NIOCR_INVALID_NUMBER_OF_OBJECTS_TO_VERIFY"; - break; - } - case -1074395550: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_VALUE"; - break; - } - case -1074395551: { - errorText = "ERR_NIOCR_RENAME_REFCHAR"; - break; - } - case -1074395552: { - errorText = "ERR_NIOCR_NOT_A_VALID_CHARACTER_SET"; - break; - } - case -1074395553: { - errorText = "ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_HEIGHT"; - break; - } - case -1074395554: { - errorText = "ERR_NIOCR_INVALID_READ_RESOLUTION"; - break; - } - case -1074395555: { - errorText = "ERR_NIOCR_INVALID_SPACING_RANGE"; - break; - } - case -1074395556: { - errorText = "ERR_NIOCR_INVALID_BOUNDING_RECT_HEIGHT_RANGE"; - break; - } - case -1074395557: { - errorText = "ERR_NIOCR_INVALID_BOUNDING_RECT_WIDTH_RANGE"; - break; - } - case -1074395558: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_SIZE_RANGE"; - break; - } - case -1074395559: { - errorText = "ERR_NIOCR_INVALID_READ_OPTION"; - break; - } - case -1074395560: { - errorText = "ERR_NIOCR_INVALID_OBJECT_INDEX"; - break; - } - case -1074395561: { - errorText = "ERR_NIOCR_INVALID_NUMBER_OF_CHARACTERS"; - break; - } - case -1074395562: { - errorText = "ERR_NIOCR_BOOLEAN_VALUE_FOR_STRING_ATTRIBUTE"; - break; - } - case -1074395563: { - errorText = "ERR_NIOCR_UNLICENSED"; - break; - } - case -1074395564: { - errorText = "ERR_NIOCR_INVALID_PREDEFINED_CHARACTER"; - break; - } - case -1074395565: { - errorText = "ERR_NIOCR_MUST_BE_SINGLE_CHARACTER"; - break; - } - case -1074395566: { - errorText = "ERR_NIOCR_BOOLEAN_VALUE_FOR_INTEGER_ATTRIBUTE"; - break; - } - case -1074395567: { - errorText = "ERR_NIOCR_STRING_VALUE_FOR_BOOLEAN_ATTRIBUTE"; - break; - } - case -1074395568: { - errorText = "ERR_NIOCR_STRING_VALUE_FOR_INTEGER_ATTRIBUTE"; - break; - } - case -1074395569: { - errorText = "ERR_NIOCR_INVALID_ATTRIBUTE"; - break; - } - case -1074395570: { - errorText = "ERR_NIOCR_INTEGER_VALUE_FOR_BOOLEAN_ATTRIBUTE"; - break; - } - case -1074395571: { - errorText = "ERR_NIOCR_GET_ONLY_ATTRIBUTE"; - break; - } - case -1074395572: { - errorText = "ERR_NIOCR_INTEGER_VALUE_FOR_STRING_ATTRIBUTE"; - break; - } - case -1074395573: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_SET_FILE_VERSION"; - break; - } - case -1074395574: { - errorText = "ERR_NIOCR_CHARACTER_SET_DESCRIPTION_TOO_LONG"; - break; - } - case -1074395575: { - errorText = "ERR_NIOCR_INVALID_NUMBER_OF_EROSIONS"; - break; - } - case -1074395576: { - errorText = "ERR_NIOCR_CHARACTER_VALUE_TOO_LONG"; - break; - } - case -1074395577: { - errorText = "ERR_NIOCR_CHARACTER_VALUE_CANNOT_BE_EMPTYSTRING"; - break; - } - case -1074395578: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_SET_FILE"; - break; - } - case -1074395579: { - errorText = "ERR_NIOCR_INVALID_ASPECT_RATIO"; - break; - } - case -1074395580: { - errorText = "ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_WIDTH"; - break; - } - case -1074395581: { - errorText = "ERR_NIOCR_INVALID_MAX_VERT_ELEMENT_SPACING"; - break; - } - case -1074395582: { - errorText = "ERR_NIOCR_INVALID_MAX_HORIZ_ELEMENT_SPACING"; - break; - } - case -1074395583: { - errorText = "ERR_NIOCR_INVALID_MIN_CHAR_SPACING"; - break; - } - case -1074395584: { - errorText = "ERR_NIOCR_INVALID_THRESHOLD_LIMITS"; - break; - } - case -1074395585: { - errorText = "ERR_NIOCR_INVALID_UPPER_THRESHOLD_LIMIT"; - break; - } - case -1074395586: { - errorText = "ERR_NIOCR_INVALID_LOWER_THRESHOLD_LIMIT"; - break; - } - case -1074395587: { - errorText = "ERR_NIOCR_INVALID_THRESHOLD_RANGE"; - break; - } - case -1074395588: { - errorText = "ERR_NIOCR_INVALID_HIGH_THRESHOLD_VALUE"; - break; - } - case -1074395589: { - errorText = "ERR_NIOCR_INVALID_LOW_THRESHOLD_VALUE"; - break; - } - case -1074395590: { - errorText = "ERR_NIOCR_INVALID_NUMBER_OF_VALID_CHARACTER_POSITIONS"; - break; - } - case -1074395591: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_INDEX"; - break; - } - case -1074395592: { - errorText = "ERR_NIOCR_INVALID_READ_STRATEGY"; - break; - } - case -1074395593: { - errorText = "ERR_NIOCR_INVALID_NUMBER_OF_BLOCKS"; - break; - } - case -1074395594: { - errorText = "ERR_NIOCR_INVALID_SUBSTITUTION_CHARACTER"; - break; - } - case -1074395595: { - errorText = "ERR_NIOCR_INVALID_THRESHOLD_MODE"; - break; - } - case -1074395596: { - errorText = "ERR_NIOCR_INVALID_CHARACTER_SIZE"; - break; - } - case -1074395597: { - errorText = "ERR_NIOCR_NOT_A_VALID_SESSION"; - break; - } - case -1074395598: { - errorText = "ERR_NIOCR_INVALID_ACCEPTANCE_LEVEL"; - break; - } - case -1074395600: { - errorText = "ERR_INFO_NOT_FOUND"; - break; - } - case -1074395601: { - errorText = "ERR_INVALID_EDGE_THRESHOLD"; - break; - } - case -1074395602: { - errorText = "ERR_INVALID_MINIMUM_CURVE_LENGTH"; - break; - } - case -1074395603: { - errorText = "ERR_INVALID_ROW_STEP"; - break; - } - case -1074395604: { - errorText = "ERR_INVALID_COLUMN_STEP"; - break; - } - case -1074395605: { - errorText = "ERR_INVALID_MAXIMUM_END_POINT_GAP"; - break; - } - case -1074395606: { - errorText = "ERR_INVALID_MINIMUM_FEATURES_TO_MATCH"; - break; - } - case -1074395607: { - errorText = "ERR_INVALID_MAXIMUM_FEATURES_PER_MATCH"; - break; - } - case -1074395608: { - errorText = "ERR_INVALID_SUBPIXEL_ITERATIONS"; - break; - } - case -1074395609: { - errorText = "ERR_INVALID_SUBPIXEL_TOLERANCE"; - break; - } - case -1074395610: { - errorText = "ERR_INVALID_INITIAL_MATCH_LIST_LENGTH"; - break; - } - case -1074395611: { - errorText = "ERR_INVALID_MINIMUM_RECTANGLE_DIMENSION"; - break; - } - case -1074395612: { - errorText = "ERR_INVALID_MINIMUM_FEATURE_RADIUS"; - break; - } - case -1074395613: { - errorText = "ERR_INVALID_MINIMUM_FEATURE_LENGTH"; - break; - } - case -1074395614: { - errorText = "ERR_INVALID_MINIMUM_FEATURE_ASPECT_RATIO"; - break; - } - case -1074395615: { - errorText = "ERR_INVALID_MINIMUM_FEATURE_STRENGTH"; - break; - } - case -1074395616: { - errorText = "ERR_INVALID_EDGE_FILTER_SIZE"; - break; - } - case -1074395617: { - errorText = "ERR_INVALID_NUMBER_OF_FEATURES_RANGE"; - break; - } - case -1074395618: { - errorText = "ERR_TOO_MANY_SCALE_RANGES"; - break; - } - case -1074395619: { - errorText = "ERR_TOO_MANY_OCCLUSION_RANGES"; - break; - } - case -1074395620: { - errorText = "ERR_INVALID_CURVE_EXTRACTION_MODE"; - break; - } - case -1074395621: { - errorText = "ERR_INVALID_LEARN_GEOMETRIC_PATTERN_SETUP_DATA"; - break; - } - case -1074395622: { - errorText = "ERR_INVALID_MATCH_GEOMETRIC_PATTERN_SETUP_DATA"; - break; - } - case -1074395623: { - errorText = "ERR_INVALID_SCALE_RANGE"; - break; - } - case -1074395624: { - errorText = "ERR_INVALID_OCCLUSION_RANGE"; - break; - } - case -1074395625: { - errorText = "ERR_INVALID_MATCH_CONSTRAINT_TYPE"; - break; - } - case -1074395626: { - errorText = "ERR_NOT_ENOUGH_TEMPLATE_FEATURES"; - break; - } - case -1074395627: { - errorText = "ERR_NOT_ENOUGH_TEMPLATE_FEATURES_1"; - break; - } - case -1074395628: { - errorText = "ERR_INVALID_GEOMETRIC_MATCHING_TEMPLATE"; - break; - } - case -1074395629: { - errorText = "ERR_INVALID_MAXIMUM_PIXEL_DISTANCE_FROM_LINE"; - break; - } - case -1074395630: { - errorText = "ERR_INVALID_MAXIMUM_FEATURES_LEARNED"; - break; - } - case -1074395631: { - errorText = "ERR_INVALID_MIN_MATCH_SEPARATION_DISTANCE"; - break; - } - case -1074395632: { - errorText = "ERR_INVALID_MIN_MATCH_SEPARATION_ANGLE"; - break; - } - case -1074395633: { - errorText = "ERR_INVALID_MIN_MATCH_SEPARATION_SCALE"; - break; - } - case -1074395634: { - errorText = "ERR_INVALID_MAX_MATCH_OVERLAP"; - break; - } - case -1074395635: { - errorText = "ERR_INVALID_SHAPE_DESCRIPTOR"; - break; - } - case -1074395636: { - errorText = "ERR_DIRECTX_NOT_FOUND"; - break; - } - case -1074395637: { - errorText = "ERR_HARDWARE_DOESNT_SUPPORT_NONTEARING"; - break; - } - case -1074395638: { - errorText = "ERR_INVALID_FILL_STYLE"; - break; - } - case -1074395639: { - errorText = "ERR_INVALID_HATCH_STYLE"; - break; - } - case -1074395640: { - errorText = "ERR_TOO_MANY_ZONES"; - break; - } - case -1074395641: { - errorText = "ERR_DUPLICATE_LABEL"; - break; - } - case -1074395642: { - errorText = "ERR_LABEL_NOT_FOUND"; - break; - } - case -1074395643: { - errorText = "ERR_INVALID_NUMBER_OF_MATCH_OPTIONS"; - break; - } - case -1074395644: { - errorText = "ERR_LABEL_TOO_LONG"; - break; - } - case -1074395645: { - errorText = "ERR_INVALID_NUMBER_OF_LABELS"; - break; - } - case -1074395646: { - errorText = "ERR_NO_TEMPLATE_TO_LEARN"; - break; - } - case -1074395647: { - errorText = "ERR_INVALID_MULTIPLE_GEOMETRIC_TEMPLATE"; - break; - } - case -1074395648: { - errorText = "ERR_TEMPLATE_NOT_LEARNED"; - break; - } - case -1074395649: { - errorText = "ERR_INVALID_GEOMETRIC_FEATURE_TYPE"; - break; - } - case -1074395650: { - errorText = "ERR_CURVE_EXTRACTION_MODE_MUST_BE_SAME"; - break; - } - case -1074395651: { - errorText = "ERR_EDGE_FILTER_SIZE_MUST_BE_SAME"; - break; - } - case -1074395652: { - errorText = "ERR_OPENING_NEWER_GEOMETRIC_MATCHING_TEMPLATE"; - break; - } - case -1074395653: { - errorText = "ERR_OPENING_NEWER_MULTIPLE_GEOMETRIC_TEMPLATE"; - break; - } - case -1074395654: { - errorText = "ERR_GRADING_INFORMATION_NOT_FOUND"; - break; - } - case -1074395655: { - errorText = "ERR_ENABLE_CALIBRATION_SUPPORT_MUST_BE_SAME"; - break; - } - case -1074395656: { - errorText = "ERR_SMOOTH_CONTOURS_MUST_BE_SAME"; - break; - } - case -1074395700: { - errorText = "ERR_REQUIRES_WIN2000_OR_NEWER"; - break; - } - case -1074395701: { - errorText = "ERR_INVALID_MATRIX_SIZE_RANGE"; - break; - } - case -1074395702: { - errorText = "ERR_INVALID_LENGTH"; - break; - } - case -1074395703: { - errorText = "ERR_INVALID_TYPE_OF_FLATTEN"; - break; - } - case -1074395704: { - errorText = "ERR_INVALID_COMPRESSION_TYPE"; - break; - } - case -1074395705: { - errorText = "ERR_DATA_CORRUPTED"; - break; - } - case -1074395706: { - errorText = "ERR_AVI_SESSION_ALREADY_OPEN"; - break; - } - case -1074395707: { - errorText = "ERR_AVI_WRITE_SESSION_REQUIRED"; - break; - } - case -1074395708: { - errorText = "ERR_AVI_READ_SESSION_REQUIRED"; - break; - } - case -1074395709: { - errorText = "ERR_AVI_UNOPENED_SESSION"; - break; - } - case -1074395710: { - errorText = "ERR_TOO_MANY_PARTICLES"; - break; - } - case -1074395711: { - errorText = "ERR_NOT_ENOUGH_REGIONS"; - break; - } - case -1074395712: { - errorText = "ERR_WRONG_REGION_TYPE"; - break; - } - case -1074395713: { - errorText = "ERR_VALUE_NOT_IN_ENUM"; - break; - } - case -1074395714: { - errorText = "ERR_INVALID_AXIS_ORIENTATION"; - break; - } - case -1074395715: { - errorText = "ERR_INVALID_CALIBRATION_UNIT"; - break; - } - case -1074395716: { - errorText = "ERR_INVALID_SCALING_METHOD"; - break; - } - case -1074395717: { - errorText = "ERR_INVALID_RANGE"; - break; - } - case -1074395718: { - errorText = "ERR_LAB_VERSION"; - break; - } - case -1074395719: { - errorText = "ERR_BAD_ROI_BOX"; - break; - } - case -1074395720: { - errorText = "ERR_BAD_ROI"; - break; - } - case -1074395721: { - errorText = "ERR_INVALID_BIT_DEPTH"; - break; - } - case -1074395722: { - errorText = "ERR_CLASSIFIER_CLASSIFY_IMAGE_WITH_CUSTOM_SESSION"; - break; - } - case -1074395723: { - errorText = "ERR_CUSTOMDATA_KEY_NOT_FOUND"; - break; - } - case -1074395724: { - errorText = "ERR_CUSTOMDATA_INVALID_SIZE"; - break; - } - case -1074395725: { - errorText = "ERR_DATA_VERSION"; - break; - } - case -1074395726: { - errorText = "ERR_MATCHFACTOR_OBSOLETE"; - break; - } - case -1074395727: { - errorText = "ERR_UNSUPPORTED_2D_BARCODE_SEARCH_MODE"; - break; - } - case -1074395728: { - errorText = "ERR_INVALID_2D_BARCODE_SEARCH_MODE"; - break; - } - case -1074395754: { - errorText = "ERR_TRIG_TIMEOUT"; - break; - } - case -1074395756: { - errorText = "ERR_DLL_FUNCTION_NOT_FOUND"; - break; - } - case -1074395757: { - errorText = "ERR_DLL_NOT_FOUND"; - break; - } - case -1074395758: { - errorText = "ERR_BOARD_NOT_OPEN"; - break; - } - case -1074395760: { - errorText = "ERR_BOARD_NOT_FOUND"; - break; - } - case -1074395762: { - errorText = "ERR_INVALID_NIBLACK_DEVIATION_FACTOR"; - break; - } - case -1074395763: { - errorText = "ERR_INVALID_NORMALIZATION_METHOD"; - break; - } - case -1074395766: { - errorText = "ERR_DEPRECATED_FUNCTION"; - break; - } - case -1074395767: { - errorText = "ERR_INVALID_ALIGNMENT"; - break; - } - case -1074395768: { - errorText = "ERR_INVALID_SCALE"; - break; - } - case -1074395769: { - errorText = "ERR_INVALID_EDGE_THICKNESS"; - break; - } - case -1074395770: { - errorText = "ERR_INVALID_INSPECTION_TEMPLATE"; - break; - } - case -1074395771: { - errorText = "ERR_OPENING_NEWER_INSPECTION_TEMPLATE"; - break; - } - case -1074395772: { - errorText = "ERR_INVALID_REGISTRATION_METHOD"; - break; - } - case -1074395773: { - errorText = "ERR_NO_DEST_IMAGE"; - break; - } - case -1074395774: { - errorText = "ERR_NO_LABEL"; - break; - } - case -1074395775: { - errorText = "ERR_ROI_HAS_OPEN_CONTOURS"; - break; - } - case -1074395776: { - errorText = "ERR_INVALID_USE_OF_COMPACT_SESSION_FILE"; - break; - } - case -1074395777: { - errorText = "ERR_INCOMPATIBLE_CLASSIFIER_TYPES"; - break; - } - case -1074395778: { - errorText = "ERR_INVALID_KERNEL_SIZE"; - break; - } - case -1074395779: { - errorText = "ERR_CANNOT_COMPACT_UNTRAINED"; - break; - } - case -1074395780: { - errorText = "ERR_INVALID_PARTICLE_TYPE"; - break; - } - case -1074395781: { - errorText = "ERR_CLASSIFIER_INVALID_ENGINE_TYPE"; - break; - } - case -1074395782: { - errorText = "ERR_DESCRIPTION_TOO_LONG"; - break; - } - case -1074395783: { - errorText = "ERR_BAD_SAMPLE_INDEX"; - break; - } - case -1074395784: { - errorText = "ERR_INVALID_LIMITS"; - break; - } - case -1074395785: { - errorText = "ERR_NO_PARTICLE"; - break; - } - case -1074395786: { - errorText = "ERR_INVALID_PARTICLE_OPTIONS"; - break; - } - case -1074395787: { - errorText = "ERR_INVALID_CLASSIFIER_TYPE"; - break; - } - case -1074395788: { - errorText = "ERR_NO_SAMPLES"; - break; - } - case -1074395789: { - errorText = "ERR_OPENING_NEWER_CLASSIFIER_SESSION"; - break; - } - case -1074395790: { - errorText = "ERR_INVALID_DISTANCE_METRIC"; - break; - } - case -1074395791: { - errorText = "ERR_CLASSIFIER_INVALID_SESSION_TYPE"; - break; - } - case -1074395792: { - errorText = "ERR_CLASSIFIER_SESSION_NOT_TRAINED"; - break; - } - case -1074395793: { - errorText = "ERR_INVALID_OPERATION_ON_COMPACT_SESSION_ATTEMPTED"; - break; - } - case -1074395794: { - errorText = "ERR_K_TOO_HIGH"; - break; - } - case -1074395795: { - errorText = "ERR_K_TOO_LOW"; - break; - } - case -1074395796: { - errorText = "ERR_INVALID_KNN_METHOD"; - break; - } - case -1074395797: { - errorText = "ERR_INVALID_CLASSIFIER_SESSION"; - break; - } - case -1074395798: { - errorText = "ERR_INVALID_CUSTOM_SAMPLE"; - break; - } - case -1074395799: { - errorText = "ERR_INTERNAL"; - break; - } - case -1074395800: { - errorText = "ERR_PROTECTION"; - break; - } - case -1074395801: { - errorText = "ERR_TOO_MANY_CONTOURS"; - break; - } - case -1074395837: { - errorText = "ERR_INVALID_COMPRESSION_RATIO"; - break; - } - case -1074395840: { - errorText = "ERR_BAD_INDEX"; - break; - } - case -1074395875: { - errorText = "ERR_BARCODE_PHARMACODE"; - break; - } - case -1074395876: { - errorText = "ERR_UNSUPPORTED_COLOR_MODE"; - break; - } - case -1074395877: { - errorText = "ERR_COLORMODE_REQUIRES_CHANGECOLORSPACE2"; - break; - } - case -1074395878: { - errorText = "ERR_PROP_NODE_WRITE_NOT_SUPPORTED"; - break; - } - case -1074395879: { - errorText = "ERR_BAD_MEASURE"; - break; - } - case -1074395880: { - errorText = "ERR_PARTICLE"; - break; - } - case -1074395920: { - errorText = "ERR_NUMBER_CLASS"; - break; - } - case -1074395953: { - errorText = "ERR_INVALID_WAVELET_TRANSFORM_MODE"; - break; - } - case -1074395954: { - errorText = "ERR_INVALID_QUANTIZATION_STEP_SIZE"; - break; - } - case -1074395955: { - errorText = "ERR_INVALID_MAX_WAVELET_TRANSFORM_LEVEL"; - break; - } - case -1074395956: { - errorText = "ERR_INVALID_QUALITY"; - break; - } - case -1074395957: { - errorText = "ERR_ARRAY_SIZE_MISMATCH"; - break; - } - case -1074395958: { - errorText = "ERR_WINDOW_ID"; - break; - } - case -1074395959: { - errorText = "ERR_CREATE_WINDOW"; - break; - } - case -1074395960: { - errorText = "ERR_INIT"; - break; - } - case -1074395971: { - errorText = "ERR_INVALID_OFFSET"; - break; - } - case -1074395972: { - errorText = "ERR_DIRECTX_ENUMERATE_FILTERS"; - break; - } - case -1074395973: { - errorText = "ERR_JPEG2000_UNSUPPORTED_MULTIPLE_LAYERS"; - break; - } - case -1074395974: { - errorText = "ERR_UNSUPPORTED_JPEG2000_COLORSPACE_METHOD"; - break; - } - case -1074395975: { - errorText = "ERR_AVI_TIMEOUT"; - break; - } - case -1074395976: { - errorText = "ERR_NUMBER_OF_PALETTE_COLORS"; - break; - } - case -1074395977: { - errorText = "ERR_AVI_VERSION"; - break; - } - case -1074395978: { - errorText = "ERR_INVALID_PARTICLE_NUMBER"; - break; - } - case -1074395979: { - errorText = "ERR_INVALID_PARTICLE_INFO"; - break; - } - case -1074395980: { - errorText = "ERR_COM_INITIALIZE"; - break; - } - case -1074395981: { - errorText = "ERR_INSUFFICIENT_BUFFER_SIZE"; - break; - } - case -1074395982: { - errorText = "ERR_INVALID_FRAMES_PER_SECOND"; - break; - } - case -1074395983: { - errorText = "ERR_FILE_NO_SPACE"; - break; - } - case -1074395984: { - errorText = "ERR_FILE_INVALID_DATA_TYPE"; - break; - } - case -1074395985: { - errorText = "ERR_FILE_OPERATION"; - break; - } - case -1074395986: { - errorText = "ERR_FILE_FORMAT"; - break; - } - case -1074395987: { - errorText = "ERR_FILE_EOF"; - break; - } - case -1074395988: { - errorText = "ERR_FILE_WRITE"; - break; - } - case -1074395989: { - errorText = "ERR_FILE_READ"; - break; - } - case -1074395990: { - errorText = "ERR_FILE_GET_INFO"; - break; - } - case -1074395991: { - errorText = "ERR_FILE_INVALID_TYPE"; - break; - } - case -1074395992: { - errorText = "ERR_FILE_PERMISSION"; - break; - } - case -1074395993: { - errorText = "ERR_FILE_IO_ERR"; - break; - } - case -1074395994: { - errorText = "ERR_FILE_TOO_MANY_OPEN"; - break; - } - case -1074395995: { - errorText = "ERR_FILE_NOT_FOUND"; - break; - } - case -1074395996: { - errorText = "ERR_FILE_OPEN"; - break; - } - case -1074395997: { - errorText = "ERR_FILE_ARGERR"; - break; - } - case -1074395998: { - errorText = "ERR_FILE_COLOR_TABLE"; - break; - } - case -1074395999: { - errorText = "ERR_FILE_FILE_TYPE"; - break; - } - case -1074396000: { - errorText = "ERR_FILE_FILE_HEADER"; - break; - } - case -1074396001: { - errorText = "ERR_TOO_MANY_AVI_SESSIONS"; - break; - } - case -1074396002: { - errorText = "ERR_INVALID_LINEGAUGEMETHOD"; - break; - } - case -1074396003: { - errorText = "ERR_AVI_DATA_EXCEEDS_BUFFER_SIZE"; - break; - } - case -1074396004: { - errorText = "ERR_DIRECTX_CERTIFICATION_FAILURE"; - break; - } - case -1074396005: { - errorText = "ERR_INVALID_AVI_SESSION"; - break; - } - case -1074396006: { - errorText = "ERR_DIRECTX_UNKNOWN_COMPRESSION_FILTER"; - break; - } - case -1074396007: { - errorText = "ERR_DIRECTX_INCOMPATIBLE_COMPRESSION_FILTER"; - break; - } - case -1074396008: { - errorText = "ERR_DIRECTX_NO_FILTER"; - break; - } - case -1074396009: { - errorText = "ERR_DIRECTX"; - break; - } - case -1074396010: { - errorText = "ERR_INVALID_FRAME_NUMBER"; - break; - } - case -1074396011: { - errorText = "ERR_RPC_BIND"; - break; - } - case -1074396012: { - errorText = "ERR_RPC_EXECUTE"; - break; - } - case -1074396013: { - errorText = "ERR_INVALID_VIDEO_MODE"; - break; - } - case -1074396014: { - errorText = "ERR_INVALID_VIDEO_BLIT"; - break; - } - case -1074396015: { - errorText = "ERR_RPC_EXECUTE_IVB"; - break; - } - case -1074396016: { - errorText = "ERR_NO_VIDEO_DRIVER"; - break; - } - case -1074396017: { - errorText = "ERR_OPENING_NEWER_AIM_GRADING_DATA"; - break; - } - case -1074396018: { - errorText = "ERR_INVALID_EDGE_POLARITY_SEARCH_MODE"; - break; - } - case -1074396019: { - errorText = "ERR_INVALID_THRESHOLD_PERCENTAGE"; - break; - } - case -1074396020: { - errorText = "ERR_INVALID_GRADING_MODE"; - break; - } - case -1074396021: { - errorText = "ERR_INVALID_KERNEL_SIZE_FOR_EDGE_DETECTION"; - break; - } - case -1074396022: { - errorText = "ERR_INVALID_SEARCH_MODE_FOR_STRAIGHT_EDGE"; - break; - } - case -1074396023: { - errorText = "ERR_INVALID_ANGLE_TOL_FOR_STRAIGHT_EDGE"; - break; - } - case -1074396024: { - errorText = "ERR_INVALID_MIN_COVERAGE_FOR_STRAIGHT_EDGE"; - break; - } - case -1074396025: { - errorText = "ERR_INVALID_ANGLE_RANGE_FOR_STRAIGHT_EDGE"; - break; - } - case -1074396026: { - errorText = "ERR_INVALID_PROCESS_TYPE_FOR_EDGE_DETECTION"; - break; - } - case -1074396032: { - errorText = "ERR_TEMPLATEDESCRIPTOR_ROTATION_SEARCHSTRATEGY"; - break; - } - case -1074396033: { - errorText = "ERR_TEMPLATEDESCRIPTOR_LEARNSETUPDATA"; - break; - } - case -1074396034: { - errorText = "ERR_TEMPLATEIMAGE_EDGEINFO"; - break; - } - case -1074396035: { - errorText = "ERR_TEMPLATEIMAGE_NOCIRCLE"; - break; - } - case -1074396036: { - errorText = "ERR_INVALID_SKELETONMODE"; - break; - } - case -1074396037: { - errorText = "ERR_TIMEOUT"; - break; - } - case -1074396038: { - errorText = "ERR_FIND_COORDSYS_MORE_THAN_ONE_EDGE"; - break; - } - case -1074396039: { - errorText = "ERR_IO_ERROR"; - break; - } - case -1074396040: { - errorText = "ERR_DRIVER"; - break; - } - case -1074396041: { - errorText = "ERR_INVALID_2D_BARCODE_TYPE"; - break; - } - case -1074396042: { - errorText = "ERR_INVALID_2D_BARCODE_CONTRAST"; - break; - } - case -1074396043: { - errorText = "ERR_INVALID_2D_BARCODE_CELL_SHAPE"; - break; - } - case -1074396044: { - errorText = "ERR_INVALID_2D_BARCODE_SHAPE"; - break; - } - case -1074396045: { - errorText = "ERR_INVALID_2D_BARCODE_SUBTYPE"; - break; - } - case -1074396046: { - errorText = "ERR_INVALID_2D_BARCODE_CONTRAST_FOR_ROI"; - break; - } - case -1074396047: { - errorText = "ERR_INVALID_LINEAR_AVERAGE_MODE"; - break; - } - case -1074396048: { - errorText = "ERR_INVALID_CELL_SAMPLE_SIZE"; - break; - } - case -1074396049: { - errorText = "ERR_INVALID_MATRIX_POLARITY"; - break; - } - case -1074396050: { - errorText = "ERR_INVALID_ECC_TYPE"; - break; - } - case -1074396051: { - errorText = "ERR_INVALID_CELL_FILTER_MODE"; - break; - } - case -1074396052: { - errorText = "ERR_INVALID_DEMODULATION_MODE"; - break; - } - case -1074396053: { - errorText = "ERR_INVALID_BORDER_INTEGRITY"; - break; - } - case -1074396054: { - errorText = "ERR_INVALID_CELL_FILL_TYPE"; - break; - } - case -1074396055: { - errorText = "ERR_INVALID_ASPECT_RATIO"; - break; - } - case -1074396056: { - errorText = "ERR_INVALID_MATRIX_MIRROR_MODE"; - break; - } - case -1074396057: { - errorText = "ERR_INVALID_SEARCH_VECTOR_WIDTH"; - break; - } - case -1074396058: { - errorText = "ERR_INVALID_ROTATION_MODE"; - break; - } - case -1074396059: { - errorText = "ERR_INVALID_MAX_ITERATIONS"; - break; - } - case -1074396060: { - errorText = "ERR_JPEG2000_LOSSLESS_WITH_FLOATING_POINT"; - break; - } - case -1074396061: { - errorText = "ERR_INVALID_WINDOW_SIZE"; - break; - } - case -1074396062: { - errorText = "ERR_INVALID_TOLERANCE"; - break; - } - case -1074396063: { - errorText = "ERR_EXTERNAL_ALIGNMENT"; - break; - } - case -1074396064: { - errorText = "ERR_EXTERNAL_NOT_SUPPORTED"; - break; - } - case -1074396065: { - errorText = "ERR_CANT_RESIZE_EXTERNAL"; - break; - } - case -1074396066: { - errorText = "ERR_INVALID_POINTSYMBOL"; - break; - } - case -1074396067: { - errorText = "ERR_IMAGES_NOT_DIFF"; - break; - } - case -1074396068: { - errorText = "ERR_INVALID_ACTION"; - break; - } - case -1074396069: { - errorText = "ERR_INVALID_COLOR_MODE"; - break; - } - case -1074396070: { - errorText = "ERR_INVALID_FUNCTION"; - break; - } - case -1074396071: { - errorText = "ERR_INVALID_SCAN_DIRECTION"; - break; - } - case -1074396072: { - errorText = "ERR_INVALID_BORDER"; - break; - } - case -1074396073: { - errorText = "ERR_MASK_OUTSIDE_IMAGE"; - break; - } - case -1074396074: { - errorText = "ERR_INCOMP_SIZE"; - break; - } - case -1074396075: { - errorText = "ERR_COORD_SYS_SECOND_AXIS"; - break; - } - case -1074396076: { - errorText = "ERR_COORD_SYS_FIRST_AXIS"; - break; - } - case -1074396077: { - errorText = "ERR_INCOMP_TYPE"; - break; - } - case -1074396079: { - errorText = "ERR_INVALID_METAFILE_HANDLE"; - break; - } - case -1074396080: { - errorText = "ERR_INVALID_IMAGE_TYPE"; - break; - } - case -1074396081: { - errorText = "ERR_BAD_PASSWORD"; - break; - } - case -1074396082: { - errorText = "ERR_PALETTE_NOT_SUPPORTED"; - break; - } - case -1074396083: { - errorText = "ERR_ROLLBACK_TIMEOUT"; - break; - } - case -1074396084: { - errorText = "ERR_ROLLBACK_DELETE_TIMER"; - break; - } - case -1074396085: { - errorText = "ERR_ROLLBACK_INIT_TIMER"; - break; - } - case -1074396086: { - errorText = "ERR_ROLLBACK_START_TIMER"; - break; - } - case -1074396087: { - errorText = "ERR_ROLLBACK_STOP_TIMER"; - break; - } - case -1074396088: { - errorText = "ERR_ROLLBACK_RESIZE"; - break; - } - case -1074396089: { - errorText = "ERR_ROLLBACK_RESOURCE_REINITIALIZE"; - break; - } - case -1074396090: { - errorText = "ERR_ROLLBACK_RESOURCE_ENABLED"; - break; - } - case -1074396091: { - errorText = "ERR_ROLLBACK_RESOURCE_UNINITIALIZED_ENABLE"; - break; - } - case -1074396092: { - errorText = "ERR_ROLLBACK_RESOURCE_NON_EMPTY_INITIALIZE"; - break; - } - case -1074396093: { - errorText = "ERR_ROLLBACK_RESOURCE_LOCKED"; - break; - } - case -1074396094: { - errorText = "ERR_ROLLBACK_RESOURCE_CANNOT_UNLOCK"; - break; - } - case -1074396095: { - errorText = "ERR_CALIBRATION_DUPLICATE_REFERENCE_POINT"; - break; - } - case -1074396096: { - errorText = "ERR_NOT_AN_OBJECT"; - break; - } - case -1074396097: { - errorText = "ERR_INVALID_PARTICLE_PARAMETER_VALUE"; - break; - } - case -1074396098: { - errorText = "ERR_RESERVED_MUST_BE_NULL"; - break; - } - case -1074396099: { - errorText = "ERR_CALIBRATION_INFO_SIMPLE_TRANSFORM"; - break; - } - case -1074396100: { - errorText = "ERR_CALIBRATION_INFO_PERSPECTIVE_PROJECTION"; - break; - } - case -1074396101: { - errorText = "ERR_CALIBRATION_INFO_MICRO_PLANE"; - break; - } - case -1074396102: { - errorText = "ERR_CALIBRATION_INFO_6"; - break; - } - case -1074396103: { - errorText = "ERR_CALIBRATION_INFO_5"; - break; - } - case -1074396104: { - errorText = "ERR_CALIBRATION_INFO_4"; - break; - } - case -1074396105: { - errorText = "ERR_CALIBRATION_INFO_3"; - break; - } - case -1074396106: { - errorText = "ERR_CALIBRATION_INFO_2"; - break; - } - case -1074396107: { - errorText = "ERR_CALIBRATION_INFO_1"; - break; - } - case -1074396108: { - errorText = "ERR_CALIBRATION_ERRORMAP"; - break; - } - case -1074396109: { - errorText = "ERR_CALIBRATION_INVALID_SCALING_FACTOR"; - break; - } - case -1074396110: { - errorText = "ERR_CALIBRATION_INFO_VERSION"; - break; - } - case -1074396111: { - errorText = "ERR_CALIBRATION_FAILED_TO_FIND_GRID"; - break; - } - case -1074396112: { - errorText = "ERR_INCOMP_MATRIX_SIZE"; - break; - } - case -1074396113: { - errorText = "ERR_CALIBRATION_IMAGE_UNCALIBRATED"; - break; - } - case -1074396114: { - errorText = "ERR_CALIBRATION_INVALID_ROI"; - break; - } - case -1074396115: { - errorText = "ERR_CALIBRATION_IMAGE_CORRECTED"; - break; - } - case -1074396116: { - errorText = "ERR_CALIBRATION_INSF_POINTS"; - break; - } - case -1074396117: { - errorText = "ERR_MATRIX_SIZE"; - break; - } - case -1074396118: { - errorText = "ERR_INVALID_STEP_SIZE"; - break; - } - case -1074396119: { - errorText = "ERR_CUSTOMDATA_INVALID_KEY"; - break; - } - case -1074396120: { - errorText = "ERR_NOT_IMAGE"; - break; - } - case -1074396121: { - errorText = "ERR_SATURATION_THRESHOLD_OUT_OF_RANGE"; - break; - } - case -1074396122: { - errorText = "ERR_DRAWTEXT_COLOR_MUST_BE_GRAYSCALE"; - break; - } - case -1074396123: { - errorText = "ERR_INVALID_CALIBRATION_MODE"; - break; - } - case -1074396124: { - errorText = "ERR_INVALID_CALIBRATION_ROI_MODE"; - break; - } - case -1074396125: { - errorText = "ERR_INVALID_CONTRAST_THRESHOLD"; - break; - } - case -1074396126: { - errorText = "ERR_ROLLBACK_RESOURCE_CONFLICT_1"; - break; - } - case -1074396127: { - errorText = "ERR_ROLLBACK_RESOURCE_CONFLICT_2"; - break; - } - case -1074396128: { - errorText = "ERR_ROLLBACK_RESOURCE_CONFLICT_3"; - break; - } - case -1074396129: { - errorText = "ERR_ROLLBACK_UNBOUNDED_INTERFACE"; - break; - } - case -1074396130: { - errorText = "ERR_NOT_RECT_OR_ROTATED_RECT"; - break; - } - case -1074396132: { - errorText = "ERR_MASK_NOT_TEMPLATE_SIZE"; - break; - } - case -1074396133: { - errorText = "ERR_THREAD_COULD_NOT_INITIALIZE"; - break; - } - case -1074396134: { - errorText = "ERR_THREAD_INITIALIZING"; - break; - } - case -1074396135: { - errorText = "ERR_INVALID_BUTTON_LABEL"; - break; - } - case -1074396136: { - errorText = "ERR_DIRECTX_INVALID_FILTER_QUALITY"; - break; - } - case -1074396137: { - errorText = "ERR_DIRECTX_DLL_NOT_FOUND"; - break; - } - case -1074396138: { - errorText = "ERR_ROLLBACK_NOT_SUPPORTED"; - break; - } - case -1074396139: { - errorText = "ERR_ROLLBACK_RESOURCE_OUT_OF_MEMORY"; - break; - } - case -1074396140: { - errorText = "ERR_BARCODE_CODE128_SET"; - break; - } - case -1074396141: { - errorText = "ERR_BARCODE_CODE128_FNC"; - break; - } - case -1074396142: { - errorText = "ERR_BARCODE_INVALID"; - break; - } - case -1074396143: { - errorText = "ERR_BARCODE_TYPE"; - break; - } - case -1074396144: { - errorText = "ERR_BARCODE_CODE93_SHIFT"; - break; - } - case -1074396145: { - errorText = "ERR_BARCODE_UPCA"; - break; - } - case -1074396146: { - errorText = "ERR_BARCODE_MSI"; - break; - } - case -1074396147: { - errorText = "ERR_BARCODE_I25"; - break; - } - case -1074396148: { - errorText = "ERR_BARCODE_EAN13"; - break; - } - case -1074396149: { - errorText = "ERR_BARCODE_EAN8"; - break; - } - case -1074396150: { - errorText = "ERR_BARCODE_CODE128"; - break; - } - case -1074396151: { - errorText = "ERR_BARCODE_CODE93"; - break; - } - case -1074396152: { - errorText = "ERR_BARCODE_CODE39"; - break; - } - case -1074396153: { - errorText = "ERR_BARCODE_CODABAR"; - break; - } - case -1074396154: { - errorText = "ERR_IMAGE_TOO_SMALL"; - break; - } - case -1074396155: { - errorText = "ERR_UNINIT"; - break; - } - case -1074396156: { - errorText = "ERR_NEED_FULL_VERSION"; - break; - } - case -1074396157: { - errorText = "ERR_UNREGISTERED"; - break; - } - case -1074396158: { - errorText = "ERR_MEMORY_ERROR"; - break; - } - case -1074396159: { - errorText = "ERR_OUT_OF_MEMORY"; - break; - } - case -1074396160: { - errorText = "ERR_SYSTEM_ERROR"; - break; - } - case 0: { - errorText = "ERR_SUCCESS"; - break; - } - // end National Instruments defined errors - - // begin BAE defined errors - case ERR_VISION_GENERAL_ERROR: { - errorText = "ERR_VISION_GENERAL_ERROR"; - break; - } - case ERR_COLOR_NOT_FOUND: { - errorText = "ERR_COLOR_NOT_FOUND"; - break; - } - case ERR_PARTICLE_TOO_SMALL: { - errorText = "ERR_PARTICLE_TOO_SMALL"; - break; - } - case ERR_CAMERA_FAILURE: { - errorText = "ERR_CAMERA_FAILURE"; - break; - } - case ERR_CAMERA_SOCKET_CREATE_FAILED: { - errorText = "ERR_CAMERA_SOCKET_CREATE_FAILED"; - break; - } - case ERR_CAMERA_CONNECT_FAILED: { - errorText = "ERR_CAMERA_CONNECT_FAILED"; - break; - } - case ERR_CAMERA_STALE_IMAGE: { - errorText = "ERR_CAMERA_STALE_IMAGE"; - break; - } - case ERR_CAMERA_NOT_INITIALIZED: { - errorText = "ERR_CAMERA_NOT_INITIALIZED"; - break; - } - case ERR_CAMERA_NO_BUFFER_AVAILABLE: { - errorText = "ERR_CAMERA_NO_BUFFER_AVAILABLE"; - break; - } - case ERR_CAMERA_HEADER_ERROR: { - errorText = "ERR_CAMERA_HEADER_ERROR"; - break; - } - case ERR_CAMERA_BLOCKING_TIMEOUT: { - errorText = "ERR_CAMERA_BLOCKING_TIMEOUT"; - break; - } - case ERR_CAMERA_AUTHORIZATION_FAILED: { - errorText = "ERR_CAMERA_AUTHORIZATION_FAILED"; - break; - } - case ERR_CAMERA_TASK_SPAWN_FAILED: { - errorText = "ERR_CAMERA_TASK_SPAWN_FAILED"; - break; - } - case ERR_CAMERA_TASK_INPUT_OUT_OF_RANGE: { - errorText = "ERR_CAMERA_TASK_INPUT_OUT_OF_RANGE"; - break; - } - case ERR_CAMERA_COMMAND_FAILURE: { - errorText = "ERR_CAMERA_COMMAND_FAILURE"; - break; - } - } - - return errorText; -} // NOLINT - -} // namespace frc diff --git a/wpilibc/athena/src/Vision/HSLImage.cpp b/wpilibc/athena/src/Vision/HSLImage.cpp deleted file mode 100644 index bcc2b71e76..0000000000 --- a/wpilibc/athena/src/Vision/HSLImage.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/HSLImage.h" - -using namespace frc; - -/** - * Create a new image that uses the Hue, Saturation, and Luminance planes. - */ -HSLImage::HSLImage() : ColorImage(IMAQ_IMAGE_HSL) {} - -/** - * Create a new image by loading a file. - * - * @param fileName The path of the file to load. - */ -HSLImage::HSLImage(const char* fileName) : ColorImage(IMAQ_IMAGE_HSL) { - int success = imaqReadFile(m_imaqImage, fileName, nullptr, nullptr); - wpi_setImaqErrorWithContext(success, "Imaq ReadFile error"); -} diff --git a/wpilibc/athena/src/Vision/ImageBase.cpp b/wpilibc/athena/src/Vision/ImageBase.cpp deleted file mode 100644 index 45dba24f4a..0000000000 --- a/wpilibc/athena/src/Vision/ImageBase.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/ImageBase.h" - -#include "nivision.h" - -using namespace frc; - -/** - * Create a new instance of an ImageBase. - * - * ImageBase is the base of all the other image classes. The constructor - * creates any type of image and stores the pointer to it in the class. - * - * @param type The type of image to create - */ -ImageBase::ImageBase(ImageType type) { - m_imaqImage = imaqCreateImage(type, DEFAULT_BORDER_SIZE); -} - -/** - * Frees memory associated with an ImageBase. - * - * Destructor frees the imaq image allocated with the class. - */ -ImageBase::~ImageBase() { - if (m_imaqImage) imaqDispose(m_imaqImage); -} - -/** - * Writes an image to a file with the given filename. - * - * @param fileName The name of the file to write - */ -void ImageBase::Write(const char* fileName) { - int success = imaqWriteFile(m_imaqImage, fileName, nullptr); - wpi_setImaqErrorWithContext(success, "Imaq Image writeFile error"); -} - -/** - * Gets the height of an image. - * - * @return The height of the image in pixels. - */ -int ImageBase::GetHeight() { - int height; - imaqGetImageSize(m_imaqImage, nullptr, &height); - return height; -} - -/** - * Gets the width of an image. - * - * @return The width of the image in pixels. - */ -int ImageBase::GetWidth() { - int width; - imaqGetImageSize(m_imaqImage, &width, nullptr); - return width; -} - -/** - * Access the internal IMAQ Image data structure. - * - * @return A pointer to the internal IMAQ Image data structure. - */ -Image* ImageBase::GetImaqImage() { return m_imaqImage; } diff --git a/wpilibc/athena/src/Vision/MonoImage.cpp b/wpilibc/athena/src/Vision/MonoImage.cpp deleted file mode 100644 index 436ccd9b51..0000000000 --- a/wpilibc/athena/src/Vision/MonoImage.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/MonoImage.h" - -#include "nivision.h" - -using namespace frc; - -MonoImage::MonoImage() : ImageBase(IMAQ_IMAGE_U8) {} - -/** - * Look for ellipses in an image. - * - * Given some input parameters, look for any number of ellipses in an image. - * - * @param ellipseDescriptor Ellipse descriptor - * @param curveOptions Curve options - * @param shapeDetectionOptions Shape detection options - * @param roi Region of Interest - * @returns a vector of EllipseMatch structures (0 length vector on no match) - */ -std::vector* MonoImage::DetectEllipses( - EllipseDescriptor* ellipseDescriptor, CurveOptions* curveOptions, - ShapeDetectionOptions* shapeDetectionOptions, ROI* roi) { - int numberOfMatches; - EllipseMatch* e = - imaqDetectEllipses(m_imaqImage, ellipseDescriptor, curveOptions, - shapeDetectionOptions, roi, &numberOfMatches); - auto ellipses = new std::vector; - if (e == nullptr) { - return ellipses; - } - for (int i = 0; i < numberOfMatches; i++) { - ellipses->push_back(e[i]); - } - imaqDispose(e); - return ellipses; -} - -std::vector* MonoImage::DetectEllipses( - EllipseDescriptor* ellipseDescriptor) { - std::vector* ellipses = - DetectEllipses(ellipseDescriptor, nullptr, nullptr, nullptr); - return ellipses; -} diff --git a/wpilibc/athena/src/Vision/RGBImage.cpp b/wpilibc/athena/src/Vision/RGBImage.cpp deleted file mode 100644 index 53ea564bbc..0000000000 --- a/wpilibc/athena/src/Vision/RGBImage.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/RGBImage.h" - -using namespace frc; - -/** - * Create a new image that uses Red, Green, and Blue planes. - */ -RGBImage::RGBImage() : ColorImage(IMAQ_IMAGE_RGB) {} - -/** - * Create a new image by loading a file. - * - * @param fileName The path of the file to load. - */ -RGBImage::RGBImage(const char* fileName) : ColorImage(IMAQ_IMAGE_RGB) { - int success = imaqReadFile(m_imaqImage, fileName, nullptr, nullptr); - wpi_setImaqErrorWithContext(success, "Imaq ReadFile error"); -} diff --git a/wpilibc/athena/src/Vision/Threshold.cpp b/wpilibc/athena/src/Vision/Threshold.cpp deleted file mode 100644 index 22e8970406..0000000000 --- a/wpilibc/athena/src/Vision/Threshold.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/Threshold.h" - -using namespace frc; - -Threshold::Threshold(int new_plane1Low, int new_plane1High, int new_plane2Low, - int new_plane2High, int new_plane3Low, - int new_plane3High) { - plane1Low = new_plane1Low; - plane1High = new_plane1High; - plane2Low = new_plane2Low; - plane2High = new_plane2High; - plane3Low = new_plane3Low; - plane3High = new_plane3High; -} diff --git a/wpilibc/athena/src/Vision/VisionAPI.cpp b/wpilibc/athena/src/Vision/VisionAPI.cpp deleted file mode 100644 index ab7bbc8f07..0000000000 --- a/wpilibc/athena/src/Vision/VisionAPI.cpp +++ /dev/null @@ -1,833 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "Vision/VisionAPI.h" - -#include - -#include "Vision/BaeUtilities.h" -#include "Vision/FrcError.h" - -namespace frc { - -int VisionAPI_debugFlag = 1; -#define DPRINTF \ - if (VisionAPI_debugFlag) dprintf - -/** @file - * Image Management functions - */ - -/** - * @brief Create an image object - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, - * IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64 - * The border size is defaulted to 3 so that convolutional algorithms work at - * the edges. - * When you are finished with the created image, dispose of it by calling - * frcDispose(). - * To get extended error information, call GetLastError(). - * - * @param type Type of image to create - * @return Image* On success, this function returns the created image. On - * failure, it returns nullptr. - */ -Image* frcCreateImage(ImageType type) { - return imaqCreateImage(type, DEFAULT_BORDER_SIZE); -} - -/** - * @brief Dispose of one object. Supports any object created on the heap. - * - * @param object object to dispose of - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcDispose(void* object) { return imaqDispose(object); } - -/** - * @brief Dispose of a list of objects. Supports any object created on the heap. - * - * @param functionName The name of the function - * @param ... A list of pointers to structures that need to be - * disposed of. The last pointer in the list should always - * be set to nullptr. - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcDispose(const char* functionName, ...) { - va_list disposalPtrList; /* Input argument list */ - void* disposalPtr; /* For iteration */ - int success, returnValue = 1; - - va_start(disposalPtrList, functionName); /* start of variable list */ - disposalPtr = va_arg(disposalPtrList, void*); - while (disposalPtr != nullptr) { - success = imaqDispose(disposalPtr); - if (!success) { - returnValue = 0; - } - disposalPtr = va_arg(disposalPtrList, void*); - } - va_end(disposalPtrList); - return returnValue; -} - -/** - * @brief Copy an image object. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB, - * IMAQ_IMAGE_HSL. - * - * @param dest Copy of image. On failure, dest is nullptr. Must have already - * been created using frcCreateImage(). When you are finished with - * the created image, dispose of it by calling frcDispose(). - * @param source Image to copy - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcCopyImage(Image* dest, const Image* source) { - return imaqDuplicate(dest, source); -} - -/** - * @brief Crop image without changing the scale. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB, - * IMAQ_IMAGE_HSL. - * - * @param dest Modified image - * @param source Image to crop - * @param rect region to process, or IMAQ_NO_RECT - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcCrop(Image* dest, const Image* source, Rect rect) { - return imaqScale(dest, source, 1, 1, IMAQ_SCALE_LARGER, rect); -} - -/** - * @brief Scales the entire image larger or smaller. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB, - * IMAQ_IMAGE_HSL. - * - * @param dest Modified image - * @param source Image to scale - * @param xScale the horizontal reduction ratio - * @param yScale the vertical reduction ratio - * @param scaleMode IMAQ_SCALE_LARGER or IMAQ_SCALE_SMALLER - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcScale(Image* dest, const Image* source, int xScale, int yScale, - ScalingMode scaleMode) { - Rect rect = IMAQ_NO_RECT; - return imaqScale(dest, source, xScale, yScale, scaleMode, rect); -} - -/** - * @brief Creates image object from the information in a file. The file can be - * in one of the following formats: - * PNG, JPEG, JPEG2000, TIFF, AIPD, or BMP. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, - * IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64. - * - * @param image Image read in - * @param fileName File to read. Cannot be nullptr - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcReadImage(Image* image, const char* fileName) { - return imaqReadFile(image, fileName, nullptr, nullptr); -} - -/** - * @brief Write image to a file. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, - * IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64. - * - * The file type is determined by the extension, as follows: - * - * Extension File Type - * aipd or .apd AIPD - * .bmp BMP - * .jpg or .jpeg JPEG - * .jp2 JPEG2000 - * .png PNG - * .tif or .tiff TIFF - * - * - * The following are the supported image types for each file type: - * - * File Types Image Types - * AIPD all image types - * BMP, JPEG 8-bit, RGB - * PNG, TIFF, JPEG2000 8-bit, 16-bit, RGB, RGBU64 - * - * @param image Image to write - * @param fileName File to read. Cannot be nullptr. The extension determines the - * file format that is written. - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcWriteImage(const Image* image, const char* fileName) { - RGBValue* colorTable = nullptr; - return imaqWriteFile(image, fileName, colorTable); -} - -/* Measure Intensity functions */ - -/** - * @brief Measures the pixel intensities in a rectangle of an image. - * Outputs intensity based statistics about an image such as Max, Min, Mean and - * Std Dev of pixel value. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL. - * - * Parameter Discussion: - * Relevant parameters of the HistogramReport include: - * min, max, mean and stdDev - * - * min/max: Setting both min and max to 0 causes the function to set min to 0 - * and the max to 255 for 8-bit images and to the actual minimum value and - * maximum value of the image for all other image types. - * - * @param image Image whose histogram the function calculates. - * @param numClasses The number of classes into which the function separates the - * pixels. Determines the number of elements in the histogram - * array returned - * @param min The minimum pixel value to consider for the histogram. The - * function does not count pixels with values less than min. - * @param max The maximum pixel value to consider for the histogram. The - * function does not count pixels with values greater than - * max. - * @param rect Region of interest in the image. If not included, the - * entire image is used. - * @return On success, this function returns a report describing the pixel value - * classification. When you are finished with the report, dispose of it - * by calling frcDispose(). On failure, this function returns nullptr. - * To get extended error information, call GetLastError(). - */ -HistogramReport* frcHistogram(const Image* image, int numClasses, float min, - float max) { - Rect rect = IMAQ_NO_RECT; - return frcHistogram(image, numClasses, min, max, rect); -} - -HistogramReport* frcHistogram(const Image* image, int numClasses, float min, - float max, Rect rect) { - int success; - int fillValue = 1; - - /* create the region of interest */ - ROI* pRoi = imaqCreateROI(); - success = imaqAddRectContour(pRoi, rect); - if (!success) { - GetLastVisionError(); - return nullptr; - } - - /* make a mask from the ROI */ - Image* pMask = frcCreateImage(IMAQ_IMAGE_U8); - success = imaqROIToMask(pMask, pRoi, fillValue, nullptr, nullptr); - if (!success) { - GetLastVisionError(); - frcDispose(__FUNCTION__, pRoi, nullptr); - return nullptr; - } - - /* get a histogram report */ - HistogramReport* pHr = nullptr; - pHr = imaqHistogram(image, numClasses, min, max, pMask); - - /* clean up */ - frcDispose(__FUNCTION__, pRoi, pMask, nullptr); - - return pHr; -} - -/** - * @brief Calculates the histogram, or pixel distribution, of a color image. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL. - * - * @param image Image whose histogram the function calculates. - * @param numClasses The number of classes into which the function separates the - * pixels. Determines the number of elements in the histogram - * array returned - * @param mode The color space in which to perform the histogram. Possible - * values include IMAQ_RGB and IMAQ_HSL. - * @param mask An optional mask image. This image must be an IMAQ_IMAGE_U8 - * image. The function calculates the histogram using only - * those pixels in the image whose corresponding pixels in the - * mask are non-zero. Set this parameter to nullptr to - * calculate the histogram of the entire image, or use the - * simplified call. - * - * @return On success, this function returns a report describing the - * classification of each plane in a HistogramReport. When you are - * finished with the report, dispose of it by calling frcDispose(). - * On failure, this function returns nullptr. To get extended error - * information, call imaqGetLastError(). - */ -ColorHistogramReport* frcColorHistogram(const Image* image, int numClasses, - ColorMode mode) { - return frcColorHistogram(image, numClasses, mode, nullptr); -} - -ColorHistogramReport* frcColorHistogram(const Image* image, int numClasses, - ColorMode mode, Image* mask) { - return imaqColorHistogram2( - const_cast(reinterpret_cast(image)), numClasses, - mode, nullptr, mask); -} - -/** - * @brief Measures the pixel intensities in a rectangle of an image. - * Outputs intensity based statistics about an image such as Max, Min, Mean and - * Std Dev of pixel value. - * Supports IMAQ_IMAGE_U8 (grayscale) IMAQ_IMAGE_RGB (color) IMAQ_IMAGE_HSL - * (color-HSL). - * - * @param image The image whose pixel value the function queries - * @param pixel The coordinates of the pixel that the function queries - * @param value On return, the value of the specified image pixel. This - * parameter cannot be nullptr. This data structure contains - * either grayscale, RGB, HSL, Complex or RGBU64Value depending on - * the type of image. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcGetPixelValue(const Image* image, Point pixel, PixelValue* value) { - return imaqGetPixel(image, pixel, value); -} - -/* Particle Analysis functions */ - -/** - * @brief Filters particles out of an image based on their measurements. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL. - * - * @param dest The destination image. If dest is used, it must be the - * same size as the Source image. It will contain only the - * filtered particles. - * @param source The image containing the particles to filter. - * @param criteria An array of criteria to apply to the particles in the - * source image. This array cannot be nullptr. See the - * NIVisionCVI.chm help file for definitions of criteria. - * @param criteriaCount The number of elements in the criteria array. - * @param options Binary filter options, including rejectMatches, - * rejectBorder, and connectivity8. - * @param rect Area of image to filter. If omitted, the default is - * entire image. - * @param numParticles On return, the number of particles left in the image - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcParticleFilter(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, - int criteriaCount, const ParticleFilterOptions* options, - int* numParticles) { - Rect rect = IMAQ_NO_RECT; - return frcParticleFilter(dest, source, criteria, criteriaCount, options, rect, - numParticles); -} - -int frcParticleFilter(Image* dest, Image* source, - const ParticleFilterCriteria2* criteria, - int criteriaCount, const ParticleFilterOptions* options, - Rect rect, int* numParticles) { - ROI* roi = imaqCreateROI(); - imaqAddRectContour(roi, rect); - return imaqParticleFilter3(dest, source, criteria, criteriaCount, options, - roi, numParticles); -} - -/** - * @brief Performs morphological transformations on binary images. - * Supports IMAQ_IMAGE_U8. - * - * @param dest The destination image. The border size of the - * destination image is not important. - * @param source The image on which the function performs the - * morphological operations. The calculation modifies - * the border of the source image. The border must be - * at least half as large as the larger dimension of - * the structuring element. The connected source - * image for a morphological transformation must have - * been created with a border capable of supporting - * the size of the structuring element. A 3 by 3 - * structuring element requires a minimal border of 1, - * a 5 by 5 structuring element requires a minimal - * border of 2, and so on. - * @param method The morphological transform to apply. - * @param structuringElement The structuring element used in the operation. Omit - * this parameter if you do not want a custom - * structuring element. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcMorphology(Image* dest, Image* source, MorphologyMethod method) { - return imaqMorphology(dest, source, method, nullptr); -} - -int frcMorphology(Image* dest, Image* source, MorphologyMethod method, - const StructuringElement* structuringElement) { - return imaqMorphology(dest, source, method, structuringElement); -} - -/** - * @brief Eliminates particles that touch the border of the image. - * Supports IMAQ_IMAGE_U8. - * - * @param dest The destination image. - * @param source The source image. If the image has a border, the - * function sets all border pixel values to 0. - * @param connectivity8 specifies the type of connectivity used by the algorithm - * for particle detection. The connectivity mode directly - * determines whether an adjacent pixel belongs to the same - * particle or a different particle. Set to TRUE to use - * connectivity-8 to determine whether particles are - * touching. Set to FALSE to use connectivity-4 to - * determine whether particles are touching. The default - * setting for the simplified call is TRUE - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcRejectBorder(Image* dest, Image* source) { - return imaqRejectBorder(dest, source, TRUE); -} - -int frcRejectBorder(Image* dest, Image* source, int connectivity8) { - return imaqRejectBorder(dest, source, connectivity8); -} - -/** - * @brief Counts the number of particles in a binary image. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL. - * @param image binary (thresholded) image - * @param numParticles On return, the number of particles. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcCountParticles(Image* image, int* numParticles) { - return imaqCountParticles(image, 1, numParticles); -} - -/** - * @brief Conduct measurements for a single particle in an images. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL. - * - * @param image image with the particle to analyze. This function - * modifies the source image. If you need the original - * image, create a copy of the image using frcCopy() - * before using this function. - * @param particleNumber The number of the particle to get information on - * @param par on return, a particle analysis report containing - * information about the particle. This structure must be - * created by the caller. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcParticleAnalysis(Image* image, int particleNumber, - ParticleAnalysisReport* par) { - int success = 0; - - /* image information */ - int height, width; - if (!imaqGetImageSize(image, &width, &height)) { - return success; - } - par->imageWidth = width; - par->imageHeight = height; - par->particleIndex = particleNumber; - - /* center of mass point of the largest particle */ - double returnDouble; - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_CENTER_OF_MASS_X, &returnDouble); - if (!success) { - return success; - } - par->center_mass_x = static_cast(returnDouble); // pixel - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_CENTER_OF_MASS_Y, &returnDouble); - if (!success) { - return success; - } - par->center_mass_y = static_cast(returnDouble); // pixel - - /* particle size statistics */ - success = imaqMeasureParticle(image, particleNumber, 0, IMAQ_MT_AREA, - &returnDouble); - if (!success) { - return success; - } - par->particleArea = returnDouble; - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_BOUNDING_RECT_TOP, &returnDouble); - if (!success) { - return success; - } - par->boundingRect.top = static_cast(returnDouble); - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_BOUNDING_RECT_LEFT, &returnDouble); - if (!success) { - return success; - } - par->boundingRect.left = static_cast(returnDouble); - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_BOUNDING_RECT_HEIGHT, &returnDouble); - if (!success) { - return success; - } - par->boundingRect.height = static_cast(returnDouble); - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_BOUNDING_RECT_WIDTH, &returnDouble); - if (!success) { - return success; - } - par->boundingRect.width = static_cast(returnDouble); - - /* particle quality statistics */ - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_AREA_BY_IMAGE_AREA, &returnDouble); - if (!success) { - return success; - } - par->particleToImagePercent = returnDouble; - - success = imaqMeasureParticle(image, particleNumber, 0, - IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA, - &returnDouble); - if (!success) { - return success; - } - par->particleQuality = returnDouble; - - /* normalized position (-1 to 1) */ - par->center_mass_x_normalized = RangeToNormalized(par->center_mass_x, width); - par->center_mass_y_normalized = RangeToNormalized(par->center_mass_y, height); - - return success; -} - -/* Image Enhancement functions */ - -/** - * @brief Improves contrast on a grayscale image. - * Supports IMAQ_IMAGE_U8, IMAQ_IMAGE_I16. - * @param dest The destination image. - * @param source The image to equalize - * @param min the smallest value used for processing. After processing, all - * pixel values that are less than or equal to the Minimum in the - * original image are set to 0 for an 8-bit image. In 16-bit and - * floating-point images, these pixel values are set to the - * smallest pixel value found in the original image. - * @param max the largest value used for processing. After processing, all - * pixel values that are greater than or equal to the Maximum in - * the original image are set to 255 for an 8-bit image. In 16-bit - * and floating-point images, these pixel values are set to the - * largest pixel value found in the original image. - * @param mask an 8-bit image that specifies the region of the small image - * that will be copied. Only those pixels in the Image Src (Small) - * image that correspond to an equivalent non-zero pixel in the - * mask image are copied. All other pixels keep their original - * values. The entire image is processed if Image Mask is nullptr - * or this parameter is omitted. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - * - * option defaults: - * searchRect = IMAQ_NO_RECT - * minMatchScore = DEFAULT_MINMAX_SCORE (800) - */ -int frcEqualize(Image* dest, const Image* source, float min, float max) { - return frcEqualize(dest, source, min, max, nullptr); -} - -int frcEqualize(Image* dest, const Image* source, float min, float max, - const Image* mask) { - return imaqEqualize(dest, source, min, max, mask); -} - -/** - * @brief Improves contrast on a color image. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL - * - * option defaults: colorEqualization = TRUE to equalize all three planes of the - * image - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - * @param dest The destination image. - * @param source The image to equalize - * @param colorEqualization Set this parameter to TRUE to equalize all three - * planes of the image (the default). Set this parameter to FALSE to equalize - * only the luminance plane. - */ -int frcColorEqualize(Image* dest, const Image* source) { - return imaqColorEqualize(dest, source, TRUE); -} - -int frcColorEqualize(Image* dest, const Image* source, int colorEqualization) { - return imaqColorEqualize(dest, source, TRUE); -} - -/* Image Conversion functions */ - -/** - * @brief Automatically thresholds a grayscale image into a binary image for - * Particle Analysis based on a smart threshold. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_I16 - * @param dest The destination image. - * @param source The image to threshold - * @param windowWidth The width of the rectangular window around the pixel - * on which the function performs the local threshold. - * This number must be at least 3 and cannot be larger - * than the width of source - * @param windowHeight The height of the rectangular window around the pixel - * on which the function performs the local threshold. - * This number must be at least 3 and cannot be larger - * than the height of source - * @param method Specifies the local thresholding method the function - * uses. Value can be IMAQ_NIBLACK (which computes - * thresholds for each pixel based on its local - * statistics using the Niblack local thresholding - * algorithm.), or IMAQ_BACKGROUND_CORRECTION (which - * does background correction first to eliminate - * non-uniform lighting effects, then performs - * thresholding using the Otsu thresholding algorithm) - * @param deviationWeight Specifies the k constant used in the Niblack local - * thresholding algorithm, which determines the weight - * applied to the variance calculation. Valid k constants - * range from 0 to 1. Setting this value to 0 will - * increase the performance of the function because the - * function will not calculate the variance for any of - * the pixels. The function ignores this value if method - * is not set to IMAQ_NIBLACK - * @param type Specifies the type of objects for which you want to - * look. Values can be IMAQ_BRIGHT_OBJECTS or - * IMAQ_DARK_OBJECTS. - * @param replaceValue Specifies the replacement value the function uses for - * the pixels of the kept objects in the destination - * image. - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcSmartThreshold(Image* dest, const Image* source, int windowWidth, - int windowHeight, LocalThresholdMethod method, - double deviationWeight, ObjectType type) { - float replaceValue = 1.0; - return imaqLocalThreshold(dest, source, windowWidth, windowHeight, method, - deviationWeight, type, replaceValue); -} - -int frcSmartThreshold(Image* dest, const Image* source, int windowWidth, - int windowHeight, LocalThresholdMethod method, - double deviationWeight, ObjectType type, - float replaceValue) { - return imaqLocalThreshold(dest, source, windowWidth, windowHeight, method, - deviationWeight, type, replaceValue); -} - -/** - * @brief Converts a grayscale image to a binary image for Particle Analysis - * based on a fixed threshold. - * The function sets pixels values outside of the given range to 0. The function - * sets pixel values within the range to a given value or leaves the values - * unchanged. Use the simplified call to leave pixel values unchanged. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_I16. - * - * @param dest The destination image. - * @param source The image to threshold - * @param rangeMin The lower boundary of the range of pixel values to keep - * @param rangeMax The upper boundary of the range of pixel values to keep. - * - * @return error code: 0 = error. To get extended error information, call - * GetLastError(). - */ -int frcSimpleThreshold(Image* dest, const Image* source, float rangeMin, - float rangeMax) { - int newValue = 255; - return frcSimpleThreshold(dest, source, rangeMin, rangeMax, newValue); -} - -/** - * @brief Converts a grayscale image to a binary image for Particle Analysis - * based on a fixed threshold. - * The function sets pixels values outside of the given range to 0. The function - * sets pixel values within the range to the given value. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_I16. - * - * @param dest The destination image. - * @param source The image to threshold - * @param rangeMin The lower boundary of the range of pixel values to keep - * @param rangeMax The upper boundary of the range of pixel values to keep. - * @param newValue The replacement value for pixels within the range. Use the - * simplified call to leave the pixel values unchanged - * - * @return error code: 0 = error. To get extended error information, call - * GetLastError(). - */ -int frcSimpleThreshold(Image* dest, const Image* source, float rangeMin, - float rangeMax, float newValue) { - int useNewValue = TRUE; - return imaqThreshold(dest, source, rangeMin, rangeMax, useNewValue, newValue); -} - -/** - * @brief Applies a threshold to the Red, Green, and Blue values of a RGB image - * or the Hue, Saturation, Luminance values for a HSL image. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL. - * This simpler version filters based on a hue range in the HSL mode. - * - * @param dest The destination image. This must be a IMAQ_IMAGE_U8 image. - * @param source The image to threshold - * @param mode The color space to perform the threshold in. valid values - * are: IMAQ_RGB, IMAQ_HSL. - * @param plane1Range The selection range for the first plane of the image. Set - * this parameter to nullptr to use a selection range from 0 - * to 255. - * @param plane2Range The selection range for the second plane of the image. Set - * this parameter to nullptr to use a selection range from 0 - * to 255. - * @param plane3Range The selection range for the third plane of the image. Set - * this parameter to nullptr to use a selection range from 0 - * to 255. - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcColorThreshold(Image* dest, const Image* source, ColorMode mode, - const Range* plane1Range, const Range* plane2Range, - const Range* plane3Range) { - int replaceValue = 1; - return imaqColorThreshold(dest, source, replaceValue, mode, plane1Range, - plane2Range, plane3Range); -} - -/** - * @brief Applies a threshold to the Red, Green, and Blue values of a RGB image - * or the Hue, Saturation, Luminance values for a HSL image. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL. - * The simpler version filters based on a hue range in the HSL mode. - * - * @param dest The destination image. This must be a IMAQ_IMAGE_U8 - * image. - * @param source The image to threshold - * @param replaceValue Value to assign to selected pixels. Defaults to 1 if - * simplified call is used. - * @param mode The color space to perform the threshold in. valid values - * are: IMAQ_RGB, IMAQ_HSL. - * @param plane1Range The selection range for the first plane of the image. - * Set this parameter to nullptr to use a selection range - * from 0 to 255. - * @param plane2Range The selection range for the second plane of the image. - * Set this parameter to nullptr to use a selection range - * from 0 to 255. - * @param plane3Range The selection range for the third plane of the image. - * Set this parameter to nullptr to use a selection range - * from 0 to 255. - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcColorThreshold(Image* dest, const Image* source, int replaceValue, - ColorMode mode, const Range* plane1Range, - const Range* plane2Range, const Range* plane3Range) { - return imaqColorThreshold(dest, source, replaceValue, mode, plane1Range, - plane2Range, plane3Range); -} - -/** - * @brief A simpler version of ColorThreshold that thresholds hue range in the - * HSL mode. Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL. - * @param dest The destination image. - * @param source The image to threshold - * @param hueRange The selection range for the hue (color). - * @param minSaturation The minimum saturation value (1-255). If not used, - * DEFAULT_SATURATION_THRESHOLD is the default. - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcHueThreshold(Image* dest, const Image* source, const Range* hueRange) { - return frcHueThreshold(dest, source, hueRange, DEFAULT_SATURATION_THRESHOLD); -} - -int frcHueThreshold(Image* dest, const Image* source, const Range* hueRange, - int minSaturation) { - // assume HSL mode - ColorMode mode = IMAQ_HSL; - // Set saturation 100 - 255 - Range satRange; - satRange.minValue = minSaturation; - satRange.maxValue = 255; - // Set luminance 100 - 255 - Range lumRange; - lumRange.minValue = 100; - lumRange.maxValue = 255; - // Replace pixels with 1 if pass threshold filter - int replaceValue = 1; - return imaqColorThreshold(dest, source, replaceValue, mode, hueRange, - &satRange, &lumRange); -} - -/** - * @brief Extracts the Red, Green, Blue, or Hue, Saturation or Luminance - * information from a color image. - * Supports IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64. - * - * @param image The source image that the function extracts the planes from. - * @param mode The color space that the function extracts the planes from. - * Valid values are IMAQ_RGB, IMAQ_HSL, IMAQ_HSV, IMAQ_HSI. - * @param plane1 On return, the first extracted plane. Set this parameter to - * nullptr if you do not need this information. RGB-Red, - * HSL/HSV/HSI-Hue. - * @param plane2 On return, the second extracted plane. Set this parameter to - * nullptr if you do not need this information. RGB-Green, - * HSL/HSV/HSI-Saturation. - * @param plane3 On return, the third extracted plane. Set this parameter to - * nullptr if you do not need this information. RGB-Blue, - * HSL-Luminance, HSV-Value, HSI-Intensity. - * - * @return error code: 0 = error. To get extended error information, call - * GetLastError(). - */ -int frcExtractColorPlanes(const Image* image, ColorMode mode, Image* plane1, - Image* plane2, Image* plane3) { - return imaqExtractColorPlanes(image, mode, plane1, plane2, plane3); -} - -/** - * @brief Extracts the Hue information from a color image. Supports - * IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64 - * - * @param image The source image that the function extracts the plane - * from. - * @param huePlane On return, the extracted hue plane. - * @param minSaturation the minimum saturation level required 0-255 (try 50) - * - * @return On success: 1. On failure: 0. To get extended error information, call - * GetLastError(). - */ -int frcExtractHuePlane(const Image* image, Image* huePlane) { - return frcExtractHuePlane(image, huePlane, DEFAULT_SATURATION_THRESHOLD); -} - -int frcExtractHuePlane(const Image* image, Image* huePlane, int minSaturation) { - return frcExtractColorPlanes(image, IMAQ_HSL, huePlane, nullptr, nullptr); -} - -} // namespace frc diff --git a/wpilibj/src/athena/cpp/include/NIIMAQdx.h b/wpilibj/src/athena/cpp/include/NIIMAQdx.h deleted file mode 100644 index 5c4be76852..0000000000 --- a/wpilibj/src/athena/cpp/include/NIIMAQdx.h +++ /dev/null @@ -1,646 +0,0 @@ -//============================================================================== -// -// Title : NIIMAQdx.h -// Created : 1403685834 seconds after 1/1/1970 12:00:00 UTC -// Copyright : © Copyright 2006, National Instruments Corporation, All rights reserved -// Purpose : Include file for NI-IMAQdx library support. -// -//============================================================================== -#ifndef ___niimaqdx_h___ -#define ___niimaqdx_h___ - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if !defined(niimaqdx_types) -#define niimaqdx_types - -#ifdef _CVI_ - #pragma EnableLibraryRuntimeChecking -#endif - -//============================================================================== -// Typedefs -//============================================================================== -#ifndef _NI_uInt8_DEFINED_ - #define _NI_uInt8_DEFINED_ - typedef unsigned char uInt8; -#endif - -#ifndef _NI_uInt16_DEFINED_ - #define _NI_uInt16_DEFINED_ - typedef unsigned short int uInt16; -#endif - -#ifndef _NI_uInt32_DEFINED_ - #define _NI_uInt32_DEFINED_ - #if defined(_MSC_VER) - typedef unsigned long uInt32; - #elif __GNUC__ - #if __x86_64__ - typedef unsigned int uInt32; - #else - typedef unsigned long uInt32; - #endif - #endif -#endif - -#ifndef _NI_uInt64_DEFINED_ - #define _NI_uInt64_DEFINED_ - #if defined(_MSC_VER) || _CVI_ >= 700 - typedef unsigned __int64 uInt64; - #elif __GNUC__ - typedef unsigned long long uInt64; - #endif -#endif - -#ifndef _NI_Int8_DEFINED_ - #define _NI_Int8_DEFINED_ - typedef char Int8; -#endif - -#ifndef _NI_Int16_DEFINED_ - #define _NI_Int16_DEFINED_ - typedef short int Int16; -#endif - -#ifndef _NI_Int32_DEFINED_ - #define _NI_Int32_DEFINED_ - #if defined(_MSC_VER) - typedef long Int32; - #elif __GNUC__ - #if __x86_64__ - typedef int Int32; - #else - typedef long Int32; - #endif - #endif -#endif - -#ifndef _NI_Int64_DEFINED_ - #define _NI_Int64_DEFINED_ - #if defined(_MSC_VER) || _CVI_ >= 700 - typedef __int64 Int64; - #elif __GNUC__ - typedef long long int Int64; - #endif -#endif - -#ifndef _NI_float32_DEFINED_ - #define _NI_float32_DEFINED_ - typedef float float32; -#endif - -#ifndef _NI_float64_DEFINED_ - #define _NI_float64_DEFINED_ - typedef double float64; -#endif - -#ifndef TRUE - #define TRUE (1L) -#endif - -#ifndef FALSE - #define FALSE (0L) -#endif - -#ifndef _NI_GUIDHNDL_DEFINED - typedef uInt32 GUIHNDL; -#endif - -#if (defined(_MSC_VER) || defined(_CVI_)) - #ifndef _NI_FUNC_DEFINED - #define NI_FUNC __stdcall - #endif - - #ifndef _NI_FUNCC_DEFINED - #define NI_FUNCC __cdecl - #endif -#elif defined(__GNUC__) - #ifndef _NI_FUNC_DEFINED - #define NI_FUNC - #endif - - #ifndef _NI_FUNCC_DEFINED - #define NI_FUNCC - #endif -#endif - -#ifndef _NI_bool32_DEFINED_ - #define _NI_bool32_DEFINED_ - typedef uInt32 bool32; -#endif - -#ifndef _NI_IMAQdxSession_DEFINED_ - #define _NI_IMAQdxSession_DEFINED_ - typedef uInt32 IMAQdxSession; -#endif - -#define IMAQDX_MAX_API_STRING_LENGTH 512 - -//============================================================================== -// Forward Declare Data Structures -//============================================================================== -typedef struct Image_struct Image; - - -//============================================================================== -// Error Codes Enumeration -//============================================================================== -typedef enum IMAQdxError_enum { - IMAQdxErrorSuccess = 0x0, // Success - IMAQdxErrorSystemMemoryFull = 0xBFF69000, // Not enough memory - IMAQdxErrorInternal, // Internal error - IMAQdxErrorInvalidParameter, // Invalid parameter - IMAQdxErrorInvalidPointer, // Invalid pointer - IMAQdxErrorInvalidInterface, // Invalid camera session - IMAQdxErrorInvalidRegistryKey, // Invalid registry key - IMAQdxErrorInvalidAddress, // Invalid address - IMAQdxErrorInvalidDeviceType, // Invalid device type - IMAQdxErrorNotImplemented, // Not implemented - IMAQdxErrorCameraNotFound, // Camera not found - IMAQdxErrorCameraInUse, // Camera is already in use. - IMAQdxErrorCameraNotInitialized, // Camera is not initialized. - IMAQdxErrorCameraRemoved, // Camera has been removed. - IMAQdxErrorCameraRunning, // Acquisition in progress. - IMAQdxErrorCameraNotRunning, // No acquisition in progress. - IMAQdxErrorAttributeNotSupported, // Attribute not supported by the camera. - IMAQdxErrorAttributeNotSettable, // Unable to set attribute. - IMAQdxErrorAttributeNotReadable, // Unable to get attribute. - IMAQdxErrorAttributeOutOfRange, // Attribute value is out of range. - IMAQdxErrorBufferNotAvailable, // Requested buffer is unavailable. - IMAQdxErrorBufferListEmpty, // Buffer list is empty. Add one or more buffers. - IMAQdxErrorBufferListLocked, // Buffer list is already locked. Reconfigure acquisition and try again. - IMAQdxErrorBufferListNotLocked, // No buffer list. Reconfigure acquisition and try again. - IMAQdxErrorResourcesAllocated, // Transfer engine resources already allocated. Reconfigure acquisition and try again. - IMAQdxErrorResourcesUnavailable, // Insufficient transfer engine resources. - IMAQdxErrorAsyncWrite, // Unable to perform asychronous register write. - IMAQdxErrorAsyncRead, // Unable to perform asychronous register read. - IMAQdxErrorTimeout, // Timeout. - IMAQdxErrorBusReset, // Bus reset occurred during a transaction. - IMAQdxErrorInvalidXML, // Unable to load camera's XML file. - IMAQdxErrorFileAccess, // Unable to read/write to file. - IMAQdxErrorInvalidCameraURLString, // Camera has malformed URL string. - IMAQdxErrorInvalidCameraFile, // Invalid camera file. - IMAQdxErrorGenICamError, // Unknown Genicam error. - IMAQdxErrorFormat7Parameters, // For format 7: The combination of speed, image position, image size, and color coding is incorrect. - IMAQdxErrorInvalidAttributeType, // The attribute type is not compatible with the passed variable type. - IMAQdxErrorDLLNotFound, // The DLL could not be found. - IMAQdxErrorFunctionNotFound, // The function could not be found. - IMAQdxErrorLicenseNotActivated, // License not activated. - IMAQdxErrorCameraNotConfiguredForListener, // The camera is not configured properly to support a listener. - IMAQdxErrorCameraMulticastNotAvailable, // Unable to configure the system for multicast support. - IMAQdxErrorBufferHasLostPackets, // The requested buffer has lost packets and the user requested an error to be generated. - IMAQdxErrorGiGEVisionError, // Unknown GiGE Vision error. - IMAQdxErrorNetworkError, // Unknown network error. - IMAQdxErrorCameraUnreachable, // Unable to connect to the camera. - IMAQdxErrorHighPerformanceNotSupported, // High performance acquisition is not supported on the specified network interface. Connect the camera to a network interface running the high performance driver. - IMAQdxErrorInterfaceNotRenamed, // Unable to rename interface. Invalid or duplicate name specified. - IMAQdxErrorNoSupportedVideoModes, // The camera does not have any video modes which are supported. - IMAQdxErrorSoftwareTriggerOverrun, // Software trigger overrun. - IMAQdxErrorTestPacketNotReceived, // The system did not receive a test packet from the camera. The packet size may be too large for the network configuration or a firewall may be enabled. - IMAQdxErrorCorruptedImageReceived, // The camera returned a corrupted image. - IMAQdxErrorCameraConfigurationHasChanged, // The camera did not return an image of the correct type it was configured for previously. - IMAQdxErrorCameraInvalidAuthentication, // The camera is configured with password authentication and either the user name and password were not configured or they are incorrect. - IMAQdxErrorUnknownHTTPError, // The camera returned an unknown HTTP error. - IMAQdxErrorKernelDriverUnavailable, // Unable to attach to the kernel mode driver. - IMAQdxErrorPixelFormatDecoderUnavailable, // No decoder available for selected pixel format. - IMAQdxErrorFirmwareUpdateNeeded, // The acquisition hardware needs a firmware update before it can be used. - IMAQdxErrorFirmwareUpdateRebootNeeded, // The firmware on the acquisition hardware has been updated and the system must be rebooted before use. - IMAQdxErrorLightingCurrentOutOfRange, // The requested current level from the lighting controller is not possible. - IMAQdxErrorUSB3VisionError, // Unknown USB3 Vision error. - IMAQdxErrorInvalidU3VUSBDescriptor, // The camera has a USB descriptor that is incompatible with the USB3 Vision specification. - IMAQdxErrorU3VInvalidControlInterface, // The USB3 Vision control interface is not implemented or is invalid on this camera. - IMAQdxErrorU3VControlInterfaceError, // There was an error from the control interface of the USB3 Vision camera. - IMAQdxErrorU3VInvalidEventInterface, // The USB3 Vision event interface is not implemented or is invalid on this camera. - IMAQdxErrorU3VEventInterfaceError, // There was an error from the event interface of the USB3 Vision camera. - IMAQdxErrorU3VInvalidStreamInterface, // The USB3 Vision stream interface is not implemented or is invalid on this camera. - IMAQdxErrorU3VStreamInterfaceError, // There was an error from the stream interface of the USB3 Vision camera. - IMAQdxErrorU3VUnsupportedConnectionSpeed, // The USB connection speed is not supported by the camera. Check whether the camera is plugged into a USB 2.0 port instead of a USB 3.0 port. If so, verify that the camera supports this use case. - IMAQdxErrorU3VInsufficientPower, // The USB3 Vision camera requires more current than can be supplied by the USB port in use. - IMAQdxErrorU3VInvalidMaxCurrent, // The U3V_MaximumCurrentUSB20_mA registry value is not valid for the connected USB3 Vision camera. - IMAQdxErrorBufferIncompleteData, // The requested buffer has incomplete data and the user requested an error to be generated. - IMAQdxErrorCameraAcquisitionConfigFailed, // The camera returned an error starting the acquisition. - IMAQdxErrorCameraClosePending, // The camera still has outstanding references and will be closed when these operations complete. - IMAQdxErrorSoftwareFault, // An unexpected software error occurred. - IMAQdxErrorCameraPropertyInvalid, // The value for an invalid camera property was requested. - IMAQdxErrorJumboFramesNotEnabled, // Jumbo frames are not enabled on the host. Maximum packet size is 1500 bytes. - IMAQdxErrorBayerPixelFormatNotSelected, // This operation requires that the camera has a Bayer pixel format selected. - IMAQdxErrorGuard = 0xFFFFFFFF, -} IMAQdxError; - - -//============================================================================== -// Bus Type Enumeration -//============================================================================== -typedef enum IMAQdxBusType_enum { - IMAQdxBusTypeFireWire = 0x31333934, - IMAQdxBusTypeEthernet = 0x69707634, - IMAQdxBusTypeSimulator = 0x2073696D, - IMAQdxBusTypeDirectShow = 0x64736877, - IMAQdxBusTypeIP = 0x4950636D, - IMAQdxBusTypeSmartCam2 = 0x53436132, - IMAQdxBusTypeUSB3Vision = 0x55534233, - IMAQdxBusTypeUVC = 0x55564320, - IMAQdxBusTypeGuard = 0xFFFFFFFF, -} IMAQdxBusType; - - -//============================================================================== -// Camera Control Mode Enumeration -//============================================================================== -typedef enum IMAQdxCameraControlMode_enum { - IMAQdxCameraControlModeController, - IMAQdxCameraControlModeListener, - IMAQdxCameraControlModeGuard = 0xFFFFFFFF, -} IMAQdxCameraControlMode; - - -//============================================================================== -// Buffer Number Mode Enumeration -//============================================================================== -typedef enum IMAQdxBufferNumberMode_enum { - IMAQdxBufferNumberModeNext, - IMAQdxBufferNumberModeLast, - IMAQdxBufferNumberModeBufferNumber, - IMAQdxBufferNumberModeGuard = 0xFFFFFFFF, -} IMAQdxBufferNumberMode; - - -//============================================================================== -// Plug n Play Event Enumeration -//============================================================================== -typedef enum IMAQdxPnpEvent_enum { - IMAQdxPnpEventCameraAttached, - IMAQdxPnpEventCameraDetached, - IMAQdxPnpEventBusReset, - IMAQdxPnpEventGuard = 0xFFFFFFFF, -} IMAQdxPnpEvent; - - -//============================================================================== -// Bayer Pattern Enumeration -//============================================================================== -typedef enum IMAQdxBayerPattern_enum { - IMAQdxBayerPatternNone, - IMAQdxBayerPatternGB, - IMAQdxBayerPatternGR, - IMAQdxBayerPatternBG, - IMAQdxBayerPatternRG, - IMAQdxBayerPatternHardware, - IMAQdxBayerPatternGuard = 0xFFFFFFFF, -} IMAQdxBayerPattern; - - -//============================================================================== -// Bayer Decode Algorithm Enumeration -//============================================================================== -typedef enum IMAQdxBayerAlgorithm_enum { - IMAQdxBayerAlgorithmBilinear, - IMAQdxBayerAlgorithmVNG, - IMAQdxBayerAlgorithmGuard = 0xFFFFFFFF, -} IMAQdxBayerAlgorithm; - - -//============================================================================== -// Output Image Types -- Values match Vision Development Module image types -//============================================================================== -typedef enum IMAQdxOutputImageType_enum { - IMAQdxOutputImageTypeU8 = 0, - IMAQdxOutputImageTypeI16 = 1, - IMAQdxOutputImageTypeU16 = 7, - IMAQdxOutputImageTypeRGB32 = 4, - IMAQdxOutputImageTypeRGB64 = 6, - IMAQdxOutputImageTypeAuto = 0x7FFFFFFF, - IMAQdxOutputImageTypeGuard = 0xFFFFFFFF, -} IMAQdxOutputImageType; - - -//============================================================================== -// Controller Destination Mode Enumeration -//============================================================================== -typedef enum IMAQdxDestinationMode_enum { - IMAQdxDestinationModeUnicast, - IMAQdxDestinationModeBroadcast, - IMAQdxDestinationModeMulticast, - IMAQdxDestinationModeGuard = 0xFFFFFFFF, -} IMAQdxDestinationMode; - - -//============================================================================== -// Attribute Type Enumeration -//============================================================================== -typedef enum IMAQdxAttributeType_enum { - IMAQdxAttributeTypeU32, - IMAQdxAttributeTypeI64, - IMAQdxAttributeTypeF64, - IMAQdxAttributeTypeString, - IMAQdxAttributeTypeEnum, - IMAQdxAttributeTypeBool, - IMAQdxAttributeTypeCommand, - IMAQdxAttributeTypeBlob, - IMAQdxAttributeTypeGuard = 0xFFFFFFFF, -} IMAQdxAttributeType; - - -//============================================================================== -// Value Type Enumeration -//============================================================================== -typedef enum IMAQdxValueType_enum { - IMAQdxValueTypeU32, - IMAQdxValueTypeI64, - IMAQdxValueTypeF64, - IMAQdxValueTypeString, - IMAQdxValueTypeEnumItem, - IMAQdxValueTypeBool, - IMAQdxValueTypeDisposableString, - IMAQdxValueTypeGuard = 0xFFFFFFFF, -} IMAQdxValueType; - - -//============================================================================== -// Interface File Flags Enumeration -//============================================================================== -typedef enum IMAQdxInterfaceFileFlags_enum { - IMAQdxInterfaceFileFlagsConnected = 0x1, - IMAQdxInterfaceFileFlagsDirty = 0x2, - IMAQdxInterfaceFileFlagsGuard = 0xFFFFFFFF, -} IMAQdxInterfaceFileFlags; - - -//============================================================================== -// Overwrite Mode Enumeration -//============================================================================== -typedef enum IMAQdxOverwriteMode_enum { - IMAQdxOverwriteModeGetOldest = 0x0, - IMAQdxOverwriteModeFail = 0x2, - IMAQdxOverwriteModeGetNewest = 0x3, - IMAQdxOverwriteModeGuard = 0xFFFFFFFF, -} IMAQdxOverwriteMode; - - -//============================================================================== -// Incomplete Buffer Mode Enumeration -//============================================================================== -typedef enum IMAQdxIncompleteBufferMode_enum { - IMAQdxIncompleteBufferModeIgnore, - IMAQdxIncompleteBufferModeFail, - IMAQdxIncompleteBufferModeGuard = 0xFFFFFFFF, -} IMAQdxIncompleteBufferMode; - - -//============================================================================== -// Lost Packet Mode Enumeration -//============================================================================== -typedef enum IMAQdxLostPacketMode_enum { - IMAQdxLostPacketModeIgnore, - IMAQdxLostPacketModeFail, - IMAQdxLostPacketModeGuard = 0xFFFFFFFF, -} IMAQdxLostPacketMode; - - -//============================================================================== -// Attribute Visibility Enumeration -//============================================================================== -typedef enum IMAQdxAttributeVisibility_enum { - IMAQdxAttributeVisibilitySimple = 0x00001000, - IMAQdxAttributeVisibilityIntermediate = 0x00002000, - IMAQdxAttributeVisibilityAdvanced = 0x00004000, - IMAQdxAttributeVisibilityGuard = 0xFFFFFFFF, -} IMAQdxAttributeVisibility; - - -//============================================================================== -// Stream Channel Mode Enumeration -//============================================================================== -typedef enum IMAQdxStreamChannelMode_enum { - IMAQdxStreamChannelModeAutomatic, - IMAQdxStreamChannelModeManual, - IMAQdxStreamChannelModeGuard = 0xFFFFFFFF, -} IMAQdxStreamChannelMode; - - -//============================================================================== -// Pixel Signedness Enumeration -//============================================================================== -typedef enum IMAQdxPixelSignedness_enum { - IMAQdxPixelSignednessUnsigned, - IMAQdxPixelSignednessSigned, - IMAQdxPixelSignednessHardware, - IMAQdxPixelSignednessGuard = 0xFFFFFFFF, -} IMAQdxPixelSignedness; - - -//============================================================================== -// USB Connection Speed Enumeration -//============================================================================== -typedef enum IMAQdxUSBConnectionSpeed_enum { - IMAQdxUSBConnectionSpeedLow = 1, - IMAQdxUSBConnectionSpeedFull = 2, - IMAQdxUSBConnectionSpeedHigh = 4, - IMAQdxUSBConnectionSpeedSuper = 8, - IMAQdxUSBConnectionSpeedGuard = 0xFFFFFFFF, -} IMAQdxUSBConnectionSpeed; - - -//============================================================================== -// CVI Structures -//============================================================================== -#pragma pack(push, 4) - - -//============================================================================== -// Camera Information Structure -//============================================================================== -typedef struct IMAQdxCameraInformation_struct { - uInt32 Type; - uInt32 Version; - uInt32 Flags; - uInt32 SerialNumberHi; - uInt32 SerialNumberLo; - IMAQdxBusType BusType; - char InterfaceName[IMAQDX_MAX_API_STRING_LENGTH]; - char VendorName[IMAQDX_MAX_API_STRING_LENGTH]; - char ModelName[IMAQDX_MAX_API_STRING_LENGTH]; - char CameraFileName[IMAQDX_MAX_API_STRING_LENGTH]; - char CameraAttributeURL[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxCameraInformation; - - -//============================================================================== -// Camera File Structure -//============================================================================== -typedef struct IMAQdxCameraFile_struct { - uInt32 Type; - uInt32 Version; - char FileName[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxCameraFile; - - -//============================================================================== -// Attribute Information Structure -//============================================================================== -typedef struct IMAQdxAttributeInformation_struct { - IMAQdxAttributeType Type; - bool32 Readable; - bool32 Writable; - char Name[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxAttributeInformation; - - -//============================================================================== -// Enumeration Item Structure -//============================================================================== -typedef struct IMAQdxEnumItem_struct { - uInt32 Value; - uInt32 Reserved; - char Name[IMAQDX_MAX_API_STRING_LENGTH]; -} IMAQdxEnumItem; - - -//============================================================================== -// Camera Information Structure -//============================================================================== -typedef IMAQdxEnumItem IMAQdxVideoMode; - - -#pragma pack(pop) - - -//============================================================================== -// Callbacks -//============================================================================== -typedef uInt32 (NI_FUNC *FrameDoneEventCallbackPtr)(IMAQdxSession id, uInt32 bufferNumber, void* callbackData); -typedef uInt32 (NI_FUNC *PnpEventCallbackPtr)(IMAQdxSession id, IMAQdxPnpEvent pnpEvent, void* callbackData); -typedef void (NI_FUNC *AttributeUpdatedEventCallbackPtr)(IMAQdxSession id, const char* name, void* callbackData); - -#endif //niimaqdx_types -//============================================================================== -// Attributes -//============================================================================== -#define IMAQdxAttributeBaseAddress "CameraInformation::BaseAddress" // Read only. Gets the base address of the camera registers. -#define IMAQdxAttributeBusType "CameraInformation::BusType" // Read only. Gets the bus type of the camera. -#define IMAQdxAttributeModelName "CameraInformation::ModelName" // Read only. Returns the model name. -#define IMAQdxAttributeSerialNumberHigh "CameraInformation::SerialNumberHigh" // Read only. Gets the upper 32-bits of the camera 64-bit serial number. -#define IMAQdxAttributeSerialNumberLow "CameraInformation::SerialNumberLow" // Read only. Gets the lower 32-bits of the camera 64-bit serial number. -#define IMAQdxAttributeVendorName "CameraInformation::VendorName" // Read only. Returns the vendor name. -#define IMAQdxAttributeHostIPAddress "CameraInformation::HostIPAddress" // Read only. Returns the host adapter IP address. -#define IMAQdxAttributeIPAddress "CameraInformation::IPAddress" // Read only. Returns the IP address. -#define IMAQdxAttributePrimaryURLString "CameraInformation::PrimaryURLString" // Read only. Gets the camera's primary URL string. -#define IMAQdxAttributeSecondaryURLString "CameraInformation::SecondaryURLString" // Read only. Gets the camera's secondary URL string. -#define IMAQdxAttributeAcqInProgress "StatusInformation::AcqInProgress" // Read only. Gets the current state of the acquisition. TRUE if acquiring; otherwise FALSE. -#define IMAQdxAttributeLastBufferCount "StatusInformation::LastBufferCount" // Read only. Gets the number of transferred buffers. -#define IMAQdxAttributeLastBufferNumber "StatusInformation::LastBufferNumber" // Read only. Gets the last cumulative buffer number transferred. -#define IMAQdxAttributeLostBufferCount "StatusInformation::LostBufferCount" // Read only. Gets the number of lost buffers during an acquisition session. -#define IMAQdxAttributeLostPacketCount "StatusInformation::LostPacketCount" // Read only. Gets the number of lost packets during an acquisition session. -#define IMAQdxAttributeRequestedResendPackets "StatusInformation::RequestedResendPacketCount" // Read only. Gets the number of packets requested to be resent during an acquisition session. -#define IMAQdxAttributeReceivedResendPackets "StatusInformation::ReceivedResendPackets" // Read only. Gets the number of packets that were requested to be resent during an acquisition session and were completed. -#define IMAQdxAttributeHandledEventCount "StatusInformation::HandledEventCount" // Read only. Gets the number of handled events during an acquisition session. -#define IMAQdxAttributeLostEventCount "StatusInformation::LostEventCount" // Read only. Gets the number of lost events during an acquisition session. -#define IMAQdxAttributeBayerGainB "AcquisitionAttributes::Bayer::GainB" // Sets/gets the white balance gain for the blue component of the Bayer conversion. -#define IMAQdxAttributeBayerGainG "AcquisitionAttributes::Bayer::GainG" // Sets/gets the white balance gain for the green component of the Bayer conversion. -#define IMAQdxAttributeBayerGainR "AcquisitionAttributes::Bayer::GainR" // Sets/gets the white balance gain for the red component of the Bayer conversion. -#define IMAQdxAttributeBayerPattern "AcquisitionAttributes::Bayer::Pattern" // Sets/gets the Bayer pattern to use. -#define IMAQdxAttributeStreamChannelMode "AcquisitionAttributes::Controller::StreamChannelMode" // Gets/sets the mode for allocating a FireWire stream channel. -#define IMAQdxAttributeDesiredStreamChannel "AcquisitionAttributes::Controller::DesiredStreamChannel" // Gets/sets the stream channel to manually allocate. -#define IMAQdxAttributeFrameInterval "AcquisitionAttributes::FrameInterval" // Read only. Gets the duration in milliseconds between successive frames. -#define IMAQdxAttributeIgnoreFirstFrame "AcquisitionAttributes::IgnoreFirstFrame" // Gets/sets the video delay of one frame between starting the camera and receiving the video feed. -#define IMAQdxAttributeOffsetX "OffsetX" // Gets/sets the left offset of the image. -#define IMAQdxAttributeOffsetY "OffsetY" // Gets/sets the top offset of the image. -#define IMAQdxAttributeWidth "Width" // Gets/sets the width of the image. -#define IMAQdxAttributeHeight "Height" // Gets/sets the height of the image. -#define IMAQdxAttributePixelFormat "PixelFormat" // Gets/sets the pixel format of the source sensor. -#define IMAQdxAttributePacketSize "PacketSize" // Gets/sets the packet size in bytes. -#define IMAQdxAttributePayloadSize "PayloadSize" // Gets/sets the frame size in bytes. -#define IMAQdxAttributeSpeed "AcquisitionAttributes::Speed" // Gets/sets the transfer speed in Mbps for a FireWire packet. -#define IMAQdxAttributeShiftPixelBits "AcquisitionAttributes::ShiftPixelBits" // Gets/sets the alignment of 16-bit cameras. Downshift the pixel bits if the camera returns most significant bit-aligned data. -#define IMAQdxAttributeSwapPixelBytes "AcquisitionAttributes::SwapPixelBytes" // Gets/sets the endianness of 16-bit cameras. Swap the pixel bytes if the camera returns little endian data. -#define IMAQdxAttributeOverwriteMode "AcquisitionAttributes::OverwriteMode" // Gets/sets the overwrite mode, used to determine acquisition when an image transfer cannot be completed due to an overwritten internal buffer. -#define IMAQdxAttributeTimeout "AcquisitionAttributes::Timeout" // Gets/sets the timeout value in milliseconds, used to abort an acquisition when the image transfer cannot be completed within the delay. -#define IMAQdxAttributeVideoMode "AcquisitionAttributes::VideoMode" // Gets/sets the video mode for a camera. -#define IMAQdxAttributeBitsPerPixel "AcquisitionAttributes::BitsPerPixel" // Gets/sets the actual bits per pixel. For 16-bit components, this represents the actual bit depth (10-, 12-, 14-, or 16-bit). -#define IMAQdxAttributePixelSignedness "AcquisitionAttributes::PixelSignedness" // Gets/sets the signedness of the pixel. For 16-bit components, this represents the actual pixel signedness (Signed, or Unsigned). -#define IMAQdxAttributeReserveDualPackets "AcquisitionAttributes::ReserveDualPackets" // Gets/sets if dual packets will be reserved for a very large FireWire packet. -#define IMAQdxAttributeReceiveTimestampMode "AcquisitionAttributes::ReceiveTimestampMode" // Gets/sets the mode for timestamping images received by the driver. -#define IMAQdxAttributeActualPeakBandwidth "AcquisitionAttributes::AdvancedEthernet::BandwidthControl::ActualPeakBandwidth" // Read only. Returns the actual maximum peak bandwidth the camera will be configured to use. -#define IMAQdxAttributeDesiredPeakBandwidth "AcquisitionAttributes::AdvancedEthernet::BandwidthControl::DesiredPeakBandwidth" // Gets/sets the desired maximum peak bandwidth the camera should use. -#define IMAQdxAttributeDestinationMode "AcquisitionAttributes::AdvancedEthernet::Controller::DestinationMode" // Gets/Sets where the camera is instructed to send the image stream. -#define IMAQdxAttributeDestinationMulticastAddress "AcquisitionAttributes::AdvancedEthernet::Controller::DestinationMulticastAddress" // Gets/Sets the multicast address the camera should send data in multicast mode. -#define IMAQdxAttributeEventsEnabled "AcquisitionAttributes::AdvancedEthernet::EventParameters::EventsEnabled" // Gets/Sets if events will be handled. -#define IMAQdxAttributeMaxOutstandingEvents "AcquisitionAttributes::AdvancedEthernet::EventParameters::MaxOutstandingEvents" // Gets/Sets the maximum number of outstanding events to queue. -#define IMAQdxAttributeTestPacketEnabled "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::TestPacketEnabled" // Gets/Sets whether the driver will validate the image streaming settings using test packets prior to an acquisition -#define IMAQdxAttributeTestPacketTimeout "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::TestPacketTimeout" // Gets/Sets the timeout for validating test packet reception (if enabled) -#define IMAQdxAttributeMaxTestPacketRetries "AcquisitionAttributes::AdvancedEthernet::TestPacketParameters::MaxTestPacketRetries" // Gets/Sets the number of retries for validating test packet reception (if enabled) -#define IMAQdxAttributeChunkDataDecodingEnabled "AcquisitionAttributes::ChunkDataDecoding::ChunkDataDecodingEnabled" // Gets/Sets whether the driver will decode any chunk data in the image stream -#define IMAQdxAttributeChunkDataDecodingMaxElementSize "AcquisitionAttributes::ChunkDataDecoding::MaximumChunkCopySize" // Gets/Sets the maximum size of any single chunk data element that will be made available -#define IMAQdxAttributeLostPacketMode "AcquisitionAttributes::AdvancedEthernet::LostPacketMode" // Gets/sets the behavior when the user extracts a buffer that has missing packets. -#define IMAQdxAttributeMemoryWindowSize "AcquisitionAttributes::AdvancedEthernet::ResendParameters::MemoryWindowSize" // Gets/sets the size of the memory window of the camera in kilobytes. Should match the camera's internal buffer size. -#define IMAQdxAttributeResendsEnabled "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendsEnabled" // Gets/sets if resends will be issued for missing packets. -#define IMAQdxAttributeResendThresholdPercentage "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendThresholdPercentage" // Gets/sets the threshold of the packet processing window that will trigger packets to be resent. -#define IMAQdxAttributeResendBatchingPercentage "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendBatchingPercentage" // Gets/sets the percent of the packet resend threshold that will be issued as one group past the initial threshold sent in a single request. -#define IMAQdxAttributeMaxResendsPerPacket "AcquisitionAttributes::AdvancedEthernet::ResendParameters::MaxResendsPerPacket" // Gets/sets the maximum number of resend requests that will be issued for a missing packet. -#define IMAQdxAttributeResendResponseTimeout "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendResponseTimeout" // Gets/sets the time to wait for a resend request to be satisfied before sending another. -#define IMAQdxAttributeNewPacketTimeout "AcquisitionAttributes::AdvancedEthernet::ResendParameters::NewPacketTimeout" // Gets/sets the time to wait for new packets to arrive in a partially completed image before assuming the rest of the image was lost. -#define IMAQdxAttributeMissingPacketTimeout "AcquisitionAttributes::AdvancedEthernet::ResendParameters::MissingPacketTimeout" // Gets/sets the time to wait for a missing packet before issuing a resend. -#define IMAQdxAttributeResendTimerResolution "AcquisitionAttributes::AdvancedEthernet::ResendParameters::ResendTimerResolution" // Gets/sets the resolution of the packet processing system that is used for all packet-related timeouts. - - -//============================================================================== -// Functions -//============================================================================== -IMAQdxError NI_FUNC IMAQdxSnap(IMAQdxSession id, Image* image); -IMAQdxError NI_FUNC IMAQdxConfigureGrab(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxGrab(IMAQdxSession id, Image* image, bool32 waitForNextBuffer, uInt32* actualBufferNumber); -IMAQdxError NI_FUNC IMAQdxSequence(IMAQdxSession id, Image* images[], uInt32 count); -IMAQdxError NI_FUNC IMAQdxDiscoverEthernetCameras(const char* address, uInt32 timeout); -IMAQdxError NI_FUNC IMAQdxEnumerateCameras(IMAQdxCameraInformation cameraInformationArray[], uInt32* count, bool32 connectedOnly); -IMAQdxError NI_FUNC IMAQdxResetCamera(const char* name, bool32 resetAll); -IMAQdxError NI_FUNC IMAQdxOpenCamera(const char* name, IMAQdxCameraControlMode mode, IMAQdxSession* id); -IMAQdxError NI_FUNC IMAQdxCloseCamera(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxConfigureAcquisition(IMAQdxSession id, bool32 continuous, uInt32 bufferCount); -IMAQdxError NI_FUNC IMAQdxStartAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxGetImage(IMAQdxSession id, Image* image, IMAQdxBufferNumberMode mode, uInt32 desiredBufferNumber, uInt32* actualBufferNumber); -IMAQdxError NI_FUNC IMAQdxGetImageData(IMAQdxSession id, void* buffer, uInt32 bufferSize, IMAQdxBufferNumberMode mode, uInt32 desiredBufferNumber, uInt32* actualBufferNumber); -IMAQdxError NI_FUNC IMAQdxStopAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxUnconfigureAcquisition(IMAQdxSession id); -IMAQdxError NI_FUNC IMAQdxEnumerateVideoModes(IMAQdxSession id, IMAQdxVideoMode videoModeArray[], uInt32* count, uInt32* currentMode); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes(IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], uInt32* count, const char* root); -IMAQdxError NI_FUNC IMAQdxGetAttribute(IMAQdxSession id, const char* name, IMAQdxValueType type, void* value); -IMAQdxError NI_FUNCC IMAQdxSetAttribute(IMAQdxSession id, const char* name, IMAQdxValueType type, ...); -IMAQdxError NI_FUNC IMAQdxGetAttributeMinimum(IMAQdxSession id, const char* name, IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeMaximum(IMAQdxSession id, const char* name, IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeIncrement(IMAQdxSession id, const char* name, IMAQdxValueType type, void* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeType(IMAQdxSession id, const char* name, IMAQdxAttributeType* type); -IMAQdxError NI_FUNC IMAQdxIsAttributeReadable(IMAQdxSession id, const char* name, bool32* readable); -IMAQdxError NI_FUNC IMAQdxIsAttributeWritable(IMAQdxSession id, const char* name, bool32* writable); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributeValues(IMAQdxSession id, const char* name, IMAQdxEnumItem list[], uInt32* size); -IMAQdxError NI_FUNC IMAQdxGetAttributeTooltip(IMAQdxSession id, const char* name, char* tooltip, uInt32 length); -IMAQdxError NI_FUNC IMAQdxGetAttributeUnits(IMAQdxSession id, const char* name, char* units, uInt32 length); -IMAQdxError NI_FUNC IMAQdxRegisterFrameDoneEvent(IMAQdxSession id, uInt32 bufferInterval, FrameDoneEventCallbackPtr callbackFunction, void* callbackData); -IMAQdxError NI_FUNC IMAQdxRegisterPnpEvent(IMAQdxSession id, IMAQdxPnpEvent event, PnpEventCallbackPtr callbackFunction, void* callbackData); -IMAQdxError NI_FUNC IMAQdxWriteRegister(IMAQdxSession id, uInt32 offset, uInt32 value); -IMAQdxError NI_FUNC IMAQdxReadRegister(IMAQdxSession id, uInt32 offset, uInt32* value); -IMAQdxError NI_FUNC IMAQdxWriteMemory(IMAQdxSession id, uInt32 offset, const char* values, uInt32 count); -IMAQdxError NI_FUNC IMAQdxReadMemory(IMAQdxSession id, uInt32 offset, char* values, uInt32 count); -IMAQdxError NI_FUNC IMAQdxGetErrorString(IMAQdxError error, char* message, uInt32 messageLength); -IMAQdxError NI_FUNC IMAQdxWriteAttributes(IMAQdxSession id, const char* filename); -IMAQdxError NI_FUNC IMAQdxReadAttributes(IMAQdxSession id, const char* filename); -IMAQdxError NI_FUNC IMAQdxResetEthernetCameraAddress(const char* name, const char* address, const char* subnet, const char* gateway, uInt32 timeout); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes2(IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], uInt32* count, const char* root, IMAQdxAttributeVisibility visibility); -IMAQdxError NI_FUNC IMAQdxGetAttributeVisibility(IMAQdxSession id, const char* name, IMAQdxAttributeVisibility* visibility); -IMAQdxError NI_FUNC IMAQdxGetAttributeDescription(IMAQdxSession id, const char* name, char* description, uInt32 length); -IMAQdxError NI_FUNC IMAQdxGetAttributeDisplayName(IMAQdxSession id, const char* name, char* displayName, uInt32 length); -IMAQdxError NI_FUNC IMAQdxDispose(void* buffer); -IMAQdxError NI_FUNC IMAQdxRegisterAttributeUpdatedEvent(IMAQdxSession id, const char* name, AttributeUpdatedEventCallbackPtr callbackFunction, void* callbackData); -IMAQdxError NI_FUNC IMAQdxEnumerateAttributes3(IMAQdxSession id, IMAQdxAttributeInformation attributeInformationArray[], uInt32* count, const char* root, IMAQdxAttributeVisibility visibility); - - -#ifdef __cplusplus -} -#endif - - -#endif // ___niimaqdx_h___ diff --git a/wpilibj/src/athena/cpp/include/nivision.h b/wpilibj/src/athena/cpp/include/nivision.h deleted file mode 100644 index 09bb9842e7..0000000000 --- a/wpilibj/src/athena/cpp/include/nivision.h +++ /dev/null @@ -1,5345 +0,0 @@ -/*============================================================================*/ -/* IMAQ Vision */ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) National Instruments 2001. All Rights Reserved. */ -/*----------------------------------------------------------------------------*/ -/* */ -/* Title: NIVision.h */ -/* */ -/*============================================================================*/ -#if !defined(NiVision_h) -#define NiVision_h - -//============================================================================ -// Includes -//============================================================================ -#include - - -//============================================================================ -// Control Defines -//============================================================================ -#if !defined(IMAQ_IMPORT) - #ifndef __GNUC__ - #define IMAQ_IMPORT __declspec(dllimport) - #else - #define IMAQ_IMPORT - #endif -#endif - -#if !defined(IMAQ_FUNC) - #if !defined(__cplusplus) - #define IMAQ_FUNC IMAQ_IMPORT - #else - #define IMAQ_FUNC extern "C" IMAQ_IMPORT - #endif -#endif - -#if !defined(IMAQ_STDCALL) - #ifndef __GNUC__ - #define IMAQ_STDCALL __stdcall - #else - #define IMAQ_STDCALL - #endif -#endif - -#ifdef _CVI_ -#pragma EnableLibraryRuntimeChecking -#include -#endif - -#define IMAQ_CALLBACK __cdecl - -//============================================================================ -// Manifest Constants -//============================================================================ -#ifndef NULL - #ifdef __cplusplus - #define NULL 0 - #else - #define NULL ((void *)0) - #endif -#endif - -#ifndef FALSE - #define FALSE 0 -#endif - -#ifndef TRUE - #define TRUE 1 -#endif - -#define IMAQ_DEFAULT_SHOW_COORDINATES TRUE -#define IMAQ_DEFAULT_MAX_ICONS_PER_LINE 4 -#define IMAQ_DEFAULT_LEARNING_MODE IMAQ_LEARN_SHIFT_INFORMATION -#define IMAQ_DEFAULT_BMP_COMPRESS FALSE -#define IMAQ_DEFAULT_PNG_QUALITY 750 -#define IMAQ_DEFAULT_JPEG_QUALITY 750 -#define IMAQ_ALL_CONTOURS -1 -#define IMAQ_ALL_WINDOWS -1 -#define IMAQ_SHIFT 1 -#define IMAQ_ALT 2 -#define IMAQ_CTRL 4 -#define IMAQ_CAPS_LOCK 8 -#define IMAQ_MODAL_DIALOG -1 -#define IMAQ_INIT_RGB_TRANSPARENT { 0, 0, 0, 1 } -#define IMAQ_INIT_RGB_RED { 0, 0, 255, 0 } -#define IMAQ_INIT_RGB_BLUE { 255, 0, 0, 0 } -#define IMAQ_INIT_RGB_GREEN { 0, 255, 0, 0 } -#define IMAQ_INIT_RGB_YELLOW { 0, 255, 255, 0 } -#define IMAQ_INIT_RGB_WHITE { 255, 255, 255, 0 } -#define IMAQ_INIT_RGB_BLACK { 0, 0, 0, 0 } -#define IMAQ_USE_DEFAULT_QUALITY -1 -#define IMAQ_ALL_SAMPLES -1 -#define IMAQ_ALL_OBJECTS -1 -#define IMAQ_ALL_CHARACTERS -1 - -//============================================================================ -// Predefined Valid Characters -//============================================================================ -#define IMAQ_ANY_CHARACTER "" //Any Character -#define IMAQ_ALPHABETIC "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" //Alphabetic -#define IMAQ_ALPHANUMERIC "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" //Alphanumeric -#define IMAQ_UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" //Uppercase Letters -#define IMAQ_LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" //Lowercase Letters -#define IMAQ_DECIMAL_DIGITS "0123456789" //Decimal Digits -#define IMAQ_HEXADECIMAL_DIGITS "0123456789ABCDEFabcdef" //Hexadecimal Digits -#define IMAQ_PATTERN "\xFF" //Pattern (A single character string with the character value set to 255) -#define IMAQ_FORCE_SPACE " " //Force Space - -//============================================================================ -// Macros -//============================================================================ -#define IMAQ_NO_RECT imaqMakeRect( 0, 0, 0x7FFFFFFF, 0x7FFFFFFF) -#define IMAQ_NO_ROTATED_RECT imaqMakeRotatedRect( 0, 0, 0x7FFFFFFF, 0x7FFFFFFF, 0) -#define IMAQ_NO_POINT imaqMakePoint( -1, -1) -#define IMAQ_NO_POINT_FLOAT imaqMakePointFloat( -1.0, -1.0 ) -#define IMAQ_NO_OFFSET imaqMakePointFloat( 0.0, 0.0 ) - - - -//============================================================================ -// When in Borland, some functions must be mapped to different names. -// This accomplishes said task. -//============================================================================ -#if defined(__BORLANDC__) || (defined(_CVI_) && defined(_NI_BC_)) - #define imaqMakePoint imaqMakePoint_BC - #define imaqMakePointFloat imaqMakePointFloat_BC -#endif - - -//============================================================================ -// When in Watcom, some functions must be mapped to different names. -// This accomplishes said task. -//============================================================================ -#if defined(__WATCOMC__) || (defined(_CVI_) && defined(_NI_WC_)) - #define imaqMakePoint imaqMakePoint_BC - #define imaqMakePointFloat imaqMakePointFloat_BC -#endif - -//============================================================================ -// If using Visual C++, force startup & shutdown code to run. -//============================================================================ -#if defined(_MSC_VER) && !defined(_CVI_) && !defined(__BORLANDC__) - #pragma comment(linker, "/INCLUDE:_nivision_startup_shutdown") - #pragma comment(linker, "/DEFAULTLIB:nivision.lib") -#endif - -//============================================================================ -// Error Codes -//============================================================================ -#define ERR_SUCCESS 0 // No error. -#define ERR_SYSTEM_ERROR -1074396160 // System error. -#define ERR_OUT_OF_MEMORY -1074396159 // Not enough memory for requested operation. -#define ERR_MEMORY_ERROR -1074396158 // Memory error. -#define ERR_UNREGISTERED -1074396157 // Unlicensed copy of NI Vision. -#define ERR_NEED_FULL_VERSION -1074396156 // The function requires an NI Vision 5.0 Advanced license. -#define ERR_UNINIT -1074396155 // NI Vision did not initialize properly. -#define ERR_IMAGE_TOO_SMALL -1074396154 // The image is not large enough for the operation. -#define ERR_BARCODE_CODABAR -1074396153 // The barcode is not a valid Codabar barcode. -#define ERR_BARCODE_CODE39 -1074396152 // The barcode is not a valid Code 3 of 9 barcode. -#define ERR_BARCODE_CODE93 -1074396151 // The barcode is not a valid Code93 barcode. -#define ERR_BARCODE_CODE128 -1074396150 // The barcode is not a valid Code128 barcode. -#define ERR_BARCODE_EAN8 -1074396149 // The barcode is not a valid EAN8 barcode. -#define ERR_BARCODE_EAN13 -1074396148 // The barcode is not a valid EAN13 barcode. -#define ERR_BARCODE_I25 -1074396147 // The barcode is not a valid Interleaved 2 of 5 barcode. -#define ERR_BARCODE_MSI -1074396146 // The barcode is not a valid MSI barcode. -#define ERR_BARCODE_UPCA -1074396145 // The barcode is not a valid UPCA barcode. -#define ERR_BARCODE_CODE93_SHIFT -1074396144 // The Code93 barcode contains invalid shift encoding. -#define ERR_BARCODE_TYPE -1074396143 // The barcode type is invalid. -#define ERR_BARCODE_INVALID -1074396142 // The image does not represent a valid linear barcode. -#define ERR_BARCODE_CODE128_FNC -1074396141 // The FNC value in the Code128 barcode is not located before the first data value. -#define ERR_BARCODE_CODE128_SET -1074396140 // The starting code set in the Code128 barcode is not valid. -#define ERR_ROLLBACK_RESOURCE_OUT_OF_MEMORY -1074396139 // Not enough reserved memory in the timed environment for the requested operation. -#define ERR_ROLLBACK_NOT_SUPPORTED -1074396138 // The function is not supported when a time limit is active. -#define ERR_DIRECTX_DLL_NOT_FOUND -1074396137 // Quartz.dll not found. Install DirectX 8.1 or later. -#define ERR_DIRECTX_INVALID_FILTER_QUALITY -1074396136 // The filter quality you provided is invalid. Valid quality values range from -1 to 1000. -#define ERR_INVALID_BUTTON_LABEL -1074396135 // Invalid button label. -#define ERR_THREAD_INITIALIZING -1074396134 // Could not execute the function in the separate thread because the thread has not completed initialization. -#define ERR_THREAD_COULD_NOT_INITIALIZE -1074396133 // Could not execute the function in the separate thread because the thread could not initialize. -#define ERR_MASK_NOT_TEMPLATE_SIZE -1074396132 // The mask must be the same size as the template. -#define ERR_NOT_RECT_OR_ROTATED_RECT -1074396130 // The ROI must only have either a single Rectangle contour or a single Rotated Rectangle contour. -#define ERR_ROLLBACK_UNBOUNDED_INTERFACE -1074396129 // During timed execution, you must use the preallocated version of this operation. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_3 -1074396128 // An image being modified by one process cannot be requested by another process while a time limit is active. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_2 -1074396127 // An image with pattern matching, calibration, or overlay information cannot be manipulated while a time limit is active. -#define ERR_ROLLBACK_RESOURCE_CONFLICT_1 -1074396126 // An image created before a time limit is started cannot be resized while a time limit is active. -#define ERR_INVALID_CONTRAST_THRESHOLD -1074396125 // Invalid contrast threshold. The threshold value must be greater than 0. -#define ERR_INVALID_CALIBRATION_ROI_MODE -1074396124 // NI Vision does not support the calibration ROI mode you supplied. -#define ERR_INVALID_CALIBRATION_MODE -1074396123 // NI Vision does not support the calibration mode you supplied. -#define ERR_DRAWTEXT_COLOR_MUST_BE_GRAYSCALE -1074396122 // Set the foreground and background text colors to grayscale to draw on a U8 image. -#define ERR_SATURATION_THRESHOLD_OUT_OF_RANGE -1074396121 // The value of the saturation threshold must be from 0 to 255. -#define ERR_NOT_IMAGE -1074396120 // Not an image. -#define ERR_CUSTOMDATA_INVALID_KEY -1074396119 // They custom data key you supplied is invalid. The only valid character values are decimal 32-126 and 161-255. There must also be no repeated, leading, or trailing spaces. -#define ERR_INVALID_STEP_SIZE -1074396118 // Step size must be greater than zero and less than Image size -#define ERR_MATRIX_SIZE -1074396117 // Invalid matrix size in the structuring element. -#define ERR_CALIBRATION_INSF_POINTS -1074396116 // Insufficient number of calibration feature points. -#define ERR_CALIBRATION_IMAGE_CORRECTED -1074396115 // The operation is invalid in a corrected image. -#define ERR_CALIBRATION_INVALID_ROI -1074396114 // The ROI contains an invalid contour type or is not contained in the ROI learned for calibration. -#define ERR_CALIBRATION_IMAGE_UNCALIBRATED -1074396113 // The source/input image has not been calibrated. -#define ERR_INCOMP_MATRIX_SIZE -1074396112 // The number of pixel and real-world coordinates must be equal. -#define ERR_CALIBRATION_FAILED_TO_FIND_GRID -1074396111 // Unable to automatically detect grid because the image is too distorted. -#define ERR_CALIBRATION_INFO_VERSION -1074396110 // Invalid calibration information version. -#define ERR_CALIBRATION_INVALID_SCALING_FACTOR -1074396109 // Invalid calibration scaling factor. -#define ERR_CALIBRATION_ERRORMAP -1074396108 // The calibration error map cannot be computed. -#define ERR_CALIBRATION_INFO_1 -1074396107 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_2 -1074396106 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_3 -1074396105 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_4 -1074396104 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_5 -1074396103 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_6 -1074396102 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_MICRO_PLANE -1074396101 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_PERSPECTIVE_PROJECTION -1074396100 // Invalid calibration template image. -#define ERR_CALIBRATION_INFO_SIMPLE_TRANSFORM -1074396099 // Invalid calibration template image. -#define ERR_RESERVED_MUST_BE_NULL -1074396098 // You must pass NULL for the reserved parameter. -#define ERR_INVALID_PARTICLE_PARAMETER_VALUE -1074396097 // You entered an invalid selection in the particle parameter. -#define ERR_NOT_AN_OBJECT -1074396096 // Not an object. -#define ERR_CALIBRATION_DUPLICATE_REFERENCE_POINT -1074396095 // The reference points passed are inconsistent. At least two similar pixel coordinates correspond to different real-world coordinates. -#define ERR_ROLLBACK_RESOURCE_CANNOT_UNLOCK -1074396094 // A resource conflict occurred in the timed environment. Two processes cannot manage the same resource and be time bounded. -#define ERR_ROLLBACK_RESOURCE_LOCKED -1074396093 // A resource conflict occurred in the timed environment. Two processes cannot access the same resource and be time bounded. -#define ERR_ROLLBACK_RESOURCE_NON_EMPTY_INITIALIZE -1074396092 // Multiple timed environments are not supported. -#define ERR_ROLLBACK_RESOURCE_UNINITIALIZED_ENABLE -1074396091 // A time limit cannot be started until the timed environment is initialized. -#define ERR_ROLLBACK_RESOURCE_ENABLED -1074396090 // Multiple timed environments are not supported. -#define ERR_ROLLBACK_RESOURCE_REINITIALIZE -1074396089 // The timed environment is already initialized. -#define ERR_ROLLBACK_RESIZE -1074396088 // The results of the operation exceeded the size limits on the output data arrays. -#define ERR_ROLLBACK_STOP_TIMER -1074396087 // No time limit is available to stop. -#define ERR_ROLLBACK_START_TIMER -1074396086 // A time limit could not be set. -#define ERR_ROLLBACK_INIT_TIMER -1074396085 // The timed environment could not be initialized. -#define ERR_ROLLBACK_DELETE_TIMER -1074396084 // No initialized timed environment is available to close. -#define ERR_ROLLBACK_TIMEOUT -1074396083 // The time limit has expired. -#define ERR_PALETTE_NOT_SUPPORTED -1074396082 // Only 8-bit images support the use of palettes. Either do not use a palette, or convert your image to an 8-bit image before using a palette. -#define ERR_BAD_PASSWORD -1074396081 // Incorrect password. -#define ERR_INVALID_IMAGE_TYPE -1074396080 // Invalid image type. -#define ERR_INVALID_METAFILE_HANDLE -1074396079 // Invalid metafile handle. -#define ERR_INCOMP_TYPE -1074396077 // Incompatible image type. -#define ERR_COORD_SYS_FIRST_AXIS -1074396076 // Unable to fit a line for the primary axis. -#define ERR_COORD_SYS_SECOND_AXIS -1074396075 // Unable to fit a line for the secondary axis. -#define ERR_INCOMP_SIZE -1074396074 // Incompatible image size. -#define ERR_MASK_OUTSIDE_IMAGE -1074396073 // When the mask's offset was applied, the mask was entirely outside of the image. -#define ERR_INVALID_BORDER -1074396072 // Invalid image border. -#define ERR_INVALID_SCAN_DIRECTION -1074396071 // Invalid scan direction. -#define ERR_INVALID_FUNCTION -1074396070 // Unsupported function. -#define ERR_INVALID_COLOR_MODE -1074396069 // NI Vision does not support the color mode you specified. -#define ERR_INVALID_ACTION -1074396068 // The function does not support the requested action. -#define ERR_IMAGES_NOT_DIFF -1074396067 // The source image and destination image must be different. -#define ERR_INVALID_POINTSYMBOL -1074396066 // Invalid point symbol. -#define ERR_CANT_RESIZE_EXTERNAL -1074396065 // Cannot resize an image in an acquisition buffer. -#define ERR_EXTERNAL_NOT_SUPPORTED -1074396064 // This operation is not supported for images in an acquisition buffer. -#define ERR_EXTERNAL_ALIGNMENT -1074396063 // The external buffer must be aligned on a 4-byte boundary. The line width and border pixels must be 4-byte aligned, as well. -#define ERR_INVALID_TOLERANCE -1074396062 // The tolerance parameter must be greater than or equal to 0. -#define ERR_INVALID_WINDOW_SIZE -1074396061 // The size of each dimension of the window must be greater than 2 and less than or equal to the size of the image in the corresponding dimension. -#define ERR_JPEG2000_LOSSLESS_WITH_FLOATING_POINT -1074396060 // Lossless compression cannot be used with the floating point wavelet transform mode. Either set the wavelet transform mode to integer, or use lossy compression. -#define ERR_INVALID_MAX_ITERATIONS -1074396059 // Invalid maximum number of iterations. Maximum number of iterations must be greater than zero. -#define ERR_INVALID_ROTATION_MODE -1074396058 // Invalid rotation mode. -#define ERR_INVALID_SEARCH_VECTOR_WIDTH -1074396057 // Invalid search vector width. The width must be an odd number greater than zero. -#define ERR_INVALID_MATRIX_MIRROR_MODE -1074396056 // Invalid matrix mirror mode. -#define ERR_INVALID_ASPECT_RATIO -1074396055 // Invalid aspect ratio. Valid aspect ratios must be greater than or equal to zero. -#define ERR_INVALID_CELL_FILL_TYPE -1074396054 // Invalid cell fill type. -#define ERR_INVALID_BORDER_INTEGRITY -1074396053 // Invalid border integrity. Valid values range from 0 to 100. -#define ERR_INVALID_DEMODULATION_MODE -1074396052 // Invalid demodulation mode. -#define ERR_INVALID_CELL_FILTER_MODE -1074396051 // Invalid cell filter mode. -#define ERR_INVALID_ECC_TYPE -1074396050 // Invalid ECC type. -#define ERR_INVALID_MATRIX_POLARITY -1074396049 // Invalid matrix polarity. -#define ERR_INVALID_CELL_SAMPLE_SIZE -1074396048 // Invalid cell sample size. -#define ERR_INVALID_LINEAR_AVERAGE_MODE -1074396047 // Invalid linear average mode. -#define ERR_INVALID_2D_BARCODE_CONTRAST_FOR_ROI -1074396046 // When using a region of interest that is not a rectangle, you must specify the contrast mode of the barcode as either black on white or white on black. -#define ERR_INVALID_2D_BARCODE_SUBTYPE -1074396045 // Invalid 2-D barcode Data Matrix subtype. -#define ERR_INVALID_2D_BARCODE_SHAPE -1074396044 // Invalid 2-D barcode shape. -#define ERR_INVALID_2D_BARCODE_CELL_SHAPE -1074396043 // Invalid 2-D barcode cell shape. -#define ERR_INVALID_2D_BARCODE_CONTRAST -1074396042 // Invalid 2-D barcode contrast. -#define ERR_INVALID_2D_BARCODE_TYPE -1074396041 // Invalid 2-D barcode type. -#define ERR_DRIVER -1074396040 // Cannot access NI-IMAQ driver. -#define ERR_IO_ERROR -1074396039 // I/O error. -#define ERR_FIND_COORDSYS_MORE_THAN_ONE_EDGE -1074396038 // When searching for a coordinate system, the number of lines to fit must be 1. -#define ERR_TIMEOUT -1074396037 // Trigger timeout. -#define ERR_INVALID_SKELETONMODE -1074396036 // The Skeleton mode you specified is invalid. -#define ERR_TEMPLATEIMAGE_NOCIRCLE -1074396035 // The template image does not contain enough information for learning the aggressive search strategy. -#define ERR_TEMPLATEIMAGE_EDGEINFO -1074396034 // The template image does not contain enough edge information for the sample size(s) requested. -#define ERR_TEMPLATEDESCRIPTOR_LEARNSETUPDATA -1074396033 // Invalid template descriptor. -#define ERR_TEMPLATEDESCRIPTOR_ROTATION_SEARCHSTRATEGY -1074396032 // The template descriptor does not contain data required for the requested search strategy in rotation-invariant matching. -#define ERR_INVALID_TETRAGON -1074396031 // The input tetragon must have four points. The points are specified clockwise starting with the top left point. -#define ERR_TOO_MANY_CLASSIFICATION_SESSIONS -1074396030 // There are too many classification sessions open. You must close a session before you can open another one. -#define ERR_TIME_BOUNDED_EXECUTION_NOT_SUPPORTED -1074396028 // NI Vision no longer supports time-bounded execution. -#define ERR_INVALID_COLOR_RESOLUTION -1074396027 // Invalid Color Resolution for the Color Classifier -#define ERR_INVALID_PROCESS_TYPE_FOR_EDGE_DETECTION -1074396026 // Invalid process type for edge detection. -#define ERR_INVALID_ANGLE_RANGE_FOR_STRAIGHT_EDGE -1074396025 // Angle range value should be equal to or greater than zero. -#define ERR_INVALID_MIN_COVERAGE_FOR_STRAIGHT_EDGE -1074396024 // Minimum coverage value should be greater than zero. -#define ERR_INVALID_ANGLE_TOL_FOR_STRAIGHT_EDGE -1074396023 // The angle tolerance should be equal to or greater than 0.001. -#define ERR_INVALID_SEARCH_MODE_FOR_STRAIGHT_EDGE -1074396022 // Invalid search mode for detecting straight edges -#define ERR_INVALID_KERNEL_SIZE_FOR_EDGE_DETECTION -1074396021 // Invalid kernel size for edge detection. The minimum kernel size is 3, the maximum kernel size is 1073741823 and the kernel size must be odd. -#define ERR_INVALID_GRADING_MODE -1074396020 // Invalid grading mode. -#define ERR_INVALID_THRESHOLD_PERCENTAGE -1074396019 // Invalid threshold percentage. Valid values range from 0 to 100. -#define ERR_INVALID_EDGE_POLARITY_SEARCH_MODE -1074396018 // Invalid edge polarity search mode. -#define ERR_OPENING_NEWER_AIM_GRADING_DATA -1074396017 // The AIM grading data attached to the image you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_NO_VIDEO_DRIVER -1074396016 // No video driver is installed. -#define ERR_RPC_EXECUTE_IVB -1074396015 // Unable to establish network connection with remote system. -#define ERR_INVALID_VIDEO_BLIT -1074396014 // RT Video Out does not support displaying the supplied image type at the selected color depth. -#define ERR_INVALID_VIDEO_MODE -1074396013 // Invalid video mode. -#define ERR_RPC_EXECUTE -1074396012 // Unable to display remote image on network connection. -#define ERR_RPC_BIND -1074396011 // Unable to establish network connection. -#define ERR_INVALID_FRAME_NUMBER -1074396010 // Invalid frame number. -#define ERR_DIRECTX -1074396009 // An internal DirectX error has occurred. Try upgrading to the latest version of DirectX. -#define ERR_DIRECTX_NO_FILTER -1074396008 // An appropriate DirectX filter to process this file could not be found. Install the filter that was used to create this AVI. Upgrading to the latest version of DirectX may correct this error. NI Vision requires DirectX 8.1 or higher. -#define ERR_DIRECTX_INCOMPATIBLE_COMPRESSION_FILTER -1074396007 // Incompatible compression filter. -#define ERR_DIRECTX_UNKNOWN_COMPRESSION_FILTER -1074396006 // Unknown compression filter. -#define ERR_INVALID_AVI_SESSION -1074396005 // Invalid AVI session. -#define ERR_DIRECTX_CERTIFICATION_FAILURE -1074396004 // A software key is restricting the use of this compression filter. -#define ERR_AVI_DATA_EXCEEDS_BUFFER_SIZE -1074396003 // The data for this frame exceeds the data buffer size specified when creating the AVI file. -#define ERR_INVALID_LINEGAUGEMETHOD -1074396002 // Invalid line gauge method. -#define ERR_TOO_MANY_AVI_SESSIONS -1074396001 // There are too many AVI sessions open. You must close a session before you can open another one. -#define ERR_FILE_FILE_HEADER -1074396000 // Invalid file header. -#define ERR_FILE_FILE_TYPE -1074395999 // Invalid file type. -#define ERR_FILE_COLOR_TABLE -1074395998 // Invalid color table. -#define ERR_FILE_ARGERR -1074395997 // Invalid parameter. -#define ERR_FILE_OPEN -1074395996 // File is already open for writing. -#define ERR_FILE_NOT_FOUND -1074395995 // File not found. -#define ERR_FILE_TOO_MANY_OPEN -1074395994 // Too many files open. -#define ERR_FILE_IO_ERR -1074395993 // File I/O error. -#define ERR_FILE_PERMISSION -1074395992 // File access denied. -#define ERR_FILE_INVALID_TYPE -1074395991 // NI Vision does not support the file type you specified. -#define ERR_FILE_GET_INFO -1074395990 // Could not read Vision info from file. -#define ERR_FILE_READ -1074395989 // Unable to read data. -#define ERR_FILE_WRITE -1074395988 // Unable to write data. -#define ERR_FILE_EOF -1074395987 // Premature end of file. -#define ERR_FILE_FORMAT -1074395986 // Invalid file format. -#define ERR_FILE_OPERATION -1074395985 // Invalid file operation. -#define ERR_FILE_INVALID_DATA_TYPE -1074395984 // NI Vision does not support the file data type you specified. -#define ERR_FILE_NO_SPACE -1074395983 // Disk full. -#define ERR_INVALID_FRAMES_PER_SECOND -1074395982 // The frames per second in an AVI must be greater than zero. -#define ERR_INSUFFICIENT_BUFFER_SIZE -1074395981 // The buffer that was passed in is not big enough to hold all of the data. -#define ERR_COM_INITIALIZE -1074395980 // Error initializing COM. -#define ERR_INVALID_PARTICLE_INFO -1074395979 // The image has invalid particle information. Call imaqCountParticles on the image to create particle information. -#define ERR_INVALID_PARTICLE_NUMBER -1074395978 // Invalid particle number. -#define ERR_AVI_VERSION -1074395977 // The AVI file was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this AVI file. -#define ERR_NUMBER_OF_PALETTE_COLORS -1074395976 // The color palette must have exactly 0 or 256 entries. -#define ERR_AVI_TIMEOUT -1074395975 // DirectX has timed out reading or writing the AVI file. When closing an AVI file, try adding an additional delay. When reading an AVI file, try reducing CPU and disk load. -#define ERR_UNSUPPORTED_JPEG2000_COLORSPACE_METHOD -1074395974 // NI Vision does not support reading JPEG2000 files with this colorspace method. -#define ERR_JPEG2000_UNSUPPORTED_MULTIPLE_LAYERS -1074395973 // NI Vision does not support reading JPEG2000 files with more than one layer. -#define ERR_DIRECTX_ENUMERATE_FILTERS -1074395972 // DirectX is unable to enumerate the compression filters. This is caused by a third-party compression filter that is either improperly installed or is preventing itself from being enumerated. Remove any recently installed compression filters and try again. -#define ERR_INVALID_OFFSET -1074395971 // The offset you specified must be size 2. -#define ERR_INIT -1074395960 // Initialization error. -#define ERR_CREATE_WINDOW -1074395959 // Unable to create window. -#define ERR_WINDOW_ID -1074395958 // Invalid window ID. -#define ERR_ARRAY_SIZE_MISMATCH -1074395957 // The array sizes are not compatible. -#define ERR_INVALID_QUALITY -1074395956 // The quality you provided is invalid. Valid quality values range from -1 to 1000. -#define ERR_INVALID_MAX_WAVELET_TRANSFORM_LEVEL -1074395955 // Invalid maximum wavelet transform level. Valid values range from 0 to 255. -#define ERR_INVALID_QUANTIZATION_STEP_SIZE -1074395954 // The quantization step size must be greater than or equal to 0. -#define ERR_INVALID_WAVELET_TRANSFORM_MODE -1074395953 // Invalid wavelet transform mode. -#define ERR_ROI_NOT_POINT -1074395952 // The ROI must only have a single Point contour. -#define ERR_ROI_NOT_POINTS -1074395951 // The ROI must only have Point contours. -#define ERR_ROI_NOT_LINE -1074395950 // The ROI must only have a single Line contour. -#define ERR_ROI_NOT_ANNULUS -1074395949 // The ROI must only have a single Annulus contour. -#define ERR_INVALID_MEASURE_PARTICLES_CALIBRATION_MODE -1074395948 // Invalid measure particles calibration mode. -#define ERR_INVALID_PARTICLE_CLASSIFIER_THRESHOLD_TYPE -1074395947 // Invalid particle classifier threshold type. -#define ERR_INVALID_DISTANCE -1074395946 // Invalid Color Segmentation Distance -#define ERR_INVALID_PARTICLE_AREA -1074395945 // Invalid Color Segmenation Particle Area -#define ERR_CLASS_NAME_NOT_FOUND -1074395944 // Required Class name is not found in trained labels/Class names -#define ERR_NUMBER_LABEL_LIMIT_EXCEEDED -1074395943 // Number of Labels exceeded limit of label Image type -#define ERR_INVALID_DISTANCE_LEVEL -1074395942 // Invalid Color Segmentation distance level -#define ERR_INVALID_SVM_TYPE -1074395941 // Invalid SVM model type -#define ERR_INVALID_SVM_KERNEL -1074395940 // Invalid SVM kernel type -#define ERR_NO_SUPPORT_VECTOR_FOUND -1074395939 // No Support Vector is found at SVM training -#define ERR_COST_LABEL_NOT_FOUND -1074395938 // Label name is not found in added samples -#define ERR_EXCEEDED_SVM_MAX_ITERATION -1074395937 // SVM training exceeded maximim Iteration limit -#define ERR_INVALID_SVM_PARAMETER -1074395936 // Invalid SVM Parameter -#define ERR_INVALID_IDENTIFICATION_SCORE -1074395935 // Invalid Identification score. Must be between 0-1000. -#define ERR_INVALID_TEXTURE_FEATURE -1074395934 // Requested for invalid texture feature -#define ERR_INVALID_COOCCURRENCE_LEVEL -1074395933 // The coOccurrence Level must lie between 1 and the maximum pixel value of an image (255 for U8 image) -#define ERR_INVALID_WAVELET_SUBBAND -1074395932 // Request for invalid wavelet subBand -#define ERR_INVALID_FINAL_STEP_SIZE -1074395931 // The final step size must be lesser than the initial step size -#define ERR_INVALID_ENERGY -1074395930 // Minimum Energy should lie between 0 and 100 -#define ERR_INVALID_TEXTURE_LABEL -1074395929 // The classification label must be texture or defect for texture defect classifier -#define ERR_INVALID_WAVELET_TYPE -1074395928 // The wavelet type is invalid -#define ERR_SAME_WAVELET_BANDS_SELECTED -1074395927 // Same Wavelet band is selected multiple times -#define ERR_IMAGE_SIZE_MISMATCH -1074395926 // The two input image sizes are different -#define ERR_NUMBER_CLASS -1074395920 // Invalid number of classes. -#define ERR_INVALID_LUCAS_KANADE_WINDOW_SIZE -1074395888 // Both dimensions of the window size should be odd, greater than 2 and less than 16. -#define ERR_INVALID_MATRIX_TYPE -1074395887 // The type of matrix supplied to the function is not supported. -#define ERR_INVALID_OPTICAL_FLOW_TERMINATION_CRITERIA_TYPE -1074395886 // An invalid termination criteria was specified for the optical flow computation. -#define ERR_LKP_NULL_PYRAMID -1074395885 // The pyramid levels where not properly allocated. -#define ERR_INVALID_PYRAMID_LEVEL -1074395884 // The pyramid level specified cannot be negative -#define ERR_INVALID_LKP_KERNEL -1074395883 // The kernel must be symmetric with non-zero coefficients and of odd size -#define ERR_INVALID_HORN_SCHUNCK_LAMBDA -1074395882 // Invalid smoothing parameter in Horn Schunck operation. -#define ERR_INVALID_HORN_SCHUNCK_TYPE -1074395881 // Invalid stopping criteria type for Horn Schunck optical flow. -#define ERR_PARTICLE -1074395880 // Invalid particle. -#define ERR_BAD_MEASURE -1074395879 // Invalid measure number. -#define ERR_PROP_NODE_WRITE_NOT_SUPPORTED -1074395878 // The Image Display control does not support writing this property node. -#define ERR_COLORMODE_REQUIRES_CHANGECOLORSPACE2 -1074395877 // The specified color mode requires the use of imaqChangeColorSpace2. -#define ERR_UNSUPPORTED_COLOR_MODE -1074395876 // This function does not currently support the color mode you specified. -#define ERR_BARCODE_PHARMACODE -1074395875 // The barcode is not a valid Pharmacode symbol -#define ERR_BAD_INDEX -1074395840 // Invalid handle table index. -#define ERR_INVALID_COMPRESSION_RATIO -1074395837 // The compression ratio must be greater than or equal to 1. -#define ERR_TOO_MANY_CONTOURS -1074395801 // The ROI contains too many contours. -#define ERR_PROTECTION -1074395800 // Protection error. -#define ERR_INTERNAL -1074395799 // Internal error. -#define ERR_INVALID_CUSTOM_SAMPLE -1074395798 // The size of the feature vector in the custom sample must match the size of those you have already added. -#define ERR_INVALID_CLASSIFIER_SESSION -1074395797 // Not a valid classifier session. -#define ERR_INVALID_KNN_METHOD -1074395796 // You requested an invalid Nearest Neighbor classifier method. -#define ERR_K_TOO_LOW -1074395795 // The k parameter must be greater than two. -#define ERR_K_TOO_HIGH -1074395794 // The k parameter must be <= the number of samples in each class. -#define ERR_INVALID_OPERATION_ON_COMPACT_SESSION_ATTEMPTED -1074395793 // This classifier session is compact. Only the Classify and Dispose functions may be called on a compact classifier session. -#define ERR_CLASSIFIER_SESSION_NOT_TRAINED -1074395792 // This classifier session is not trained. You may only call this function on a trained classifier session. -#define ERR_CLASSIFIER_INVALID_SESSION_TYPE -1074395791 // This classifier function cannot be called on this type of classifier session. -#define ERR_INVALID_DISTANCE_METRIC -1074395790 // You requested an invalid distance metric. -#define ERR_OPENING_NEWER_CLASSIFIER_SESSION -1074395789 // The classifier session you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_NO_SAMPLES -1074395788 // This operation cannot be performed because you have not added any samples. -#define ERR_INVALID_CLASSIFIER_TYPE -1074395787 // You requested an invalid classifier type. -#define ERR_INVALID_PARTICLE_OPTIONS -1074395786 // The sum of Scale Dependence and Symmetry Dependence must be less than 1000. -#define ERR_NO_PARTICLE -1074395785 // The image yielded no particles. -#define ERR_INVALID_LIMITS -1074395784 // The limits you supplied are not valid. -#define ERR_BAD_SAMPLE_INDEX -1074395783 // The Sample Index fell outside the range of Samples. -#define ERR_DESCRIPTION_TOO_LONG -1074395782 // The description must be <= 255 characters. -#define ERR_CLASSIFIER_INVALID_ENGINE_TYPE -1074395781 // The engine for this classifier session does not support this operation. -#define ERR_INVALID_PARTICLE_TYPE -1074395780 // You requested an invalid particle type. -#define ERR_CANNOT_COMPACT_UNTRAINED -1074395779 // You may only save a session in compact form if it is trained. -#define ERR_INVALID_KERNEL_SIZE -1074395778 // The Kernel size must be smaller than the image size. -#define ERR_INCOMPATIBLE_CLASSIFIER_TYPES -1074395777 // The session you read from file must be the same type as the session you passed in. -#define ERR_INVALID_USE_OF_COMPACT_SESSION_FILE -1074395776 // You can not use a compact classification file with read options other than Read All. -#define ERR_ROI_HAS_OPEN_CONTOURS -1074395775 // The ROI you passed in may only contain closed contours. -#define ERR_NO_LABEL -1074395774 // You must pass in a label. -#define ERR_NO_DEST_IMAGE -1074395773 // You must provide a destination image. -#define ERR_INVALID_REGISTRATION_METHOD -1074395772 // You provided an invalid registration method. -#define ERR_OPENING_NEWER_INSPECTION_TEMPLATE -1074395771 // The golden template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_INVALID_INSPECTION_TEMPLATE -1074395770 // Invalid golden template. -#define ERR_INVALID_EDGE_THICKNESS -1074395769 // Edge Thickness to Ignore must be greater than zero. -#define ERR_INVALID_SCALE -1074395768 // Scale must be greater than zero. -#define ERR_INVALID_ALIGNMENT -1074395767 // The supplied scale is invalid for your template. -#define ERR_DEPRECATED_FUNCTION -1074395766 // This backwards-compatibility function can not be used with this session. Use newer, supported functions instead. -#define ERR_INVALID_NORMALIZATION_METHOD -1074395763 // You must provide a valid normalization method. -#define ERR_INVALID_NIBLACK_DEVIATION_FACTOR -1074395762 // The deviation factor for Niblack local threshold must be between 0 and 1. -#define ERR_BOARD_NOT_FOUND -1074395760 // Board not found. -#define ERR_BOARD_NOT_OPEN -1074395758 // Board not opened. -#define ERR_DLL_NOT_FOUND -1074395757 // DLL not found. -#define ERR_DLL_FUNCTION_NOT_FOUND -1074395756 // DLL function not found. -#define ERR_TRIG_TIMEOUT -1074395754 // Trigger timeout. -#define ERR_CONTOUR_INVALID_REFINEMENTS -1074395746 // Invalid number specified for maximum contour refinements. -#define ERR_TOO_MANY_CURVES -1074395745 // Too many curves extracted from image. Raise the edge threshold or reduce the ROI. -#define ERR_CONTOUR_INVALID_KERNEL_FOR_SMOOTHING -1074395744 // Invalid kernel for contour smoothing. Zero indicates no smoothing, otherwise value must be odd. -#define ERR_CONTOUR_LINE_INVALID -1074395743 // The contour line fit is invalid. Line segment start and stop must differ. -#define ERR_CONTOUR_TEMPLATE_IMAGE_INVALID -1074395742 // The template image must be trained with IMAQ Learn Contour Pattern or be the same size as the target image. -#define ERR_CONTOUR_GPM_FAIL -1074395741 // Matching failed to align the template and target contours. -#define ERR_CONTOUR_OPENING_NEWER_VERSION -1074395740 // The contour you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_CONTOUR_CONNECT_DUPLICATE -1074395739 // Only one range is allowed per curve connection constraint type. -#define ERR_CONTOUR_CONNECT_TYPE -1074395738 // Invalid contour connection constraint type. -#define ERR_CONTOUR_MATCH_STR_NOT_APPLICABLE -1074395737 // In order to use contour matching, you must provide a template image that has been trained with IMAQ Learn Contour Pattern -#define ERR_CONTOUR_CURVATURE_KERNEL -1074395736 // Invalid kernel width for curvature calculation. Must be an odd value greater than 1. -#define ERR_CONTOUR_EXTRACT_SELECTION -1074395735 // Invalid Contour Selection method for contour extraction. -#define ERR_CONTOUR_EXTRACT_DIRECTION -1074395734 // Invalid Search Direction for contour extraction. -#define ERR_CONTOUR_EXTRACT_ROI -1074395733 // Invalid ROI for contour extraction. The ROI must contain an annulus, rectangle or rotated rectangle. -#define ERR_CONTOUR_NO_CURVES -1074395732 // No curves were found in the image. -#define ERR_CONTOUR_COMPARE_KERNEL -1074395731 // Invalid Smoothing Kernel width for contour comparison. Must be zero or an odd positive integer. -#define ERR_CONTOUR_COMPARE_SINGLE_IMAGE -1074395730 // If no template image is provided, the target image must contain both a contour with extracted points and a fitted equation. -#define ERR_CONTOUR_INVALID -1074395729 // Invalid contour image. -#define ERR_INVALID_2D_BARCODE_SEARCH_MODE -1074395728 // NI Vision does not support the search mode you provided. -#define ERR_UNSUPPORTED_2D_BARCODE_SEARCH_MODE -1074395727 // NI Vision does not support the search mode you provided for the type of 2D barcode for which you are searching. -#define ERR_MATCHFACTOR_OBSOLETE -1074395726 // matchFactor has been obsoleted. Instead, set the initialMatchListLength and matchListReductionFactor in the MatchPatternAdvancedOptions structure. -#define ERR_DATA_VERSION -1074395725 // The data was stored with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this data. -#define ERR_CUSTOMDATA_INVALID_SIZE -1074395724 // The size you specified is out of the valid range. -#define ERR_CUSTOMDATA_KEY_NOT_FOUND -1074395723 // The key you specified cannot be found in the image. -#define ERR_CLASSIFIER_CLASSIFY_IMAGE_WITH_CUSTOM_SESSION -1074395722 // Custom classifier sessions only classify feature vectors. They do not support classifying images. -#define ERR_INVALID_BIT_DEPTH -1074395721 // NI Vision does not support the bit depth you supplied for the image you supplied. -#define ERR_BAD_ROI -1074395720 // Invalid ROI. -#define ERR_BAD_ROI_BOX -1074395719 // Invalid ROI global rectangle. -#define ERR_LAB_VERSION -1074395718 // The version of LabVIEW or BridgeVIEW you are running does not support this operation. -#define ERR_INVALID_RANGE -1074395717 // The range you supplied is invalid. -#define ERR_INVALID_SCALING_METHOD -1074395716 // NI Vision does not support the scaling method you provided. -#define ERR_INVALID_CALIBRATION_UNIT -1074395715 // NI Vision does not support the calibration unit you supplied. -#define ERR_INVALID_AXIS_ORIENTATION -1074395714 // NI Vision does not support the axis orientation you supplied. -#define ERR_VALUE_NOT_IN_ENUM -1074395713 // Value not in enumeration. -#define ERR_WRONG_REGION_TYPE -1074395712 // You selected a region that is not of the right type. -#define ERR_NOT_ENOUGH_REGIONS -1074395711 // You specified a viewer that does not contain enough regions. -#define ERR_TOO_MANY_PARTICLES -1074395710 // The image has too many particles for this process. -#define ERR_AVI_UNOPENED_SESSION -1074395709 // The AVI session has not been opened. -#define ERR_AVI_READ_SESSION_REQUIRED -1074395708 // The AVI session is a write session, but this operation requires a read session. -#define ERR_AVI_WRITE_SESSION_REQUIRED -1074395707 // The AVI session is a read session, but this operation requires a write session. -#define ERR_AVI_SESSION_ALREADY_OPEN -1074395706 // This AVI session is already open. You must close it before calling the Create or Open functions. -#define ERR_DATA_CORRUPTED -1074395705 // The data is corrupted and cannot be read. -#define ERR_INVALID_COMPRESSION_TYPE -1074395704 // Invalid compression type. -#define ERR_INVALID_TYPE_OF_FLATTEN -1074395703 // Invalid type of flatten. -#define ERR_INVALID_LENGTH -1074395702 // The length of the edge detection line must be greater than zero. -#define ERR_INVALID_MATRIX_SIZE_RANGE -1074395701 // The maximum Data Matrix barcode size must be equal to or greater than the minimum Data Matrix barcode size. -#define ERR_REQUIRES_WIN2000_OR_NEWER -1074395700 // The function requires the operating system to be Microsoft Windows 2000 or newer. -#define ERR_INVALID_CALIBRATION_METHOD -1074395662 // Invalid calibration method requested -#define ERR_INVALID_OPERATION_ON_COMPACT_CALIBRATION_ATTEMPTED -1074395661 // This calibration is compact. Re-Learning calibration and retrieving thumbnails are not possible with this calibration -#define ERR_INVALID_POLYNOMIAL_MODEL_K_COUNT -1074395660 // Invalid number of K values -#define ERR_INVALID_DISTORTION_MODEL -1074395659 // Invalid distortion model type -#define ERR_CAMERA_MODEL_NOT_AVAILABLE -1074395658 // Camera Model is not learned -#define ERR_INVALID_THUMBNAIL_INDEX -1074395657 // Supplied thumbnail index is invalid -#define ERR_SMOOTH_CONTOURS_MUST_BE_SAME -1074395656 // You must specify the same value for the smooth contours advanced match option for all templates you want to match. -#define ERR_ENABLE_CALIBRATION_SUPPORT_MUST_BE_SAME -1074395655 // You must specify the same value for the enable calibration support advanced match option for all templates you want to match. -#define ERR_GRADING_INFORMATION_NOT_FOUND -1074395654 // The source image does not contain grading information. You must prepare the source image for grading when reading the Data Matrix, and you cannot change the contents of the source image between reading and grading the Data Matrix. -#define ERR_OPENING_NEWER_MULTIPLE_GEOMETRIC_TEMPLATE -1074395653 // The multiple geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_OPENING_NEWER_GEOMETRIC_MATCHING_TEMPLATE -1074395652 // The geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_EDGE_FILTER_SIZE_MUST_BE_SAME -1074395651 // You must specify the same edge filter size for all the templates you want to match. -#define ERR_CURVE_EXTRACTION_MODE_MUST_BE_SAME -1074395650 // You must specify the same curve extraction mode for all the templates you want to match. -#define ERR_INVALID_GEOMETRIC_FEATURE_TYPE -1074395649 // The geometric feature type specified is invalid. -#define ERR_TEMPLATE_NOT_LEARNED -1074395648 // You supplied a template that was not learned. -#define ERR_INVALID_MULTIPLE_GEOMETRIC_TEMPLATE -1074395647 // Invalid multiple geometric template. -#define ERR_NO_TEMPLATE_TO_LEARN -1074395646 // Need at least one template to learn. -#define ERR_INVALID_NUMBER_OF_LABELS -1074395645 // You supplied an invalid number of labels. -#define ERR_LABEL_TOO_LONG -1074395644 // Labels must be <= 255 characters. -#define ERR_INVALID_NUMBER_OF_MATCH_OPTIONS -1074395643 // You supplied an invalid number of match options. -#define ERR_LABEL_NOT_FOUND -1074395642 // Cannot find a label that matches the one you specified. -#define ERR_DUPLICATE_LABEL -1074395641 // Duplicate labels are not allowed. -#define ERR_TOO_MANY_ZONES -1074395640 // The number of zones found exceeded the capacity of the algorithm. -#define ERR_INVALID_HATCH_STYLE -1074395639 // The hatch style for the window background is invalid. -#define ERR_INVALID_FILL_STYLE -1074395638 // The fill style for the window background is invalid. -#define ERR_HARDWARE_DOESNT_SUPPORT_NONTEARING -1074395637 // Your hardware is not supported by DirectX and cannot be put into NonTearing mode. -#define ERR_DIRECTX_NOT_FOUND -1074395636 // DirectX is required for this feature. Please install the latest version.. -#define ERR_INVALID_SHAPE_DESCRIPTOR -1074395635 // The passed shape descriptor is invalid. -#define ERR_INVALID_MAX_MATCH_OVERLAP -1074395634 // Invalid max match overlap. Values must be between -1 and 100. -#define ERR_INVALID_MIN_MATCH_SEPARATION_SCALE -1074395633 // Invalid minimum match separation scale. Values must be greater than or equal to -1. -#define ERR_INVALID_MIN_MATCH_SEPARATION_ANGLE -1074395632 // Invalid minimum match separation angle. Values must be between -1 and 360. -#define ERR_INVALID_MIN_MATCH_SEPARATION_DISTANCE -1074395631 // Invalid minimum match separation distance. Values must be greater than or equal to -1. -#define ERR_INVALID_MAXIMUM_FEATURES_LEARNED -1074395630 // Invalid maximum number of features learn. Values must be integers greater than zero. -#define ERR_INVALID_MAXIMUM_PIXEL_DISTANCE_FROM_LINE -1074395629 // Invalid maximum pixel distance from line. Values must be positive real numbers. -#define ERR_INVALID_GEOMETRIC_MATCHING_TEMPLATE -1074395628 // Invalid geometric matching template image. -#define ERR_NOT_ENOUGH_TEMPLATE_FEATURES_1 -1074395627 // The template does not contain enough features for geometric matching. -#define ERR_NOT_ENOUGH_TEMPLATE_FEATURES -1074395626 // The template does not contain enough features for geometric matching. -#define ERR_INVALID_MATCH_CONSTRAINT_TYPE -1074395625 // You specified an invalid value for the match constraint value of the range settings. -#define ERR_INVALID_OCCLUSION_RANGE -1074395624 // Invalid occlusion range. Valid values for the bounds range from 0 to 100 and the upper bound must be greater than or equal to the lower bound. -#define ERR_INVALID_SCALE_RANGE -1074395623 // Invalid scale range. Values for the lower bound must be a positive real numbers and the upper bound must be greater than or equal to the lower bound. -#define ERR_INVALID_MATCH_GEOMETRIC_PATTERN_SETUP_DATA -1074395622 // Invalid match geometric pattern setup data. -#define ERR_INVALID_LEARN_GEOMETRIC_PATTERN_SETUP_DATA -1074395621 // Invalid learn geometric pattern setup data. -#define ERR_INVALID_CURVE_EXTRACTION_MODE -1074395620 // Invalid curve extraction mode. -#define ERR_TOO_MANY_OCCLUSION_RANGES -1074395619 // You can specify only one occlusion range. -#define ERR_TOO_MANY_SCALE_RANGES -1074395618 // You can specify only one scale range. -#define ERR_INVALID_NUMBER_OF_FEATURES_RANGE -1074395617 // The minimum number of features must be less than or equal to the maximum number of features. -#define ERR_INVALID_EDGE_FILTER_SIZE -1074395616 // Invalid edge filter size. -#define ERR_INVALID_MINIMUM_FEATURE_STRENGTH -1074395615 // Invalid minimum strength for features. Values must be positive real numbers. -#define ERR_INVALID_MINIMUM_FEATURE_ASPECT_RATIO -1074395614 // Invalid aspect ratio for rectangular features. Values must be positive real numbers in the range 0.01 to 1.0. -#define ERR_INVALID_MINIMUM_FEATURE_LENGTH -1074395613 // Invalid minimum length for linear features. Values must be integers greater than 0. -#define ERR_INVALID_MINIMUM_FEATURE_RADIUS -1074395612 // Invalid minimum radius for circular features. Values must be integers greater than 0. -#define ERR_INVALID_MINIMUM_RECTANGLE_DIMENSION -1074395611 // Invalid minimum rectangle dimension. Values must be integers greater than 0. -#define ERR_INVALID_INITIAL_MATCH_LIST_LENGTH -1074395610 // Invalid initial match list length. Values must be integers greater than 5. -#define ERR_INVALID_SUBPIXEL_TOLERANCE -1074395609 // Invalid subpixel tolerance. Values must be positive real numbers. -#define ERR_INVALID_SUBPIXEL_ITERATIONS -1074395608 // Invalid number of subpixel iterations. Values must be integers greater 10. -#define ERR_INVALID_MAXIMUM_FEATURES_PER_MATCH -1074395607 // Invalid maximum number of features used per match. Values must be integers greater than or equal to zero. -#define ERR_INVALID_MINIMUM_FEATURES_TO_MATCH -1074395606 // Invalid minimum number of features used for matching. Values must be integers greater than zero. -#define ERR_INVALID_MAXIMUM_END_POINT_GAP -1074395605 // Invalid maximum end point gap. Valid values range from 0 to 32767. -#define ERR_INVALID_COLUMN_STEP -1074395604 // Invalid column step. Valid range is 1 to 255. -#define ERR_INVALID_ROW_STEP -1074395603 // Invalid row step. Valid range is 1 to 255. -#define ERR_INVALID_MINIMUM_CURVE_LENGTH -1074395602 // Invalid minimum length. Valid values must be greater than or equal to zero. -#define ERR_INVALID_EDGE_THRESHOLD -1074395601 // Invalid edge threshold. Valid values range from 1 to 360. -#define ERR_INFO_NOT_FOUND -1074395600 // You must provide information about the subimage within the browser. -#define ERR_NIOCR_INVALID_ACCEPTANCE_LEVEL -1074395598 // The acceptance level is outside the valid range of 0 to 1000. -#define ERR_NIOCR_NOT_A_VALID_SESSION -1074395597 // Not a valid OCR session. -#define ERR_NIOCR_INVALID_CHARACTER_SIZE -1074395596 // Invalid character size. Character size must be >= 1. -#define ERR_NIOCR_INVALID_THRESHOLD_MODE -1074395595 // Invalid threshold mode value. -#define ERR_NIOCR_INVALID_SUBSTITUTION_CHARACTER -1074395594 // Invalid substitution character. Valid substitution characters are ASCII values that range from 1 to 254. -#define ERR_NIOCR_INVALID_NUMBER_OF_BLOCKS -1074395593 // Invalid number of blocks. Number of blocks must be >= 4 and <= 50. -#define ERR_NIOCR_INVALID_READ_STRATEGY -1074395592 // Invalid read strategy. -#define ERR_NIOCR_INVALID_CHARACTER_INDEX -1074395591 // Invalid character index. -#define ERR_NIOCR_INVALID_NUMBER_OF_VALID_CHARACTER_POSITIONS -1074395590 // Invalid number of character positions. Valid values range from 0 to 255. -#define ERR_NIOCR_INVALID_LOW_THRESHOLD_VALUE -1074395589 // Invalid low threshold value. Valid threshold values range from 0 to 255. -#define ERR_NIOCR_INVALID_HIGH_THRESHOLD_VALUE -1074395588 // Invalid high threshold value. Valid threshold values range from 0 to 255. -#define ERR_NIOCR_INVALID_THRESHOLD_RANGE -1074395587 // The low threshold must be less than the high threshold. -#define ERR_NIOCR_INVALID_LOWER_THRESHOLD_LIMIT -1074395586 // Invalid lower threshold limit. Valid lower threshold limits range from 0 to 255. -#define ERR_NIOCR_INVALID_UPPER_THRESHOLD_LIMIT -1074395585 // Invalid upper threshold limit. Valid upper threshold limits range from 0 to 255. -#define ERR_NIOCR_INVALID_THRESHOLD_LIMITS -1074395584 // The lower threshold limit must be less than the upper threshold limit. -#define ERR_NIOCR_INVALID_MIN_CHAR_SPACING -1074395583 // Invalid minimum character spacing value. Character spacing must be >= 1 pixel. -#define ERR_NIOCR_INVALID_MAX_HORIZ_ELEMENT_SPACING -1074395582 // Invalid maximum horizontal element spacing value. Maximum horizontal element spacing must be >= 0. -#define ERR_NIOCR_INVALID_MAX_VERT_ELEMENT_SPACING -1074395581 // Invalid maximum vertical element spacing value. Maximum vertical element spacing must be >= 0. -#define ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_WIDTH -1074395580 // Invalid minimum bounding rectangle width. Minimum bounding rectangle width must be >= 1. -#define ERR_NIOCR_INVALID_ASPECT_RATIO -1074395579 // Invalid aspect ratio value. The aspect ratio must be zero or >= 100. -#define ERR_NIOCR_INVALID_CHARACTER_SET_FILE -1074395578 // Invalid or corrupt character set file. -#define ERR_NIOCR_CHARACTER_VALUE_CANNOT_BE_EMPTYSTRING -1074395577 // The character value must not be an empty string. -#define ERR_NIOCR_CHARACTER_VALUE_TOO_LONG -1074395576 // Character values must be <=255 characters. -#define ERR_NIOCR_INVALID_NUMBER_OF_EROSIONS -1074395575 // Invalid number of erosions. The number of erosions must be >= 0. -#define ERR_NIOCR_CHARACTER_SET_DESCRIPTION_TOO_LONG -1074395574 // The character set description must be <=255 characters. -#define ERR_NIOCR_INVALID_CHARACTER_SET_FILE_VERSION -1074395573 // The character set file was created by a newer version of NI Vision. Upgrade to the latest version of NI Vision to read the character set file. -#define ERR_NIOCR_INTEGER_VALUE_FOR_STRING_ATTRIBUTE -1074395572 // You must specify characters for a string. A string cannot contain integers. -#define ERR_NIOCR_GET_ONLY_ATTRIBUTE -1074395571 // This attribute is read-only. -#define ERR_NIOCR_INTEGER_VALUE_FOR_BOOLEAN_ATTRIBUTE -1074395570 // This attribute requires a Boolean value. -#define ERR_NIOCR_INVALID_ATTRIBUTE -1074395569 // Invalid attribute. -#define ERR_NIOCR_STRING_VALUE_FOR_INTEGER_ATTRIBUTE -1074395568 // This attribute requires integer values. -#define ERR_NIOCR_STRING_VALUE_FOR_BOOLEAN_ATTRIBUTE -1074395567 // String values are invalid for this attribute. Enter a boolean value. -#define ERR_NIOCR_BOOLEAN_VALUE_FOR_INTEGER_ATTRIBUTE -1074395566 // Boolean values are not valid for this attribute. Enter an integer value. -#define ERR_NIOCR_MUST_BE_SINGLE_CHARACTER -1074395565 // Requires a single-character string. -#define ERR_NIOCR_INVALID_PREDEFINED_CHARACTER -1074395564 // Invalid predefined character value. -#define ERR_NIOCR_UNLICENSED -1074395563 // This copy of NI OCR is unlicensed. -#define ERR_NIOCR_BOOLEAN_VALUE_FOR_STRING_ATTRIBUTE -1074395562 // String values are not valid for this attribute. Enter a Boolean value. -#define ERR_NIOCR_INVALID_NUMBER_OF_CHARACTERS -1074395561 // The number of characters in the character value must match the number of objects in the image. -#define ERR_NIOCR_INVALID_OBJECT_INDEX -1074395560 // Invalid object index. -#define ERR_NIOCR_INVALID_READ_OPTION -1074395559 // Invalid read option. -#define ERR_NIOCR_INVALID_CHARACTER_SIZE_RANGE -1074395558 // The minimum character size must be less than the maximum character size. -#define ERR_NIOCR_INVALID_BOUNDING_RECT_WIDTH_RANGE -1074395557 // The minimum character bounding rectangle width must be less than the maximum character bounding rectangle width. -#define ERR_NIOCR_INVALID_BOUNDING_RECT_HEIGHT_RANGE -1074395556 // The minimum character bounding rectangle height must be less than the maximum character bounding rectangle height. -#define ERR_NIOCR_INVALID_SPACING_RANGE -1074395555 // The maximum horizontal element spacing value must not exceed the minimum character spacing value. -#define ERR_NIOCR_INVALID_READ_RESOLUTION -1074395554 // Invalid read resolution. -#define ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_HEIGHT -1074395553 // Invalid minimum bounding rectangle height. The minimum bounding rectangle height must be >= 1. -#define ERR_NIOCR_NOT_A_VALID_CHARACTER_SET -1074395552 // Not a valid character set. -#define ERR_NIOCR_RENAME_REFCHAR -1074395551 // A trained OCR character cannot be renamed while it is a reference character. -#define ERR_NIOCR_INVALID_CHARACTER_VALUE -1074395550 // A character cannot have an ASCII value of 255. -#define ERR_NIOCR_INVALID_NUMBER_OF_OBJECTS_TO_VERIFY -1074395549 // The number of objects found does not match the number of expected characters or patterns to verify. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_CAP -1074395421 // The specified value for the filter cap for block matching is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_SIZE -1074395420 // The specified prefilter size for block matching is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_TYPE -1074395419 // The specified prefilter type for block matching is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_NUMDISPARITIES -1074395418 // The specifed value for number of disparities is invalid. -#define ERR_INVALID_STEREO_BLOCKMATCHING_WINDOW_SIZE -1074395417 // The specified window size for block matching is invalid. -#define ERR_3DVISION_INVALID_SESSION_TYPE -1074395416 // This 3D vision function cannot be called on this type of 3d vision session. -#define ERR_TOO_MANY_3DVISION_SESSIONS -1074395415 // There are too many 3D vision sessions open. You must close a session before you can open another one. -#define ERR_OPENING_NEWER_3DVISION_SESSION -1074395414 // The 3D vision session you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_INVALID_STEREO_BLOCKMATCHING_FILTERTYPE -1074395413 // You have specified an invalid filter type for block matching. -#define ERR_INVALID_STEREO_CAMERA_POSITION -1074395412 // You have requested results at an invalid camera position in the stereo setup. -#define ERR_INVALID_3DVISION_SESSION -1074395411 // Not a valid 3D Vision session. -#define ERR_INVALID_ICONS_PER_LINE -1074395410 // NI Vision does not support less than one icon per line. -#define ERR_INVALID_SUBPIXEL_DIVISIONS -1074395409 // Invalid subpixel divisions. -#define ERR_INVALID_DETECTION_MODE -1074395408 // Invalid detection mode. -#define ERR_INVALID_CONTRAST -1074395407 // Invalid contrast value. Valid contrast values range from 0 to 255. -#define ERR_COORDSYS_NOT_FOUND -1074395406 // The coordinate system could not be found on this image. -#define ERR_INVALID_TEXTORIENTATION -1074395405 // NI Vision does not support the text orientation value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_FOR_UNWRAP -1074395404 // UnwrapImage does not support the interpolation method value you supplied. Valid interpolation methods are zero order and bilinear. -#define ERR_EXTRAINFO_VERSION -1074395403 // The image was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this image. -#define ERR_INVALID_MAXPOINTS -1074395402 // The function does not support the maximum number of points that you specified. -#define ERR_INVALID_MATCHFACTOR -1074395401 // The function does not support the matchFactor that you specified. -#define ERR_MULTICORE_OPERATION -1074395400 // The operation you have given Multicore Options is invalid. Please see the available enumeration values for Multicore Operation. -#define ERR_MULTICORE_INVALID_ARGUMENT -1074395399 // You have given Multicore Options an invalid argument. -#define ERR_COMPLEX_IMAGE_REQUIRED -1074395397 // A complex image is required. -#define ERR_COLOR_IMAGE_REQUIRED -1074395395 // The input image must be a color image. -#define ERR_COLOR_SPECTRUM_MASK -1074395394 // The color mask removes too much color information. -#define ERR_COLOR_TEMPLATE_IMAGE_TOO_SMALL -1074395393 // The color template image is too small. -#define ERR_COLOR_TEMPLATE_IMAGE_TOO_LARGE -1074395392 // The color template image is too large. -#define ERR_COLOR_TEMPLATE_IMAGE_HUE_CONTRAST_TOO_LOW -1074395391 // The contrast in the hue plane of the image is too low for learning shape features. -#define ERR_COLOR_TEMPLATE_IMAGE_LUMINANCE_CONTRAST_TOO_LOW -1074395390 // The contrast in the luminance plane of the image is too low to learn shape features. -#define ERR_COLOR_LEARN_SETUP_DATA -1074395389 // Invalid color learn setup data. -#define ERR_COLOR_LEARN_SETUP_DATA_SHAPE -1074395388 // Invalid color learn setup data. -#define ERR_COLOR_MATCH_SETUP_DATA -1074395387 // Invalid color match setup data. -#define ERR_COLOR_MATCH_SETUP_DATA_SHAPE -1074395386 // Invalid color match setup data. -#define ERR_COLOR_ROTATION_REQUIRES_SHAPE_FEATURE -1074395385 // Rotation-invariant color pattern matching requires a feature mode including shape. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR -1074395384 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_1 -1074395383 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_2 -1074395382 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_3 -1074395381 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_4 -1074395380 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_5 -1074395379 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_6 -1074395378 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT -1074395377 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHIFT -1074395376 // The color template image does not contain data required for shift-invariant color matching. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_1 -1074395375 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_2 -1074395374 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION -1074395373 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOROTATION -1074395372 // The color template image does not contain data required for rotation-invariant color matching. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_1 -1074395371 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_2 -1074395370 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_3 -1074395369 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_4 -1074395368 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_5 -1074395367 // Invalid color template image. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHAPE -1074395366 // The color template image does not contain data required for color matching in shape feature mode. -#define ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSPECTRUM -1074395365 // The color template image does not contain data required for color matching in color feature mode. -#define ERR_IGNORE_COLOR_SPECTRUM_SET -1074395364 // The ignore color spectra array is invalid. -#define ERR_INVALID_SUBSAMPLING_RATIO -1074395363 // Invalid subsampling ratio. -#define ERR_INVALID_WIDTH -1074395362 // Invalid pixel width. -#define ERR_INVALID_STEEPNESS -1074395361 // Invalid steepness. -#define ERR_COMPLEX_PLANE -1074395360 // Invalid complex plane. -#define ERR_INVALID_COLOR_IGNORE_MODE -1074395357 // Invalid color ignore mode. -#define ERR_INVALID_MIN_MATCH_SCORE -1074395356 // Invalid minimum match score. Acceptable values range from 0 to 1000. -#define ERR_INVALID_NUM_MATCHES_REQUESTED -1074395355 // Invalid number of matches requested. You must request a minimum of one match. -#define ERR_INVALID_COLOR_WEIGHT -1074395354 // Invalid color weight. Acceptable values range from 0 to 1000. -#define ERR_INVALID_SEARCH_STRATEGY -1074395353 // Invalid search strategy. -#define ERR_INVALID_FEATURE_MODE -1074395352 // Invalid feature mode. -#define ERR_INVALID_RECT -1074395351 // NI Vision does not support rectangles with negative widths or negative heights. -#define ERR_INVALID_VISION_INFO -1074395350 // NI Vision does not support the vision information type you supplied. -#define ERR_INVALID_SKELETONMETHOD -1074395349 // NI Vision does not support the SkeletonMethod value you supplied. -#define ERR_INVALID_3DPLANE -1074395348 // NI Vision does not support the 3DPlane value you supplied. -#define ERR_INVALID_3DDIRECTION -1074395347 // NI Vision does not support the 3DDirection value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_FOR_ROTATE -1074395346 // imaqRotate does not support the InterpolationMethod value you supplied. -#define ERR_INVALID_FLIPAXIS -1074395345 // NI Vision does not support the axis of symmetry you supplied. -#define ERR_FILE_FILENAME_NULL -1074395343 // You must pass a valid file name. Do not pass in NULL. -#define ERR_INVALID_SIZETYPE -1074395340 // NI Vision does not support the SizeType value you supplied. -#define ERR_UNKNOWN_ALGORITHM -1074395336 // You specified the dispatch status of an unknown algorithm. -#define ERR_DISPATCH_STATUS_CONFLICT -1074395335 // You are attempting to set the same algorithm to dispatch and to not dispatch. Remove one of the conflicting settings. -#define ERR_INVALID_CONVERSIONSTYLE -1074395334 // NI Vision does not support the Conversion Method value you supplied. -#define ERR_INVALID_VERTICAL_TEXT_ALIGNMENT -1074395333 // NI Vision does not support the VerticalTextAlignment value you supplied. -#define ERR_INVALID_COMPAREFUNCTION -1074395332 // NI Vision does not support the CompareFunction value you supplied. -#define ERR_INVALID_BORDERMETHOD -1074395331 // NI Vision does not support the BorderMethod value you supplied. -#define ERR_INVALID_BORDER_SIZE -1074395330 // Invalid border size. Acceptable values range from 0 to 50. -#define ERR_INVALID_OUTLINEMETHOD -1074395329 // NI Vision does not support the OutlineMethod value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD -1074395328 // NI Vision does not support the InterpolationMethod value you supplied. -#define ERR_INVALID_SCALINGMODE -1074395327 // NI Vision does not support the ScalingMode value you supplied. -#define ERR_INVALID_DRAWMODE_FOR_LINE -1074395326 // imaqDrawLineOnImage does not support the DrawMode value you supplied. -#define ERR_INVALID_DRAWMODE -1074395325 // NI Vision does not support the DrawMode value you supplied. -#define ERR_INVALID_SHAPEMODE -1074395324 // NI Vision does not support the ShapeMode value you supplied. -#define ERR_INVALID_FONTCOLOR -1074395323 // NI Vision does not support the FontColor value you supplied. -#define ERR_INVALID_TEXTALIGNMENT -1074395322 // NI Vision does not support the TextAlignment value you supplied. -#define ERR_INVALID_MORPHOLOGYMETHOD -1074395321 // NI Vision does not support the MorphologyMethod value you supplied. -#define ERR_TEMPLATE_EMPTY -1074395320 // The template image is empty. -#define ERR_INVALID_SUBPIX_TYPE -1074395319 // NI Vision does not support the interpolation type you supplied. -#define ERR_INSF_POINTS -1074395318 // You supplied an insufficient number of points to perform this operation. -#define ERR_UNDEF_POINT -1074395317 // You specified a point that lies outside the image. -#define ERR_INVALID_KERNEL_CODE -1074395316 // Invalid kernel code. -#define ERR_INEFFICIENT_POINTS -1074395315 // You supplied an inefficient set of points to match the minimum score. -#define ERR_WRITE_FILE_NOT_SUPPORTED -1074395313 // Writing files is not supported on this device. -#define ERR_LCD_CALIBRATE -1074395312 // The input image does not seem to be a valid LCD or LED calibration image. -#define ERR_INVALID_COLOR_SPECTRUM -1074395311 // The color spectrum array you provided has an invalid number of elements or contains an element set to not-a-number (NaN). -#define ERR_INVALID_PALETTE_TYPE -1074395310 // NI Vision does not support the PaletteType value you supplied. -#define ERR_INVALID_WINDOW_THREAD_POLICY -1074395309 // NI Vision does not support the WindowThreadPolicy value you supplied. -#define ERR_INVALID_COLORSENSITIVITY -1074395308 // NI Vision does not support the ColorSensitivity value you supplied. -#define ERR_PRECISION_NOT_GTR_THAN_0 -1074395307 // The precision parameter must be greater than 0. -#define ERR_INVALID_TOOL -1074395306 // NI Vision does not support the Tool value you supplied. -#define ERR_INVALID_REFERENCEMODE -1074395305 // NI Vision does not support the ReferenceMode value you supplied. -#define ERR_INVALID_MATHTRANSFORMMETHOD -1074395304 // NI Vision does not support the MathTransformMethod value you supplied. -#define ERR_INVALID_NUM_OF_CLASSES -1074395303 // Invalid number of classes for auto threshold. Acceptable values range from 2 to 256. -#define ERR_INVALID_THRESHOLDMETHOD -1074395302 // NI Vision does not support the threshold method value you supplied. -#define ERR_ROI_NOT_2_LINES -1074395301 // The ROI you passed into imaqGetMeterArc must consist of two lines. -#define ERR_INVALID_METERARCMODE -1074395300 // NI Vision does not support the MeterArcMode value you supplied. -#define ERR_INVALID_COMPLEXPLANE -1074395299 // NI Vision does not support the ComplexPlane value you supplied. -#define ERR_COMPLEXPLANE_NOT_REAL_OR_IMAGINARY -1074395298 // You can perform this operation on a real or an imaginary ComplexPlane only. -#define ERR_INVALID_PARTICLEINFOMODE -1074395297 // NI Vision does not support the ParticleInfoMode value you supplied. -#define ERR_INVALID_BARCODETYPE -1074395296 // NI Vision does not support the BarcodeType value you supplied. -#define ERR_INVALID_INTERPOLATIONMETHOD_INTERPOLATEPOINTS -1074395295 // imaqInterpolatePoints does not support the InterpolationMethod value you supplied. -#define ERR_CONTOUR_INDEX_OUT_OF_RANGE -1074395294 // The contour index you supplied is larger than the number of contours in the ROI. -#define ERR_CONTOURID_NOT_FOUND -1074395293 // The supplied ContourID did not correlate to a contour inside the ROI. -#define ERR_POINTS_ARE_COLLINEAR -1074395292 // Do not supply collinear points for this operation. -#define ERR_SHAPEMATCH_BADIMAGEDATA -1074395291 // Shape Match requires the image to contain only pixel values of 0 or 1. -#define ERR_SHAPEMATCH_BADTEMPLATE -1074395290 // The template you supplied for ShapeMatch contains no shape information. -#define ERR_CONTAINER_CAPACITY_EXCEEDED_UINT_MAX -1074395289 // The operation would have exceeded the capacity of an internal container, which is limited to 4294967296 unique elements. -#define ERR_CONTAINER_CAPACITY_EXCEEDED_INT_MAX -1074395288 // The operation would have exceeded the capacity of an internal container, which is limited to 2147483648 unique elements. -#define ERR_INVALID_LINE -1074395287 // The line you provided contains two identical points, or one of the coordinate locations for the line is not a number (NaN). -#define ERR_INVALID_CONCENTRIC_RAKE_DIRECTION -1074395286 // Invalid concentric rake direction. -#define ERR_INVALID_SPOKE_DIRECTION -1074395285 // Invalid spoke direction. -#define ERR_INVALID_EDGE_PROCESS -1074395284 // Invalid edge process. -#define ERR_INVALID_RAKE_DIRECTION -1074395283 // Invalid rake direction. -#define ERR_CANT_DRAW_INTO_VIEWER -1074395282 // Unable to draw to viewer. You must have the latest version of the control. -#define ERR_IMAGE_SMALLER_THAN_BORDER -1074395281 // Your image must be larger than its border size for this operation. -#define ERR_ROI_NOT_RECT -1074395280 // The ROI must only have a single Rectangle contour. -#define ERR_ROI_NOT_POLYGON -1074395279 // ROI is not a polygon. -#define ERR_LCD_NOT_NUMERIC -1074395278 // LCD image is not a number. -#define ERR_BARCODE_CHECKSUM -1074395277 // The decoded barcode information did not pass the checksum test. -#define ERR_LINES_PARALLEL -1074395276 // You specified parallel lines for the meter ROI. -#define ERR_INVALID_BROWSER_IMAGE -1074395275 // Invalid browser image. -#define ERR_DIV_BY_ZERO -1074395270 // Cannot divide by zero. -#define ERR_NULL_POINTER -1074395269 // Null pointer. -#define ERR_LINEAR_COEFF -1074395268 // The linear equations are not independent. -#define ERR_COMPLEX_ROOT -1074395267 // The roots of the equation are complex. -#define ERR_BARCODE -1074395265 // The barcode does not match the type you specified. -#define ERR_LCD_NO_SEGMENTS -1074395263 // No lit segment. -#define ERR_LCD_BAD_MATCH -1074395262 // The LCD does not form a known digit. -#define ERR_GIP_RANGE -1074395261 // An internal error occurred while attempting to access an invalid coordinate on an image. -#define ERR_HEAP_TRASHED -1074395260 // An internal memory error occurred. -#define ERR_BAD_FILTER_WIDTH -1074395258 // The filter width must be odd for the Canny operator. -#define ERR_INVALID_EDGE_DIR -1074395257 // You supplied an invalid edge direction in the Canny operator. -#define ERR_EVEN_WINDOW_SIZE -1074395256 // The window size must be odd for the Canny operator. -#define ERR_INVALID_LEARN_MODE -1074395253 // Invalid learn mode. -#define ERR_LEARN_SETUP_DATA -1074395252 // Invalid learn setup data. -#define ERR_INVALID_MATCH_MODE -1074395251 // Invalid match mode. -#define ERR_MATCH_SETUP_DATA -1074395250 // Invalid match setup data. -#define ERR_ROTATION_ANGLE_RANGE_TOO_LARGE -1074395249 // At least one range in the array of rotation angle ranges exceeds 360 degrees. -#define ERR_TOO_MANY_ROTATION_ANGLE_RANGES -1074395248 // The array of rotation angle ranges contains too many ranges. -#define ERR_TEMPLATE_DESCRIPTOR -1074395247 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_1 -1074395246 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_2 -1074395245 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_3 -1074395244 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_4 -1074395243 // The template descriptor was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this template. -#define ERR_TEMPLATE_DESCRIPTOR_ROTATION -1074395242 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOROTATION -1074395241 // The template descriptor does not contain data required for rotation-invariant matching. -#define ERR_TEMPLATE_DESCRIPTOR_ROTATION_1 -1074395240 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_SHIFT -1074395239 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOSHIFT -1074395238 // The template descriptor does not contain data required for shift-invariant matching. -#define ERR_TEMPLATE_DESCRIPTOR_SHIFT_1 -1074395237 // Invalid template descriptor. -#define ERR_TEMPLATE_DESCRIPTOR_NOSCALE -1074395236 // The template descriptor does not contain data required for scale-invariant matching. -#define ERR_TEMPLATE_IMAGE_CONTRAST_TOO_LOW -1074395235 // The template image does not contain enough contrast. -#define ERR_TEMPLATE_IMAGE_TOO_SMALL -1074395234 // The template image is too small. -#define ERR_TEMPLATE_IMAGE_TOO_LARGE -1074395233 // The template image is too large. -#define ERR_TOO_MANY_OCR_SESSIONS -1074395214 // There are too many OCR sessions open. You must close a session before you can open another one. -#define ERR_OCR_TEMPLATE_WRONG_SIZE -1074395212 // The size of the template string must match the size of the string you are trying to correct. -#define ERR_OCR_BAD_TEXT_TEMPLATE -1074395211 // The supplied text template contains nonstandard characters that cannot be generated by OCR. -#define ERR_OCR_CANNOT_MATCH_TEXT_TEMPLATE -1074395210 // At least one character in the text template was of a lexical class that did not match the supplied character reports. -#define ERR_OCR_LIB_INIT -1074395203 // The OCR library cannot be initialized correctly. -#define ERR_OCR_LOAD_LIBRARY -1074395201 // There was a failure when loading one of the internal OCR engine or LabView libraries. -#define ERR_OCR_INVALID_PARAMETER -1074395200 // One of the parameters supplied to the OCR function that generated this error is invalid. -#define ERR_MARKER_INFORMATION_NOT_SUPPLIED -1074395199 // Marker image and points are not supplied -#define ERR_INCOMPATIBLE_MARKER_IMAGE_SIZE -1074395198 // Source Image and Marker Image should be of same size. -#define ERR_BOTH_MARKER_INPUTS_SUPPLIED -1074395197 // Both Marker Image and Points are supplied. -#define ERR_INVALID_MORPHOLOGICAL_OPERATION -1074395196 // Invalid Morphological Operation. -#define ERR_IMAGE_CONTAINS_NAN_VALUES -1074395195 // Float image contains NaN values -#define ERR_OVERLAY_EXTRAINFO_OPENING_NEW_VERSION -1074395194 // The overlay information you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file. -#define ERR_NO_CLAMP_FOUND -1074395193 // No valid clamp was found with the current configuration -#define ERR_NO_CLAMP_WITHIN_ANGLE_RANGE -1074395192 // Supplied angle range for clamp is insufficient -#define ERR_GHT_INVALID_USE_ALL_CURVES_VALUE -1074395188 // The use all curves advanced option specified during learn is not supported -#define ERR_INVALID_GAUSS_SIGMA_VALUE -1074395187 // The sigma value specified for the Gaussian filter is too small. -#define ERR_INVALID_GAUSS_FILTER_TYPE -1074395186 // The specified Gaussian filter type is not supported. -#define ERR_INVALID_CONTRAST_REVERSAL_MODE -1074395185 // The contrast reversal mode specified during matching is invalid. -#define ERR_INVALID_ROTATION_RANGE -1074395184 // Invalid roation angle range. The upper bound must be greater than or equal to the lower bound. -#define ERR_GHT_INVALID_MINIMUM_LEARN_ANGLE_VALUE -1074395183 // The minimum rotation angle value specifed during learning of the template is not supported. -#define ERR_GHT_INVALID_MAXIMUM_LEARN_ANGLE_VALUE -1074395182 // The maximum rotation angle value specifed during learning of the template is not supported. -#define ERR_GHT_INVALID_MAXIMUM_LEARN_SCALE_FACTOR -1074395181 // The maximum scale factor specifed during learning of the template is not supported. -#define ERR_GHT_INVALID_MINIMUM_LEARN_SCALE_FACTOR -1074395180 // The minimum scale factor specifed during learning of the template is not supported. -#define ERR_OCR_PREPROCESSING_FAILED -1074395179 // The OCR engine failed during the preprocessing stage. -#define ERR_OCR_RECOGNITION_FAILED -1074395178 // The OCR engine failed during the recognition stage. -#define ERR_OCR_BAD_USER_DICTIONARY -1074395175 // The provided filename is not valid user dictionary filename. -#define ERR_OCR_INVALID_AUTOORIENTMODE -1074395174 // NI Vision does not support the AutoOrientMode value you supplied. -#define ERR_OCR_INVALID_LANGUAGE -1074395173 // NI Vision does not support the Language value you supplied. -#define ERR_OCR_INVALID_CHARACTERSET -1074395172 // NI Vision does not support the CharacterSet value you supplied. -#define ERR_OCR_INI_FILE_NOT_FOUND -1074395171 // The system could not locate the initialization file required for OCR initialization. -#define ERR_OCR_INVALID_CHARACTERTYPE -1074395170 // NI Vision does not support the CharacterType value you supplied. -#define ERR_OCR_INVALID_RECOGNITIONMODE -1074395169 // NI Vision does not support the RecognitionMode value you supplied. -#define ERR_OCR_INVALID_AUTOCORRECTIONMODE -1074395168 // NI Vision does not support the AutoCorrectionMode value you supplied. -#define ERR_OCR_INVALID_OUTPUTDELIMITER -1074395167 // NI Vision does not support the OutputDelimiter value you supplied. -#define ERR_OCR_BIN_DIR_NOT_FOUND -1074395166 // The system could not locate the OCR binary directory required for OCR initialization. -#define ERR_OCR_WTS_DIR_NOT_FOUND -1074395165 // The system could not locate the OCR weights directory required for OCR initialization. -#define ERR_OCR_ADD_WORD_FAILED -1074395164 // The supplied word could not be added to the user dictionary. -#define ERR_OCR_INVALID_CHARACTERPREFERENCE -1074395163 // NI Vision does not support the CharacterPreference value you supplied. -#define ERR_OCR_INVALID_CORRECTIONMODE -1074395162 // NI Vision does not support the CorrectionMethod value you supplied. -#define ERR_OCR_INVALID_CORRECTIONLEVEL -1074395161 // NI Vision does not support the CorrectionLevel value you supplied. -#define ERR_OCR_INVALID_MAXPOINTSIZE -1074395160 // NI Vision does not support the maximum point size you supplied. Valid values range from 4 to 72. -#define ERR_OCR_INVALID_TOLERANCE -1074395159 // NI Vision does not support the tolerance value you supplied. Valid values are non-negative. -#define ERR_OCR_INVALID_CONTRASTMODE -1074395158 // NI Vision does not support the ContrastMode value you supplied. -#define ERR_OCR_SKEW_DETECT_FAILED -1074395156 // The OCR attempted to detected the text skew and failed. -#define ERR_OCR_ORIENT_DETECT_FAILED -1074395155 // The OCR attempted to detected the text orientation and failed. -#define ERR_FONT_FILE_FORMAT -1074395153 // Invalid font file format. -#define ERR_FONT_FILE_NOT_FOUND -1074395152 // Font file not found. -#define ERR_OCR_CORRECTION_FAILED -1074395151 // The OCR engine failed during the correction stage. -#define ERR_INVALID_ROUNDING_MODE -1074395150 // NI Vision does not support the RoundingMode value you supplied. -#define ERR_DUPLICATE_TRANSFORM_TYPE -1074395149 // Found a duplicate transform type in the properties array. Each properties array may only contain one behavior for each transform type. -#define ERR_OVERLAY_GROUP_NOT_FOUND -1074395148 // Overlay Group Not Found. -#define ERR_BARCODE_RSSLIMITED -1074395147 // The barcode is not a valid RSS Limited symbol -#define ERR_QR_DETECTION_VERSION -1074395146 // Couldn't determine the correct version of the QR code. -#define ERR_QR_INVALID_READ -1074395145 // Invalid read of the QR code. -#define ERR_QR_INVALID_BARCODE -1074395144 // The barcode that was read contains invalid parameters. -#define ERR_QR_DETECTION_MODE -1074395143 // The data stream that was demodulated could not be read because the mode was not detected. -#define ERR_QR_DETECTION_MODELTYPE -1074395142 // Couldn't determine the correct model of the QR code. -#define ERR_OCR_NO_TEXT_FOUND -1074395141 // The OCR engine could not find any text in the supplied region. -#define ERR_OCR_CHAR_REPORT_CORRUPTED -1074395140 // One of the character reports is no longer usable by the system. -#define ERR_IMAQ_QR_DIMENSION_INVALID -1074395139 // Invalid Dimensions. -#define ERR_OCR_REGION_TOO_SMALL -1074395138 // The OCR region provided was too small to have contained any characters. -#define _FIRST_ERR ERR_SYSTEM_ERROR -#define _LAST_ERR ERR_OCR_REGION_TOO_SMALL - -//============================================================================ -// Enumerated Types -//============================================================================ -typedef enum PointSymbol_enum { - IMAQ_POINT_AS_PIXEL = 0, //A single pixel represents a point in the overlay. - IMAQ_POINT_AS_CROSS = 1, //A cross represents a point in the overlay. - IMAQ_POINT_USER_DEFINED = 2, //The pattern supplied by the user represents a point in the overlay. - IMAQ_POINT_SYMBOL_SIZE_GUARD = 0xFFFFFFFF -} PointSymbol; - -typedef enum MeasurementValue_enum { - IMAQ_AREA = 0, //Surface area of the particle in pixels. - IMAQ_AREA_CALIBRATED = 1, //Surface area of the particle in calibrated units. - IMAQ_NUM_HOLES = 2, //Number of holes in the particle. - IMAQ_AREA_OF_HOLES = 3, //Surface area of the holes in calibrated units. - IMAQ_TOTAL_AREA = 4, //Total surface area (holes and particle) in calibrated units. - IMAQ_IMAGE_AREA = 5, //Surface area of the entire image in calibrated units. - IMAQ_PARTICLE_TO_IMAGE = 6, //Ratio, expressed as a percentage, of the surface area of a particle in relation to the total area of the particle. - IMAQ_PARTICLE_TO_TOTAL = 7, //Ratio, expressed as a percentage, of the surface area of a particle in relation to the total area of the particle. - IMAQ_CENTER_MASS_X = 8, //X-coordinate of the center of mass. - IMAQ_CENTER_MASS_Y = 9, //Y-coordinate of the center of mass. - IMAQ_LEFT_COLUMN = 10, //Left edge of the bounding rectangle. - IMAQ_TOP_ROW = 11, //Top edge of the bounding rectangle. - IMAQ_RIGHT_COLUMN = 12, //Right edge of the bounding rectangle. - IMAQ_BOTTOM_ROW = 13, //Bottom edge of bounding rectangle. - IMAQ_WIDTH = 14, //Width of bounding rectangle in calibrated units. - IMAQ_HEIGHT = 15, //Height of bounding rectangle in calibrated units. - IMAQ_MAX_SEGMENT_LENGTH = 16, //Length of longest horizontal line segment. - IMAQ_MAX_SEGMENT_LEFT_COLUMN = 17, //Leftmost x-coordinate of longest horizontal line segment. - IMAQ_MAX_SEGMENT_TOP_ROW = 18, //Y-coordinate of longest horizontal line segment. - IMAQ_PERIMETER = 19, //Outer perimeter of the particle. - IMAQ_PERIMETER_OF_HOLES = 20, //Perimeter of all holes within the particle. - IMAQ_SIGMA_X = 21, //Sum of the particle pixels on the x-axis. - IMAQ_SIGMA_Y = 22, //Sum of the particle pixels on the y-axis. - IMAQ_SIGMA_XX = 23, //Sum of the particle pixels on the x-axis squared. - IMAQ_SIGMA_YY = 24, //Sum of the particle pixels on the y-axis squared. - IMAQ_SIGMA_XY = 25, //Sum of the particle pixels on the x-axis and y-axis. - IMAQ_PROJ_X = 26, //Projection corrected in X. - IMAQ_PROJ_Y = 27, //Projection corrected in Y. - IMAQ_INERTIA_XX = 28, //Inertia matrix coefficient in XX. - IMAQ_INERTIA_YY = 29, //Inertia matrix coefficient in YY. - IMAQ_INERTIA_XY = 30, //Inertia matrix coefficient in XY. - IMAQ_MEAN_H = 31, //Mean length of horizontal segments. - IMAQ_MEAN_V = 32, //Mean length of vertical segments. - IMAQ_MAX_INTERCEPT = 33, //Length of longest segment of the convex hull. - IMAQ_MEAN_INTERCEPT = 34, //Mean length of the chords in an object perpendicular to its max intercept. - IMAQ_ORIENTATION = 35, //The orientation based on the inertia of the pixels in the particle. - IMAQ_EQUIV_ELLIPSE_MINOR = 36, //Total length of the axis of the ellipse having the same area as the particle and a major axis equal to half the max intercept. - IMAQ_ELLIPSE_MAJOR = 37, //Total length of major axis having the same area and perimeter as the particle in calibrated units. - IMAQ_ELLIPSE_MINOR = 38, //Total length of minor axis having the same area and perimeter as the particle in calibrated units. - IMAQ_ELLIPSE_RATIO = 39, //Fraction of major axis to minor axis. - IMAQ_RECT_LONG_SIDE = 40, //Length of the long side of a rectangle having the same area and perimeter as the particle in calibrated units. - IMAQ_RECT_SHORT_SIDE = 41, //Length of the short side of a rectangle having the same area and perimeter as the particle in calibrated units. - IMAQ_RECT_RATIO = 42, //Ratio of rectangle long side to rectangle short side. - IMAQ_ELONGATION = 43, //Max intercept/mean perpendicular intercept. - IMAQ_COMPACTNESS = 44, //Particle area/(height x width). - IMAQ_HEYWOOD = 45, //Particle perimeter/perimeter of the circle having the same area as the particle. - IMAQ_TYPE_FACTOR = 46, //A complex factor relating the surface area to the moment of inertia. - IMAQ_HYDRAULIC = 47, //Particle area/particle perimeter. - IMAQ_WADDLE_DISK = 48, //Diameter of the disk having the same area as the particle in user units. - IMAQ_DIAGONAL = 49, //Diagonal of an equivalent rectangle in user units. - IMAQ_MEASUREMENT_VALUE_SIZE_GUARD = 0xFFFFFFFF -} MeasurementValue; - -typedef enum ScalingMode_enum { - IMAQ_SCALE_LARGER = 0, //The function duplicates pixels to make the image larger. - IMAQ_SCALE_SMALLER = 1, //The function subsamples pixels to make the image smaller. - IMAQ_SCALING_MODE_SIZE_GUARD = 0xFFFFFFFF -} ScalingMode; - -typedef enum ScalingMethod_enum { - IMAQ_SCALE_TO_PRESERVE_AREA = 0, //Correction functions scale the image such that the features in the corrected image have the same area as the features in the input image. - IMAQ_SCALE_TO_FIT = 1, //Correction functions scale the image such that the corrected image is the same size as the input image. - IMAQ_SCALING_METHOD_SIZE_GUARD = 0xFFFFFFFF -} ScalingMethod; - -typedef enum ReferenceMode_enum { - IMAQ_COORD_X_Y = 0, //This method requires three elements in the points array. - IMAQ_COORD_ORIGIN_X = 1, //This method requires two elements in the points array. - IMAQ_REFERENCE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ReferenceMode; - -typedef enum RectOrientation_enum { - IMAQ_BASE_INSIDE = 0, //Specifies that the base of the rectangular image lies along the inside edge of the annulus. - IMAQ_BASE_OUTSIDE = 1, //Specifies that the base of the rectangular image lies along the outside edge of the annulus. - IMAQ_TEXT_ORIENTATION_SIZE_GUARD = 0xFFFFFFFF -} RectOrientation; - -typedef enum ShapeMode_enum { - IMAQ_SHAPE_RECT = 1, //The function draws a rectangle. - IMAQ_SHAPE_OVAL = 2, //The function draws an oval. - IMAQ_SHAPE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ShapeMode; - -typedef enum PolarityType_enum { - IMAQ_EDGE_RISING = 1, //The edge is a rising edge. - IMAQ_EDGE_FALLING = -1, //The edge is a falling edge. - IMAQ_POLARITY_TYPE_SIZE_GUARD = 0xFFFFFFFF -} PolarityType; - -typedef enum SizeType_enum { - IMAQ_KEEP_LARGE = 0, //The function keeps large particles remaining after the erosion. - IMAQ_KEEP_SMALL = 1, //The function keeps small particles eliminated by the erosion. - IMAQ_SIZE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} SizeType; - -typedef enum Plane3D_enum { - IMAQ_3D_REAL = 0, //The function shows the real part of complex images. - IMAQ_3D_IMAGINARY = 1, //The function shows the imaginary part of complex images. - IMAQ_3D_MAGNITUDE = 2, //The function shows the magnitude part of complex images. - IMAQ_3D_PHASE = 3, //The function shows the phase part of complex images. - IMAQ_PLANE_3D_SIZE_GUARD = 0xFFFFFFFF -} Plane3D; - -typedef enum PhotometricMode_enum { - IMAQ_WHITE_IS_ZERO = 0, //The function interprets zero-value pixels as white. - IMAQ_BLACK_IS_ZERO = 1, //The function interprets zero-value pixels as black. - IMAQ_PHOTOMETRIC_MODE_SIZE_GUARD = 0xFFFFFFFF -} PhotometricMode; - -typedef enum ParticleInfoMode_enum { - IMAQ_BASIC_INFO = 0, //The function returns only the following elements of each report: area, calibratedArea, boundingRect. - IMAQ_ALL_INFO = 1, //The function returns all the information about each particle. - IMAQ_PARTICLE_INFO_MODE_SIZE_GUARD = 0xFFFFFFFF -} ParticleInfoMode; - -typedef enum OutlineMethod_enum { - IMAQ_EDGE_DIFFERENCE = 0, //The function uses a method that produces continuous contours by highlighting each pixel where an intensity variation occurs between itself and its three upper-left neighbors. - IMAQ_EDGE_GRADIENT = 1, //The function uses a method that outlines contours where an intensity variation occurs along the vertical axis. - IMAQ_EDGE_PREWITT = 2, //The function uses a method that extracts the outer contours of objects. - IMAQ_EDGE_ROBERTS = 3, //The function uses a method that outlines the contours that highlight pixels where an intensity variation occurs along the diagonal axes. - IMAQ_EDGE_SIGMA = 4, //The function uses a method that outlines contours and details by setting pixels to the mean value found in their neighborhood, if their deviation from this value is not significant. - IMAQ_EDGE_SOBEL = 5, //The function uses a method that extracts the outer contours of objects. - IMAQ_OUTLINE_METHOD_SIZE_GUARD = 0xFFFFFFFF -} OutlineMethod; - -typedef enum MorphologyMethod_enum { - IMAQ_AUTOM = 0, //The function uses a transformation that generates simpler particles that contain fewer details. - IMAQ_CLOSE = 1, //The function uses a transformation that fills tiny holes and smooths boundaries. - IMAQ_DILATE = 2, //The function uses a transformation that eliminates tiny holes isolated in particles and expands the contour of the particles according to the template defined by the structuring element. - IMAQ_ERODE = 3, //The function uses a transformation that eliminates pixels isolated in the background and erodes the contour of particles according to the template defined by the structuring element. - IMAQ_GRADIENT = 4, //The function uses a transformation that leaves only the pixels that would be added by the dilation process or eliminated by the erosion process. - IMAQ_GRADIENTOUT = 5, //The function uses a transformation that leaves only the pixels that would be added by the dilation process. - IMAQ_GRADIENTIN = 6, //The function uses a transformation that leaves only the pixels that would be eliminated by the erosion process. - IMAQ_HITMISS = 7, //The function uses a transformation that extracts each pixel located in a neighborhood exactly matching the template defined by the structuring element. - IMAQ_OPEN = 8, //The function uses a transformation that removes small particles and smooths boundaries. - IMAQ_PCLOSE = 9, //The function uses a transformation that fills tiny holes and smooths the inner contour of particles according to the template defined by the structuring element. - IMAQ_POPEN = 10, //The function uses a transformation that removes small particles and smooths the contour of particles according to the template defined by the structuring element. - IMAQ_THICK = 11, //The function uses a transformation that adds to an image those pixels located in a neighborhood that matches a template specified by the structuring element. - IMAQ_THIN = 12, //The function uses a transformation that eliminates pixels that are located in a neighborhood matching a template specified by the structuring element. - IMAQ_MORPHOLOGY_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MorphologyMethod; - -typedef enum MeterArcMode_enum { - IMAQ_METER_ARC_ROI = 0, //The function uses the roi parameter and ignores the base, start, and end parameters. - IMAQ_METER_ARC_POINTS = 1, //The function uses the base,start, and end parameters and ignores the roi parameter. - IMAQ_METER_ARC_MODE_SIZE_GUARD = 0xFFFFFFFF -} MeterArcMode; - -typedef enum RakeDirection_enum { - IMAQ_LEFT_TO_RIGHT = 0, //The function searches from the left side of the search area to the right side of the search area. - IMAQ_RIGHT_TO_LEFT = 1, //The function searches from the right side of the search area to the left side of the search area. - IMAQ_TOP_TO_BOTTOM = 2, //The function searches from the top side of the search area to the bottom side of the search area. - IMAQ_BOTTOM_TO_TOP = 3, //The function searches from the bottom side of the search area to the top side of the search area. - IMAQ_RAKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} RakeDirection; - -typedef enum TruncateMode_enum { - IMAQ_TRUNCATE_LOW = 0, //The function truncates low frequencies. - IMAQ_TRUNCATE_HIGH = 1, //The function truncates high frequencies. - IMAQ_TRUNCATE_MODE_SIZE_GUARD = 0xFFFFFFFF -} TruncateMode; - -typedef enum AttenuateMode_enum { - IMAQ_ATTENUATE_LOW = 0, //The function attenuates low frequencies. - IMAQ_ATTENUATE_HIGH = 1, //The function attenuates high frequencies. - IMAQ_ATTENUATE_MODE_SIZE_GUARD = 0xFFFFFFFF -} AttenuateMode; - -typedef enum WindowThreadPolicy_enum { - IMAQ_CALLING_THREAD = 0, //Using this policy, NI Vision creates windows in the thread that makes the first display function call for a given window number. - IMAQ_SEPARATE_THREAD = 1, //Using this policy, NI Vision creates windows in a separate thread and processes messages for the windows automatically. - IMAQ_WINDOW_THREAD_POLICY_SIZE_GUARD = 0xFFFFFFFF -} WindowThreadPolicy; - -typedef enum WindowOptions_enum { - IMAQ_WIND_RESIZABLE = 1, //When present, the user may resize the window interactively. - IMAQ_WIND_TITLEBAR = 2, //When present, the title bar on the window is visible. - IMAQ_WIND_CLOSEABLE = 4, //When present, the close box is available. - IMAQ_WIND_TOPMOST = 8, //When present, the window is always on top. - IMAQ_WINDOW_OPTIONS_SIZE_GUARD = 0xFFFFFFFF -} WindowOptions; - -typedef enum WindowEventType_enum { - IMAQ_NO_EVENT = 0, //No event occurred since the last call to imaqGetLastEvent(). - IMAQ_CLICK_EVENT = 1, //The user clicked on a window. - IMAQ_DRAW_EVENT = 2, //The user drew an ROI in a window. - IMAQ_MOVE_EVENT = 3, //The user moved a window. - IMAQ_SIZE_EVENT = 4, //The user sized a window. - IMAQ_SCROLL_EVENT = 5, //The user scrolled a window. - IMAQ_ACTIVATE_EVENT = 6, //The user activated a window. - IMAQ_CLOSE_EVENT = 7, //The user closed a window. - IMAQ_DOUBLE_CLICK_EVENT = 8, //The user double-clicked in a window. - IMAQ_WINDOW_EVENT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} WindowEventType; - -typedef enum VisionInfoType_enum { - IMAQ_ANY_VISION_INFO = 0, //The function checks if any extra vision information is associated with the image. - IMAQ_PATTERN_MATCHING_INFO = 1, //The function checks if any pattern matching template information is associated with the image. - IMAQ_CALIBRATION_INFO = 2, //The function checks if any calibration information is associated with the image. - IMAQ_OVERLAY_INFO = 3, //The function checks if any overlay information is associated with the image. - IMAQ_VISION_INFO_TYPE_SIZE_GUARD = 0xFFFFFFFF -} VisionInfoType; - -typedef enum SearchStrategy_enum { - IMAQ_CONSERVATIVE = 1, //Instructs the pattern matching algorithm to use the largest possible amount of information from the image at the expense of slowing down the speed of the algorithm. - IMAQ_BALANCED = 2, //Instructs the pattern matching algorithm to balance the amount of information from the image it uses with the speed of the algorithm. - IMAQ_AGGRESSIVE = 3, //Instructs the pattern matching algorithm to use a lower amount of information from the image, which allows the algorithm to run quickly but at the expense of accuracy. - IMAQ_VERY_AGGRESSIVE = 4, //Instructs the pattern matching algorithm to use the smallest possible amount of information from the image, which allows the algorithm to run at the highest speed possible but at the expense of accuracy. - IMAQ_SEARCH_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} SearchStrategy; - -typedef enum TwoEdgePolarityType_enum { - IMAQ_NONE = 0, //The function ignores the polarity of the edges. - IMAQ_RISING_FALLING = 1, //The polarity of the first edge is rising (dark to light) and the polarity of the second edge is falling (light to dark). - IMAQ_FALLING_RISING = 2, //The polarity of the first edge is falling (light to dark) and the polarity of the second edge is rising (dark to light). - IMAQ_RISING_RISING = 3, //The polarity of the first edge is rising (dark to light) and the polarity of the second edge is rising (dark to light). - IMAQ_FALLING_FALLING = 4, //The polarity of the first edge is falling (light to dark) and the polarity of the second edge is falling (light to dark). - IMAQ_TWO_EDGE_POLARITY_TYPE_SIZE_GUARD = 0xFFFFFFFF -} TwoEdgePolarityType; - -typedef enum ObjectType_enum { - IMAQ_BRIGHT_OBJECTS = 0, //The function detects bright objects. - IMAQ_DARK_OBJECTS = 1, //The function detects dark objects. - IMAQ_OBJECT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ObjectType; - -typedef enum Tool_enum { - IMAQ_NO_TOOL = -1, //No tool is in the selected state. - IMAQ_SELECTION_TOOL = 0, //The selection tool selects an existing ROI in an image. - IMAQ_POINT_TOOL = 1, //The point tool draws a point on the image. - IMAQ_LINE_TOOL = 2, //The line tool draws a line on the image. - IMAQ_RECTANGLE_TOOL = 3, //The rectangle tool draws a rectangle on the image. - IMAQ_OVAL_TOOL = 4, //The oval tool draws an oval on the image. - IMAQ_POLYGON_TOOL = 5, //The polygon tool draws a polygon on the image. - IMAQ_CLOSED_FREEHAND_TOOL = 6, //The closed freehand tool draws closed freehand shapes on the image. - IMAQ_ANNULUS_TOOL = 7, //The annulus tool draws annuluses on the image. - IMAQ_ZOOM_TOOL = 8, //The zoom tool controls the zoom of an image. - IMAQ_PAN_TOOL = 9, //The pan tool shifts the view of the image. - IMAQ_POLYLINE_TOOL = 10, //The polyline tool draws a series of connected straight lines on the image. - IMAQ_FREEHAND_TOOL = 11, //The freehand tool draws freehand lines on the image. - IMAQ_ROTATED_RECT_TOOL = 12, //The rotated rectangle tool draws rotated rectangles on the image. - IMAQ_ZOOM_OUT_TOOL = 13, //The zoom out tool controls the zoom of an image. - IMAQ_TOOL_SIZE_GUARD = 0xFFFFFFFF -} Tool; - -typedef enum TIFFCompressionType_enum { - IMAQ_NO_COMPRESSION = 0, //The function does not compress the TIFF file. - IMAQ_JPEG = 1, //The function uses the JPEG compression algorithm to compress the TIFF file. - IMAQ_RUN_LENGTH = 2, //The function uses a run length compression algorithm to compress the TIFF file. - IMAQ_ZIP = 3, //The function uses the ZIP compression algorithm to compress the TIFF file. - IMAQ_TIFF_COMPRESSION_TYPE_SIZE_GUARD = 0xFFFFFFFF -} TIFFCompressionType; - -typedef enum ThresholdMethod_enum { - IMAQ_THRESH_CLUSTERING = 0, //The function uses a method that sorts the histogram of the image within a discrete number of classes corresponding to the number of phases perceived in an image. - IMAQ_THRESH_ENTROPY = 1, //The function uses a method that is best for detecting particles that are present in minuscule proportions on the image. - IMAQ_THRESH_METRIC = 2, //The function uses a method that is well-suited for images in which classes are not too disproportionate. - IMAQ_THRESH_MOMENTS = 3, //The function uses a method that is suited for images that have poor contrast. - IMAQ_THRESH_INTERCLASS = 4, //The function uses a method that is well-suited for images in which classes have well separated pixel value distributions. - IMAQ_THRESHOLD_METHOD_SIZE_GUARD = 0xFFFFFFFF -} ThresholdMethod; - -typedef enum TextAlignment_enum { - IMAQ_LEFT = 0, //Left aligns the text at the reference point. - IMAQ_CENTER = 1, //Centers the text around the reference point. - IMAQ_RIGHT = 2, //Right aligns the text at the reference point. - IMAQ_TEXT_ALIGNMENT_SIZE_GUARD = 0xFFFFFFFF -} TextAlignment; - -typedef enum SpokeDirection_enum { - IMAQ_OUTSIDE_TO_INSIDE = 0, //The function searches from the outside of the search area to the inside of the search area. - IMAQ_INSIDE_TO_OUTSIDE = 1, //The function searches from the inside of the search area to the outside of the search area. - IMAQ_SPOKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} SpokeDirection; - -typedef enum SkeletonMethod_enum { - IMAQ_SKELETON_L = 0, //Uses an L-shaped structuring element in the skeleton function. - IMAQ_SKELETON_M = 1, //Uses an M-shaped structuring element in the skeleton function. - IMAQ_SKELETON_INVERSE = 2, //Uses an L-shaped structuring element on an inverse of the image in the skeleton function. - IMAQ_SKELETON_METHOD_SIZE_GUARD = 0xFFFFFFFF -} SkeletonMethod; - -typedef enum VerticalTextAlignment_enum { - IMAQ_BOTTOM = 0, //Aligns the bottom of the text at the reference point. - IMAQ_TOP = 1, //Aligns the top of the text at the reference point. - IMAQ_BASELINE = 2, //Aligns the baseline of the text at the reference point. - IMAQ_VERTICAL_TEXT_ALIGNMENT_SIZE_GUARD = 0xFFFFFFFF -} VerticalTextAlignment; - -typedef enum CalibrationROI_enum { - IMAQ_FULL_IMAGE = 0, //The correction function corrects the whole image, regardless of the user-defined or calibration-defined ROIs. - IMAQ_CALIBRATION_ROI = 1, //The correction function corrects the area defined by the calibration ROI. - IMAQ_USER_ROI = 2, //The correction function corrects the area defined by the user-defined ROI. - IMAQ_CALIBRATION_AND_USER_ROI = 3, //The correction function corrects the area defined by the intersection of the user-defined ROI and the calibration ROI. - IMAQ_CALIBRATION_OR_USER_ROI = 4, //The correction function corrects the area defined by the union of the user-defined ROI and the calibration ROI. - IMAQ_CALIBRATION_ROI_SIZE_GUARD = 0xFFFFFFFF -} CalibrationROI; - -typedef enum ContourType_enum { - IMAQ_EMPTY_CONTOUR = 0, //The contour is empty. - IMAQ_POINT = 1, //The contour represents a point. - IMAQ_LINE = 2, //The contour represents a line. - IMAQ_RECT = 3, //The contour represents a rectangle. - IMAQ_OVAL = 4, //The contour represents an oval. - IMAQ_CLOSED_CONTOUR = 5, //The contour represents a series of connected points where the last point connects to the first. - IMAQ_OPEN_CONTOUR = 6, //The contour represents a series of connected points where the last point does not connect to the first. - IMAQ_ANNULUS = 7, //The contour represents an annulus. - IMAQ_ROTATED_RECT = 8, //The contour represents a rotated rectangle. - IMAQ_CONTOUR_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ContourType; - -typedef enum MathTransformMethod_enum { - IMAQ_TRANSFORM_LINEAR = 0, //The function uses linear remapping. - IMAQ_TRANSFORM_LOG = 1, //The function uses logarithmic remapping. - IMAQ_TRANSFORM_EXP = 2, //The function uses exponential remapping. - IMAQ_TRANSFORM_SQR = 3, //The function uses square remapping. - IMAQ_TRANSFORM_SQRT = 4, //The function uses square root remapping. - IMAQ_TRANSFORM_POWX = 5, //The function uses power X remapping. - IMAQ_TRANSFORM_POW1X = 6, //The function uses power 1/X remapping. - IMAQ_MATH_TRANSFORM_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MathTransformMethod; - -typedef enum ComplexPlane_enum { - IMAQ_REAL = 0, //The function operates on the real plane of the complex image. - IMAQ_IMAGINARY = 1, //The function operates on the imaginary plane of the complex image. - IMAQ_MAGNITUDE = 2, //The function operates on the magnitude plane of the complex image. - IMAQ_PHASE = 3, //The function operates on the phase plane of the complex image. - IMAQ_COMPLEX_PLANE_SIZE_GUARD = 0xFFFFFFFF -} ComplexPlane; - -typedef enum PaletteType_enum { - IMAQ_PALETTE_GRAY = 0, //The function uses a palette that has a gradual gray-level variation from black to white. - IMAQ_PALETTE_BINARY = 1, //The function uses a palette of 16 cycles of 16 different colors that is useful with binary images. - IMAQ_PALETTE_GRADIENT = 2, //The function uses a palette that has a gradation from red to white with a prominent range of light blue in the upper value range. - IMAQ_PALETTE_RAINBOW = 3, //The function uses a palette that has a gradation from blue to red with a prominent range of greens in the middle value range. - IMAQ_PALETTE_TEMPERATURE = 4, //The function uses a palette that has a gradation from light brown to dark brown. - IMAQ_PALETTE_USER = 5, //The function uses a palette defined by the user. - IMAQ_PALETTE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} PaletteType; - -typedef enum ColorSensitivity_enum { - IMAQ_SENSITIVITY_LOW = 0, //Instructs the algorithm to divide the hue plane into a low number of sectors, allowing for simple color analysis. - IMAQ_SENSITIVITY_MED = 1, //Instructs the algorithm to divide the hue plane into a medium number of sectors, allowing for color analysis that balances sensitivity and complexity. - IMAQ_SENSITIVITY_HIGH = 2, //Instructs the algorithm to divide the hue plane into a high number of sectors, allowing for complex, sensitive color analysis. - IMAQ_COLOR_SENSITIVITY_SIZE_GUARD = 0xFFFFFFFF -} ColorSensitivity; - -typedef enum ColorMode_enum { - IMAQ_RGB = 0, //The function operates in the RGB (Red, Blue, Green) color space. - IMAQ_HSL = 1, //The function operates in the HSL (Hue, Saturation, Luminance) color space. - IMAQ_HSV = 2, //The function operates in the HSV (Hue, Saturation, Value) color space. - IMAQ_HSI = 3, //The function operates in the HSI (Hue, Saturation, Intensity) color space. - IMAQ_CIE = 4, //The function operates in the CIE L*a*b* color space. - IMAQ_CIEXYZ = 5, //The function operates in the CIE XYZ color space. - IMAQ_COLOR_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColorMode; - -typedef enum DetectionMode_enum { - IMAQ_DETECT_PEAKS = 0, //The function detects peaks. - IMAQ_DETECT_VALLEYS = 1, //The function detects valleys. - IMAQ_DETECTION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DetectionMode; - -typedef enum CalibrationUnit_enum { - IMAQ_UNDEFINED = 0, //The image does not have a defined unit of measurement. - IMAQ_ANGSTROM = 1, //The unit of measure for the image is angstroms. - IMAQ_MICROMETER = 2, //The unit of measure for the image is micrometers. - IMAQ_MILLIMETER = 3, //The unit of measure for the image is millimeters. - IMAQ_CENTIMETER = 4, //The unit of measure for the image is centimeters. - IMAQ_METER = 5, //The unit of measure for the image is meters. - IMAQ_KILOMETER = 6, //The unit of measure for the image is kilometers. - IMAQ_MICROINCH = 7, //The unit of measure for the image is microinches. - IMAQ_INCH = 8, //The unit of measure for the image is inches. - IMAQ_FOOT = 9, //The unit of measure for the image is feet. - IMAQ_NAUTICMILE = 10, //The unit of measure for the image is nautical miles. - IMAQ_GROUNDMILE = 11, //The unit of measure for the image is ground miles. - IMAQ_STEP = 12, //The unit of measure for the image is steps. - IMAQ_CALIBRATION_UNIT_SIZE_GUARD = 0xFFFFFFFF -} CalibrationUnit; - -typedef enum ConcentricRakeDirection_enum { - IMAQ_COUNTER_CLOCKWISE = 0, //The function searches the search area in a counter-clockwise direction. - IMAQ_CLOCKWISE = 1, //The function searches the search area in a clockwise direction. - IMAQ_CONCENTRIC_RAKE_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} ConcentricRakeDirection; - -typedef enum CalibrationMode_enum { - IMAQ_PERSPECTIVE = 0, //Functions correct for distortion caused by the camera's perspective. - IMAQ_NONLINEAR = 1, //Functions correct for distortion caused by the camera's lens. - IMAQ_SIMPLE_CALIBRATION = 2, //Functions do not correct for distortion. - IMAQ_CORRECTED_IMAGE = 3, //The image is already corrected. - IMAQ_CALIBRATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} CalibrationMode; - -typedef enum BrowserLocation_enum { - IMAQ_INSERT_FIRST_FREE = 0, //Inserts the thumbnail in the first available cell. - IMAQ_INSERT_END = 1, //Inserts the thumbnail after the last occupied cell. - IMAQ_BROWSER_LOCATION_SIZE_GUARD = 0xFFFFFFFF -} BrowserLocation; - -typedef enum BrowserFrameStyle_enum { - IMAQ_RAISED_FRAME = 0, //Each thumbnail has a raised frame. - IMAQ_BEVELLED_FRAME = 1, //Each thumbnail has a beveled frame. - IMAQ_OUTLINE_FRAME = 2, //Each thumbnail has an outlined frame. - IMAQ_HIDDEN_FRAME = 3, //Each thumbnail has a hidden frame. - IMAQ_STEP_FRAME = 4, //Each thumbnail has a stepped frame. - IMAQ_RAISED_OUTLINE_FRAME = 5, //Each thumbnail has a raised, outlined frame. - IMAQ_BROWSER_FRAME_STYLE_SIZE_GUARD = 0xFFFFFFFF -} BrowserFrameStyle; - -typedef enum BorderMethod_enum { - IMAQ_BORDER_MIRROR = 0, //Symmetrically copies pixel values from the image into the border. - IMAQ_BORDER_COPY = 1, //Copies the value of the pixel closest to the edge of the image into the border. - IMAQ_BORDER_CLEAR = 2, //Sets all pixels in the border to 0. - IMAQ_BORDER_METHOD_SIZE_GUARD = 0xFFFFFFFF -} BorderMethod; - -typedef enum BarcodeType_enum { - IMAQ_INVALID = -1, //The barcode is not of a type known by NI Vision. - IMAQ_CODABAR = 1, //The barcode is of type Codabar. - IMAQ_CODE39 = 2, //The barcode is of type Code 39. - IMAQ_CODE93 = 4, //The barcode is of type Code 93. - IMAQ_CODE128 = 8, //The barcode is of type Code 128. - IMAQ_EAN8 = 16, //The barcode is of type EAN 8. - IMAQ_EAN13 = 32, //The barcode is of type EAN 13. - IMAQ_I2_OF_5 = 64, //The barcode is of type Code 25. - IMAQ_MSI = 128, //The barcode is of type MSI code. - IMAQ_UPCA = 256, //The barcode is of type UPC A. - IMAQ_PHARMACODE = 512, //The barcode is of type Pharmacode. - IMAQ_RSS_LIMITED = 1024, //The barcode is of type RSS Limited. - IMAQ_BARCODE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} BarcodeType; - -typedef enum AxisOrientation_enum { - IMAQ_DIRECT = 0, //The y-axis direction corresponds to the y-axis direction of the Cartesian coordinate system. - IMAQ_INDIRECT = 1, //The y-axis direction corresponds to the y-axis direction of an image. - IMAQ_AXIS_ORIENTATION_SIZE_GUARD = 0xFFFFFFFF -} AxisOrientation; - -typedef enum ColorIgnoreMode_enum { - IMAQ_IGNORE_NONE = 0, //Specifies that the function does not ignore any pixels. - IMAQ_IGNORE_BLACK = 1, //Specifies that the function ignores black pixels. - IMAQ_IGNORE_WHITE = 2, //Specifies that the function ignores white pixels. - IMAQ_IGNORE_BLACK_AND_WHITE = 3, //Specifies that the function ignores black pixels and white pixels. - IMAQ_BLACK_WHITE_IGNORE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColorIgnoreMode; - -typedef enum LevelType_enum { - IMAQ_ABSOLUTE = 0, //The function evaluates the threshold and hysteresis values as absolute values. - IMAQ_RELATIVE = 1, //The function evaluates the threshold and hysteresis values relative to the dynamic range of the given path. - IMAQ_LEVEL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} LevelType; - -typedef enum MatchingMode_enum { - IMAQ_MATCH_SHIFT_INVARIANT = 1, //Searches for occurrences of the template image anywhere in the searchRect, assuming that the pattern is not rotated more than plus or minus 4 degrees. - IMAQ_MATCH_ROTATION_INVARIANT = 2, //Searches for occurrences of the pattern in the image with no restriction on the rotation of the pattern. - IMAQ_MATCHING_MODE_SIZE_GUARD = 0xFFFFFFFF -} MatchingMode; - -typedef enum MappingMethod_enum { - IMAQ_FULL_DYNAMIC = 0, //(Obsolete) When the image bit depth is 0, the function maps the full dynamic range of the 16-bit image to an 8-bit scale. - IMAQ_DOWNSHIFT = 1, //(Obsolete) When the image bit depth is 0, the function shifts the 16-bit image pixels to the right the number of times specified by the shiftCount element of the DisplayMapping structure. - IMAQ_RANGE = 2, //(Obsolete) When the image bit depth is 0, the function maps the pixel values in the range specified by the minimumValue and maximumValue elements of the DisplayMapping structure to an 8-bit scale. - IMAQ_90_PCT_DYNAMIC = 3, //(Obsolete) When the image bit depth to 0, the function maps the dynamic range containing the middle 90 percent of the cumulated histogram of the image to an 8-bit (256 grayscale values) scale. - IMAQ_PERCENT_RANGE = 4, //(Obsolete) When the image bit depth is 0, the function maps the pixel values in the relative percentage range (0 to 100) of the cumulated histogram specified by minimumValue and maximumValue to an 8-bit scale. - IMAQ_DEFAULT_MAPPING = 10, //If the bit depth is 0, the function maps the 16-bit image to 8 bits by following the IMAQ_FULL_DYNAMIC_ALWAYS behavior; otherwise, the function shifts the image data to the right according to the IMAQ_MOST_SIGNIFICANT behavior. - IMAQ_MOST_SIGNIFICANT = 11, //The function shifts the 16-bit image pixels to the right until the 8 most significant bits of the image data are remaining. - IMAQ_FULL_DYNAMIC_ALWAYS = 12, //The function maps the full dynamic range of the 16-bit image to an 8-bit scale. - IMAQ_DOWNSHIFT_ALWAYS = 13, //The function shifts the 16-bit image pixels to the right the number of times specified by the shiftCount element of the DisplayMapping structure. - IMAQ_RANGE_ALWAYS = 14, //The function maps the pixel values in the range specified by the minimumValue and maximumValue elements of the DisplayMapping structure to an 8-bit scale. - IMAQ_90_PCT_DYNAMIC_ALWAYS = 15, //The function maps the dynamic range containing the middle 90 percent of the cumulated histogram of the image to an 8-bit (256 grayscale values) scale. - IMAQ_PERCENT_RANGE_ALWAYS = 16, //The function maps the pixel values in the relative percentage range (0 to 100) of the cumulated histogram specified by minimumValue and maximumValue to an 8-bit scale. - IMAQ_MAPPING_METHOD_SIZE_GUARD = 0xFFFFFFFF -} MappingMethod; - -typedef enum ComparisonFunction_enum { - IMAQ_CLEAR_LESS = 0, //The comparison is true if the source pixel value is less than the comparison image pixel value. - IMAQ_CLEAR_LESS_OR_EQUAL = 1, //The comparison is true if the source pixel value is less than or equal to the comparison image pixel value. - IMAQ_CLEAR_EQUAL = 2, //The comparison is true if the source pixel value is equal to the comparison image pixel value. - IMAQ_CLEAR_GREATER_OR_EQUAL = 3, //The comparison is true if the source pixel value is greater than or equal to the comparison image pixel value. - IMAQ_CLEAR_GREATER = 4, //The comparison is true if the source pixel value is greater than the comparison image pixel value. - IMAQ_COMPARE_FUNCTION_SIZE_GUARD = 0xFFFFFFFF -} ComparisonFunction; - -typedef enum LineGaugeMethod_enum { - IMAQ_EDGE_TO_EDGE = 0, //Measures from the first edge on the line to the last edge on the line. - IMAQ_EDGE_TO_POINT = 1, //Measures from the first edge on the line to the end point of the line. - IMAQ_POINT_TO_EDGE = 2, //Measures from the start point of the line to the first edge on the line. - IMAQ_POINT_TO_POINT = 3, //Measures from the start point of the line to the end point of the line. - IMAQ_LINE_GAUGE_METHOD_SIZE_GUARD = 0xFFFFFFFF -} LineGaugeMethod; - -typedef enum Direction3D_enum { - IMAQ_3D_NW = 0, //The viewing angle for the 3D image is from the northwest. - IMAQ_3D_SW = 1, //The viewing angle for the 3D image is from the southwest. - IMAQ_3D_SE = 2, //The viewing angle for the 3D image is from the southeast. - IMAQ_3D_NE = 3, //The viewing angle for the 3D image is from the northeast. - IMAQ_DIRECTION_3D_SIZE_GUARD = 0xFFFFFFFF -} Direction3D; - -typedef enum LearningMode_enum { - IMAQ_LEARN_ALL = 0, //The function extracts information for shift- and rotation-invariant matching. - IMAQ_LEARN_SHIFT_INFORMATION = 1, //The function extracts information for shift-invariant matching. - IMAQ_LEARN_ROTATION_INFORMATION = 2, //The function extracts information for rotation-invariant matching. - IMAQ_LEARNING_MODE_SIZE_GUARD = 0xFFFFFFFF -} LearningMode; - -typedef enum KernelFamily_enum { - IMAQ_GRADIENT_FAMILY = 0, //The kernel is in the gradient family. - IMAQ_LAPLACIAN_FAMILY = 1, //The kernel is in the Laplacian family. - IMAQ_SMOOTHING_FAMILY = 2, //The kernel is in the smoothing family. - IMAQ_GAUSSIAN_FAMILY = 3, //The kernel is in the Gaussian family. - IMAQ_KERNEL_FAMILY_SIZE_GUARD = 0xFFFFFFFF -} KernelFamily; - -typedef enum InterpolationMethod_enum { - IMAQ_ZERO_ORDER = 0, //The function uses an interpolation method that interpolates new pixel values using the nearest valid neighboring pixel. - IMAQ_BILINEAR = 1, //The function uses an interpolation method that interpolates new pixel values using a bidirectional average of the neighboring pixels. - IMAQ_QUADRATIC = 2, //The function uses an interpolation method that interpolates new pixel values using a quadratic approximating polynomial. - IMAQ_CUBIC_SPLINE = 3, //The function uses an interpolation method that interpolates new pixel values by fitting them to a cubic spline curve, where the curve is based on known pixel values from the image. - IMAQ_BILINEAR_FIXED = 4, //The function uses an interpolation method that interpolates new pixel values using a bidirectional average of the neighboring pixels. - IMAQ_INTERPOLATION_METHOD_SIZE_GUARD = 0xFFFFFFFF -} InterpolationMethod; - -typedef enum ImageType_enum { - IMAQ_IMAGE_U8 = 0, //The image type is 8-bit unsigned integer grayscale. - IMAQ_IMAGE_U16 = 7, //The image type is 16-bit unsigned integer grayscale. - IMAQ_IMAGE_I16 = 1, //The image type is 16-bit signed integer grayscale. - IMAQ_IMAGE_SGL = 2, //The image type is 32-bit floating-point grayscale. - IMAQ_IMAGE_COMPLEX = 3, //The image type is complex. - IMAQ_IMAGE_RGB = 4, //The image type is RGB color. - IMAQ_IMAGE_HSL = 5, //The image type is HSL color. - IMAQ_IMAGE_RGB_U64 = 6, //The image type is 64-bit unsigned RGB color. - IMAQ_IMAGE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ImageType; - -typedef enum ImageFeatureMode_enum { - IMAQ_COLOR_AND_SHAPE_FEATURES = 0, //Instructs the function to use the color and the shape features of the color pattern. - IMAQ_COLOR_FEATURES = 1, //Instructs the function to use the color features of the color pattern. - IMAQ_SHAPE_FEATURES = 2, //Instructs the function to use the shape features of the color pattern. - IMAQ_FEATURE_MODE_SIZE_GUARD = 0xFFFFFFFF -} ImageFeatureMode; - -typedef enum FontColor_enum { - IMAQ_WHITE = 0, //Draws text in white. - IMAQ_BLACK = 1, //Draws text in black. - IMAQ_INVERT = 2, //Inverts the text pixels. - IMAQ_BLACK_ON_WHITE = 3, //Draws text in black with a white background. - IMAQ_WHITE_ON_BLACK = 4, //Draws text in white with a black background. - IMAQ_FONT_COLOR_SIZE_GUARD = 0xFFFFFFFF -} FontColor; - -typedef enum FlipAxis_enum { - IMAQ_HORIZONTAL_AXIS = 0, //Flips the image over the central horizontal axis. - IMAQ_VERTICAL_AXIS = 1, //Flips the image over the central vertical axis. - IMAQ_CENTER_AXIS = 2, //Flips the image over both the central vertical and horizontal axes. - IMAQ_DIAG_L_TO_R_AXIS = 3, //Flips the image over an axis from the upper left corner to lower right corner. - IMAQ_DIAG_R_TO_L_AXIS = 4, //Flips the image over an axis from the upper right corner to lower left corner. - IMAQ_FLIP_AXIS_SIZE_GUARD = 0xFFFFFFFF -} FlipAxis; - -typedef enum EdgeProcess_enum { - IMAQ_FIRST = 0, //The function looks for the first edge. - IMAQ_FIRST_AND_LAST = 1, //The function looks for the first and last edge. - IMAQ_ALL = 2, //The function looks for all edges. - IMAQ_BEST = 3, //The function looks for the best edge. - IMAQ_EDGE_PROCESS_SIZE_GUARD = 0xFFFFFFFF -} EdgeProcess; - -typedef enum DrawMode_enum { - IMAQ_DRAW_VALUE = 0, //Draws the boundary of the object with the specified pixel value. - IMAQ_DRAW_INVERT = 2, //Inverts the pixel values of the boundary of the object. - IMAQ_PAINT_VALUE = 1, //Fills the object with the given pixel value. - IMAQ_PAINT_INVERT = 3, //Inverts the pixel values of the object. - IMAQ_HIGHLIGHT_VALUE = 4, //The function fills the object by highlighting the enclosed pixels with the color of the object. - IMAQ_DRAW_MODE_SIZE_GUARD = 0xFFFFFFFF -} DrawMode; - -typedef enum NearestNeighborMetric_enum { - IMAQ_METRIC_MAXIMUM = 0, //The maximum metric. - IMAQ_METRIC_SUM = 1, //The sum metric. - IMAQ_METRIC_EUCLIDEAN = 2, //The Euclidean metric. - IMAQ_NEAREST_NEIGHBOR_METRIC_SIZE_GUARD = 0xFFFFFFFF -} NearestNeighborMetric; - -typedef enum ReadResolution_enum { - IMAQ_LOW_RESOLUTION = 0, //Configures NI Vision to use low resolution during the read process. - IMAQ_MEDIUM_RESOLUTION = 1, //Configures NI Vision to use medium resolution during the read process. - IMAQ_HIGH_RESOLUTION = 2, //Configures NI Vision to use high resolution during the read process. - IMAQ_READ_RESOLUTION_SIZE_GUARD = 0xFFFFFFFF -} ReadResolution; - -typedef enum ThresholdMode_enum { - IMAQ_FIXED_RANGE = 0, //Performs thresholding using the values you provide in the lowThreshold and highThreshold elements of OCRProcessingOptions. - IMAQ_COMPUTED_UNIFORM = 1, //Calculates a single threshold value for the entire ROI. - IMAQ_COMPUTED_LINEAR = 2, //Calculates a value on the left side of the ROI, calculates a value on the right side of the ROI, and linearly fills the middle values from left to right. - IMAQ_COMPUTED_NONLINEAR = 3, //Divides the ROI into the number of blocks specified by the blockCount element of OCRProcessingOptions and calculates a threshold value for each block. - IMAQ_THRESHOLD_MODE_SIZE_GUARD = 0xFFFFFFFF -} ThresholdMode; - -typedef enum ReadStrategy_enum { - IMAQ_READ_AGGRESSIVE = 0, //Configures NI Vision to perform fewer checks when analyzing objects to determine if they match trained characters. - IMAQ_READ_CONSERVATIVE = 1, //Configures NI Vision to perform more checks to determine if an object matches a trained character. - IMAQ_READ_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} ReadStrategy; - -typedef enum MeasurementType_enum { - IMAQ_MT_CENTER_OF_MASS_X = 0, //X-coordinate of the point representing the average position of the total particle mass, assuming every point in the particle has a constant density. - IMAQ_MT_CENTER_OF_MASS_Y = 1, //Y-coordinate of the point representing the average position of the total particle mass, assuming every point in the particle has a constant density. - IMAQ_MT_FIRST_PIXEL_X = 2, //X-coordinate of the highest, leftmost particle pixel. - IMAQ_MT_FIRST_PIXEL_Y = 3, //Y-coordinate of the highest, leftmost particle pixel. - IMAQ_MT_BOUNDING_RECT_LEFT = 4, //X-coordinate of the leftmost particle point. - IMAQ_MT_BOUNDING_RECT_TOP = 5, //Y-coordinate of highest particle point. - IMAQ_MT_BOUNDING_RECT_RIGHT = 6, //X-coordinate of the rightmost particle point. - IMAQ_MT_BOUNDING_RECT_BOTTOM = 7, //Y-coordinate of the lowest particle point. - IMAQ_MT_MAX_FERET_DIAMETER_START_X = 8, //X-coordinate of the start of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_START_Y = 9, //Y-coordinate of the start of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_END_X = 10, //X-coordinate of the end of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_MAX_FERET_DIAMETER_END_Y = 11, //Y-coordinate of the end of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_LEFT = 12, //X-coordinate of the leftmost pixel in the longest row of contiguous pixels in the particle. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_RIGHT = 13, //X-coordinate of the rightmost pixel in the longest row of contiguous pixels in the particle. - IMAQ_MT_MAX_HORIZ_SEGMENT_LENGTH_ROW = 14, //Y-coordinate of all of the pixels in the longest row of contiguous pixels in the particle. - IMAQ_MT_BOUNDING_RECT_WIDTH = 16, //Distance between the x-coordinate of the leftmost particle point and the x-coordinate of the rightmost particle point. - IMAQ_MT_BOUNDING_RECT_HEIGHT = 17, //Distance between the y-coordinate of highest particle point and the y-coordinate of the lowest particle point. - IMAQ_MT_BOUNDING_RECT_DIAGONAL = 18, //Distance between opposite corners of the bounding rectangle. - IMAQ_MT_PERIMETER = 19, //Length of the outer boundary of the particle. - IMAQ_MT_CONVEX_HULL_PERIMETER = 20, //Perimeter of the smallest convex polygon containing all points in the particle. - IMAQ_MT_HOLES_PERIMETER = 21, //Sum of the perimeters of each hole in the particle. - IMAQ_MT_MAX_FERET_DIAMETER = 22, //Distance between the start and end of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_EQUIVALENT_ELLIPSE_MAJOR_AXIS = 23, //Length of the major axis of the ellipse with the same perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_ELLIPSE_MINOR_AXIS = 24, //Length of the minor axis of the ellipse with the same perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_ELLIPSE_MINOR_AXIS_FERET = 25, //Length of the minor axis of the ellipse with the same area as the particle, and Major Axis equal in length to the Max Feret Diameter. - IMAQ_MT_EQUIVALENT_RECT_LONG_SIDE = 26, //Longest side of the rectangle with the same perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_RECT_SHORT_SIDE = 27, //Shortest side of the rectangle with the same perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_RECT_DIAGONAL = 28, //Distance between opposite corners of the rectangle with the same perimeter and area as the particle. - IMAQ_MT_EQUIVALENT_RECT_SHORT_SIDE_FERET = 29, //Shortest side of the rectangle with the same area as the particle, and longest side equal in length to the Max Feret Diameter. - IMAQ_MT_AVERAGE_HORIZ_SEGMENT_LENGTH = 30, //Average length of a horizontal segment in the particle. - IMAQ_MT_AVERAGE_VERT_SEGMENT_LENGTH = 31, //Average length of a vertical segment in the particle. - IMAQ_MT_HYDRAULIC_RADIUS = 32, //The particle area divided by the particle perimeter. - IMAQ_MT_WADDEL_DISK_DIAMETER = 33, //Diameter of a disk with the same area as the particle. - IMAQ_MT_AREA = 35, //Area of the particle. - IMAQ_MT_HOLES_AREA = 36, //Sum of the areas of each hole in the particle. - IMAQ_MT_PARTICLE_AND_HOLES_AREA = 37, //Area of a particle that completely covers the image. - IMAQ_MT_CONVEX_HULL_AREA = 38, //Area of the smallest convex polygon containing all points in the particle. - IMAQ_MT_IMAGE_AREA = 39, //Area of the image. - IMAQ_MT_NUMBER_OF_HOLES = 41, //Number of holes in the particle. - IMAQ_MT_NUMBER_OF_HORIZ_SEGMENTS = 42, //Number of horizontal segments in the particle. - IMAQ_MT_NUMBER_OF_VERT_SEGMENTS = 43, //Number of vertical segments in the particle. - IMAQ_MT_ORIENTATION = 45, //The angle of the line that passes through the particle Center of Mass about which the particle has the lowest moment of inertia. - IMAQ_MT_MAX_FERET_DIAMETER_ORIENTATION = 46, //The angle of the line segment connecting the two perimeter points that are the furthest apart. - IMAQ_MT_AREA_BY_IMAGE_AREA = 48, //Percentage of the particle Area covering the Image Area. - IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA = 49, //Percentage of the particle Area in relation to its Particle and Holes Area. - IMAQ_MT_RATIO_OF_EQUIVALENT_ELLIPSE_AXES = 50, //Equivalent Ellipse Major Axis divided by Equivalent Ellipse Minor Axis. - IMAQ_MT_RATIO_OF_EQUIVALENT_RECT_SIDES = 51, //Equivalent Rect Long Side divided by Equivalent Rect Short Side. - IMAQ_MT_ELONGATION_FACTOR = 53, //Max Feret Diameter divided by Equivalent Rect Short Side (Feret). - IMAQ_MT_COMPACTNESS_FACTOR = 54, //Area divided by the product of Bounding Rect Width and Bounding Rect Height. - IMAQ_MT_HEYWOOD_CIRCULARITY_FACTOR = 55, //Perimeter divided by the circumference of a circle with the same area. - IMAQ_MT_TYPE_FACTOR = 56, //Factor relating area to moment of inertia. - IMAQ_MT_SUM_X = 58, //The sum of all x-coordinates in the particle. - IMAQ_MT_SUM_Y = 59, //The sum of all y-coordinates in the particle. - IMAQ_MT_SUM_XX = 60, //The sum of all x-coordinates squared in the particle. - IMAQ_MT_SUM_XY = 61, //The sum of all x-coordinates times y-coordinates in the particle. - IMAQ_MT_SUM_YY = 62, //The sum of all y-coordinates squared in the particle. - IMAQ_MT_SUM_XXX = 63, //The sum of all x-coordinates cubed in the particle. - IMAQ_MT_SUM_XXY = 64, //The sum of all x-coordinates squared times y-coordinates in the particle. - IMAQ_MT_SUM_XYY = 65, //The sum of all x-coordinates times y-coordinates squared in the particle. - IMAQ_MT_SUM_YYY = 66, //The sum of all y-coordinates cubed in the particle. - IMAQ_MT_MOMENT_OF_INERTIA_XX = 68, //The moment of inertia in the x-direction twice. - IMAQ_MT_MOMENT_OF_INERTIA_XY = 69, //The moment of inertia in the x and y directions. - IMAQ_MT_MOMENT_OF_INERTIA_YY = 70, //The moment of inertia in the y-direction twice. - IMAQ_MT_MOMENT_OF_INERTIA_XXX = 71, //The moment of inertia in the x-direction three times. - IMAQ_MT_MOMENT_OF_INERTIA_XXY = 72, //The moment of inertia in the x-direction twice and the y-direction once. - IMAQ_MT_MOMENT_OF_INERTIA_XYY = 73, //The moment of inertia in the x-direction once and the y-direction twice. - IMAQ_MT_MOMENT_OF_INERTIA_YYY = 74, //The moment of inertia in the y-direction three times. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XX = 75, //The normalized moment of inertia in the x-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XY = 76, //The normalized moment of inertia in the x- and y-directions. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_YY = 77, //The normalized moment of inertia in the y-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XXX = 78, //The normalized moment of inertia in the x-direction three times. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XXY = 79, //The normalized moment of inertia in the x-direction twice and the y-direction once. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_XYY = 80, //The normalized moment of inertia in the x-direction once and the y-direction twice. - IMAQ_MT_NORM_MOMENT_OF_INERTIA_YYY = 81, //The normalized moment of inertia in the y-direction three times. - IMAQ_MT_HU_MOMENT_1 = 82, //The first Hu moment. - IMAQ_MT_HU_MOMENT_2 = 83, //The second Hu moment. - IMAQ_MT_HU_MOMENT_3 = 84, //The third Hu moment. - IMAQ_MT_HU_MOMENT_4 = 85, //The fourth Hu moment. - IMAQ_MT_HU_MOMENT_5 = 86, //The fifth Hu moment. - IMAQ_MT_HU_MOMENT_6 = 87, //The sixth Hu moment. - IMAQ_MT_HU_MOMENT_7 = 88, //The seventh Hu moment. - IMAQ_MEASUREMENT_TYPE_SIZE_GUARD = 0xFFFFFFFF -} MeasurementType; - -typedef enum GeometricMatchingMode_enum { - IMAQ_GEOMETRIC_MATCH_SHIFT_INVARIANT = 0, //Searches for occurrences of the pattern in the image, assuming that the pattern is not rotated more than plus or minus 5 degrees. - IMAQ_GEOMETRIC_MATCH_ROTATION_INVARIANT = 1, //Searches for occurrences of the pattern in the image with reduced restriction on the rotation of the pattern. - IMAQ_GEOMETRIC_MATCH_SCALE_INVARIANT = 2, //Searches for occurrences of the pattern in the image with reduced restriction on the size of the pattern. - IMAQ_GEOMETRIC_MATCH_OCCLUSION_INVARIANT = 4, //Searches for occurrences of the pattern in the image, allowing for a specified percentage of the pattern to be occluded. - IMAQ_GEOMETRIC_MATCHING_MODE_SIZE_GUARD = 0xFFFFFFFF -} GeometricMatchingMode; - -typedef enum ButtonLabel_enum { - IMAQ_BUTTON_OK = 0, //The label "OK". - IMAQ_BUTTON_SAVE = 1, //The label "Save". - IMAQ_BUTTON_SELECT = 2, //The label "Select". - IMAQ_BUTTON_LOAD = 3, //The label "Load". - IMAQ_BUTTON_LABEL_SIZE_GUARD = 0xFFFFFFFF -} ButtonLabel; - -typedef enum NearestNeighborMethod_enum { - IMAQ_MINIMUM_MEAN_DISTANCE = 0, //The minimum mean distance method. - IMAQ_K_NEAREST_NEIGHBOR = 1, //The k-nearest neighbor method. - IMAQ_NEAREST_PROTOTYPE = 2, //The nearest prototype method. - IMAQ_NEAREST_NEIGHBOR_METHOD_SIZE_GUARD = 0xFFFFFFFF -} NearestNeighborMethod; - -typedef enum QRMirrorMode_enum { - IMAQ_QR_MIRROR_MODE_AUTO_DETECT = -2, //The function should determine if the QR code is mirrored. - IMAQ_QR_MIRROR_MODE_MIRRORED = 1, //The function should expect the QR code to appear mirrored. - IMAQ_QR_MIRROR_MODE_NORMAL = 0, //The function should expect the QR code to appear normal. - IMAQ_QR_MIRROR_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRMirrorMode; - -typedef enum ColumnProcessingMode_enum { - IMAQ_AVERAGE_COLUMNS = 0, //Averages the data extracted for edge detection. - IMAQ_MEDIAN_COLUMNS = 1, //Takes the median of the data extracted for edge detection. - IMAQ_COLUMN_PROCESSING_MODE_SIZE_GUARD = 0xFFFFFFFF -} ColumnProcessingMode; - -typedef enum FindReferenceDirection_enum { - IMAQ_LEFT_TO_RIGHT_DIRECT = 0, //Searches from the left side of the search area to the right side of the search area for a direct axis. - IMAQ_LEFT_TO_RIGHT_INDIRECT = 1, //Searches from the left side of the search area to the right side of the search area for an indirect axis. - IMAQ_TOP_TO_BOTTOM_DIRECT = 2, //Searches from the top of the search area to the bottom of the search area for a direct axis. - IMAQ_TOP_TO_BOTTOM_INDIRECT = 3, //Searches from the top of the search area to the bottom of the search area for an indirect axis. - IMAQ_RIGHT_TO_LEFT_DIRECT = 4, //Searches from the right side of the search area to the left side of the search area for a direct axis. - IMAQ_RIGHT_TO_LEFT_INDIRECT = 5, //Searches from the right side of the search area to the left side of the search area for an indirect axis. - IMAQ_BOTTOM_TO_TOP_DIRECT = 6, //Searches from the bottom of the search area to the top of the search area for a direct axis. - IMAQ_BOTTOM_TO_TOP_INDIRECT = 7, //Searches from the bottom of the search area to the top of the search area for an indirect axis. - IMAQ_FIND_COORD_SYS_DIR_SIZE_GUARD = 0xFFFFFFFF -} FindReferenceDirection; - -typedef enum MulticoreOperation_enum { - IMAQ_GET_CORES = 0, //The number of processor cores NI Vision is currently using. - IMAQ_SET_CORES = 1, //The number of processor cores for NI Vision to use. - IMAQ_USE_MAX_AVAILABLE = 2, //Use the maximum number of available processor cores. - IMAQ_MULTICORE_OPERATION_SIZE_GUARD = 0xFFFFFFFF -} MulticoreOperation; - -typedef enum GroupBehavior_enum { - IMAQ_GROUP_CLEAR = 0, //Sets the behavior of the overlay group to clear the current settings when an image is transformed. - IMAQ_GROUP_KEEP = 1, //Sets the behavior of the overlay group to keep the current settings when an image is transformed. - IMAQ_GROUP_TRANSFORM = 2, //Sets the behavior of the overlay group to transform with the image. - IMAQ_GROUP_BEHAVIOR_SIZE_GUARD = 0xFFFFFFFF -} GroupBehavior; - -typedef enum QRDimensions_enum { - IMAQ_QR_DIMENSIONS_AUTO_DETECT = 0, //The function will automatically determine the dimensions of the QR code. - IMAQ_QR_DIMENSIONS_11x11 = 11, //Specifies the dimensions of the QR code as 11 x 11. - IMAQ_QR_DIMENSIONS_13x13 = 13, //Specifies the dimensions of the QR code as 13 x 13. - IMAQ_QR_DIMENSIONS_15x15 = 15, //Specifies the dimensions of the QR code as 15 x 15. - IMAQ_QR_DIMENSIONS_17x17 = 17, //Specifies the dimensions of the QR code as 17 x 17. - IMAQ_QR_DIMENSIONS_21x21 = 21, //Specifies the dimensions of the QR code as 21 x 21. - IMAQ_QR_DIMENSIONS_25x25 = 25, //Specifies the dimensions of the QR code as 25 x 25. - IMAQ_QR_DIMENSIONS_29x29 = 29, //Specifies the dimensions of the QR code as 29 x 29. - IMAQ_QR_DIMENSIONS_33x33 = 33, //Specifies the dimensions of the QR code as 33 x 33. - IMAQ_QR_DIMENSIONS_37x37 = 37, //Specifies the dimensions of the QR code as 37 x 37. - IMAQ_QR_DIMENSIONS_41x41 = 41, //Specifies the dimensions of the QR code as 41 x 41. - IMAQ_QR_DIMENSIONS_45x45 = 45, //Specifies the dimensions of the QR code as 45 x 45. - IMAQ_QR_DIMENSIONS_49x49 = 49, //Specifies the dimensions of the QR code as 49 x 49. - IMAQ_QR_DIMENSIONS_53x53 = 53, //Specifies the dimensions of the QR code as 53 x 53. - IMAQ_QR_DIMENSIONS_57x57 = 57, //Specifies the dimensions of the QR code as 57 x 57. - IMAQ_QR_DIMENSIONS_61x61 = 61, //Specifies the dimensions of the QR code as 61 x 61. - IMAQ_QR_DIMENSIONS_65x65 = 65, //Specifies the dimensions of the QR code as 65 x 65. - IMAQ_QR_DIMENSIONS_69x69 = 69, //Specifies the dimensions of the QR code as 69 x 69. - IMAQ_QR_DIMENSIONS_73x73 = 73, //Specifies the dimensions of the QR code as 73 x 73. - IMAQ_QR_DIMENSIONS_77x77 = 77, //Specifies the dimensions of the QR code as 77 x 77. - IMAQ_QR_DIMENSIONS_81x81 = 81, //Specifies the dimensions of the QR code as 81 x 81. - IMAQ_QR_DIMENSIONS_85x85 = 85, //Specifies the dimensions of the QR code as 85 x 85. - IMAQ_QR_DIMENSIONS_89x89 = 89, //Specifies the dimensions of the QR code as 89 x 89. - IMAQ_QR_DIMENSIONS_93x93 = 93, //Specifies the dimensions of the QR code as 93 x 93. - IMAQ_QR_DIMENSIONS_97x97 = 97, //Specifies the dimensions of the QR code as 97 x 97. - IMAQ_QR_DIMENSIONS_101x101 = 101, //Specifies the dimensions of the QR code as 101 x 101. - IMAQ_QR_DIMENSIONS_105x105 = 105, //Specifies the dimensions of the QR code as 105 x 105. - IMAQ_QR_DIMENSIONS_109x109 = 109, //Specifies the dimensions of the QR code as 109 x 109. - IMAQ_QR_DIMENSIONS_113x113 = 113, //Specifies the dimensions of the QR code as 113 x 113. - IMAQ_QR_DIMENSIONS_117x117 = 117, //Specifies the dimensions of the QR code as 117 x 117. - IMAQ_QR_DIMENSIONS_121x121 = 121, //Specifies the dimensions of the QR code as 121 x 121. - IMAQ_QR_DIMENSIONS_125x125 = 125, //Specifies the dimensions of the QR code as 125 x 125. - IMAQ_QR_DIMENSIONS_129x129 = 129, //Specifies the dimensions of the QR code as 129 x 129. - IMAQ_QR_DIMENSIONS_133x133 = 133, //Specifies the dimensions of the QR code as 133 x 133. - IMAQ_QR_DIMENSIONS_137x137 = 137, //Specifies the dimensions of the QR code as 137 x 137. - IMAQ_QR_DIMENSIONS_141x141 = 141, //Specifies the dimensions of the QR code as 141 x 141. - IMAQ_QR_DIMENSIONS_145x145 = 145, //Specifies the dimensions of the QR code as 145 x 145. - IMAQ_QR_DIMENSIONS_149x149 = 149, //Specifies the dimensions of the QR code as 149 x 149. - IMAQ_QR_DIMENSIONS_153x153 = 153, //Specifies the dimensions of the QR code as 153 x 153. - IMAQ_QR_DIMENSIONS_157x157 = 157, //Specifies the dimensions of the QR code as 157 x 1537. - IMAQ_QR_DIMENSIONS_161x161 = 161, //Specifies the dimensions of the QR code as 161 x 161. - IMAQ_QR_DIMENSIONS_165x165 = 165, //Specifies the dimensions of the QR code as 165 x 165. - IMAQ_QR_DIMENSIONS_169x169 = 169, //Specifies the dimensions of the QR code as 169 x 169. - IMAQ_QR_DIMENSIONS_173x173 = 173, //Specifies the dimensions of the QR code as 173 x 173. - IMAQ_QR_DIMENSIONS_177x177 = 177, //Specifies the dimensions of the QR code as 177 x 177. - IMAQ_QR_DIMENSIONS_SIZE_GUARD = 0xFFFFFFFF -} QRDimensions; - -typedef enum QRCellFilterMode_enum { - IMAQ_QR_CELL_FILTER_MODE_AUTO_DETECT = -2, //The function will try all filter modes and uses the one that decodes the QR code within the fewest iterations and utilizing the least amount of error correction. - IMAQ_QR_CELL_FILTER_MODE_AVERAGE = 0, //The function sets the pixel value for the cell to the average of the sampled pixels. - IMAQ_QR_CELL_FILTER_MODE_MEDIAN = 1, //The function sets the pixel value for the cell to the median of the sampled pixels. - IMAQ_QR_CELL_FILTER_MODE_CENTRAL_AVERAGE = 2, //The function sets the pixel value for the cell to the average of the pixels in the center of the cell sample. - IMAQ_QR_CELL_FILTER_MODE_HIGH_AVERAGE = 3, //The function sets the pixel value for the cell to the average value of the half of the sampled pixels with the highest pixel values. - IMAQ_QR_CELL_FILTER_MODE_LOW_AVERAGE = 4, //The function sets the pixel value for the cell to the average value of the half of the sampled pixels with the lowest pixel values. - IMAQ_QR_CELL_FILTER_MODE_VERY_HIGH_AVERAGE = 5, //The function sets the pixel value for the cell to the average value of the ninth of the sampled pixels with the highest pixel values. - IMAQ_QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE = 6, //The function sets the pixel value for the cell to the average value of the ninth of the sampled pixels with the lowest pixel values. - IMAQ_QR_CELL_FILTER_MODE_ALL = 8, //The function tries each filter mode, starting with IMAQ_QR_CELL_FILTER_MODE_AVERAGE and ending with IMAQ_QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE, stopping once a filter mode decodes correctly. - IMAQ_QR_CELL_FILTER_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRCellFilterMode; - -typedef enum RoundingMode_enum { - IMAQ_ROUNDING_MODE_OPTIMIZE = 0, //Rounds the result of a division using the best available method. - IMAQ_ROUNDING_MODE_TRUNCATE = 1, //Truncates the result of a division. - IMAQ_ROUNDING_MODE_SIZE_GUARD = 0xFFFFFFFF -} RoundingMode; - -typedef enum QRDemodulationMode_enum { - IMAQ_QR_DEMODULATION_MODE_AUTO_DETECT = -2, //The function will try each demodulation mode and use the one which decodes the QR code within the fewest iterations and utilizing the least amount of error correction. - IMAQ_QR_DEMODULATION_MODE_HISTOGRAM = 0, //The function uses a histogram of all of the QR cells to calculate a threshold. - IMAQ_QR_DEMODULATION_MODE_LOCAL_CONTRAST = 1, //The function examines each of the cell's neighbors to determine if the cell is on or off. - IMAQ_QR_DEMODULATION_MODE_COMBINED = 2, //The function uses the histogram of the QR code to calculate a threshold. - IMAQ_QR_DEMODULATION_MODE_ALL = 3, //The function tries IMAQ_QR_DEMODULATION_MODE_HISTOGRAM, then IMAQ_QR_DEMODULATION_MODE_LOCAL_CONTRAST and then IMAQ_QR_DEMODULATION_MODE_COMBINED, stopping once one mode is successful. - IMAQ_QR_DEMODULATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRDemodulationMode; - -typedef enum ContrastMode_enum { - IMAQ_ORIGINAL_CONTRAST = 0, //Instructs the geometric matching algorithm to find matches with the same contrast as the template. - IMAQ_REVERSED_CONTRAST = 1, //Instructs the geometric matching algorithm to find matches with the inverted contrast of the template. - IMAQ_BOTH_CONTRASTS = 2, //Instructs the geometric matching algorithm to find matches with the same and inverted contrast of the template. -} ContrastMode; - -typedef enum QRPolarities_enum { - IMAQ_QR_POLARITY_AUTO_DETECT = -2, //The function should determine the polarity of the QR code. - IMAQ_QR_POLARITY_BLACK_ON_WHITE = 0, //The function should search for a QR code with dark data on a bright background. - IMAQ_QR_POLARITY_WHITE_ON_BLACK = 1, //The function should search for a QR code with bright data on a dark background. - IMAQ_QR_POLARITY_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRPolarities; - -typedef enum QRRotationMode_enum { - IMAQ_QR_ROTATION_MODE_UNLIMITED = 0, //The function allows for unlimited rotation. - IMAQ_QR_ROTATION_MODE_0_DEGREES = 1, //The function allows for ??? 5 degrees of rotation. - IMAQ_QR_ROTATION_MODE_90_DEGREES = 2, //The function allows for between 85 and 95 degrees of rotation. - IMAQ_QR_ROTATION_MODE_180_DEGREES = 3, //The function allows for between 175 and 185 degrees of rotation. - IMAQ_QR_ROTATION_MODE_270_DEGREES = 4, //The function allows for between 265 and 275 degrees of rotation. - IMAQ_QR_ROTATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRRotationMode; - -typedef enum QRGradingMode_enum { - IMAQ_QR_NO_GRADING = 0, //The function does not make any preparatory calculations. - IMAQ_QR_GRADING_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRGradingMode; - -typedef enum StraightEdgeSearchMode_enum { - IMAQ_USE_FIRST_RAKE_EDGES = 0, //Fits a straight edge on the first points detected using a rake. - IMAQ_USE_BEST_RAKE_EDGES = 1, //Fits a straight edge on the best points detected using a rake. - IMAQ_USE_BEST_HOUGH_LINE = 2, //Finds the strongest straight edge using all points detected on a rake. - IMAQ_USE_FIRST_PROJECTION_EDGE = 3, //Uses the location of the first projected edge as the straight edge. - IMAQ_USE_BEST_PROJECTION_EDGE = 4, //Finds the strongest projected edge location to determine the straight edge. - IMAQ_STRAIGHT_EDGE_SEARCH_SIZE_GUARD = 0xFFFFFFFF -} StraightEdgeSearchMode; - -typedef enum SearchDirection_enum { - IMAQ_SEARCH_DIRECTION_LEFT_TO_RIGHT = 0, //Searches from the left side of the search area to the right side of the search area. - IMAQ_SEARCH_DIRECTION_RIGHT_TO_LEFT = 1, //Searches from the right side of the search area to the left side of the search area. - IMAQ_SEARCH_DIRECTION_TOP_TO_BOTTOM = 2, //Searches from the top side of the search area to the bottom side of the search area. - IMAQ_SEARCH_DIRECTION_BOTTOM_TO_TOP = 3, //Searches from the bottom side of the search area to the top side of the search area. - IMAQ_SEARCH_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} SearchDirection; - -typedef enum QRStreamMode_enum { - IMAQ_QR_MODE_NUMERIC = 0, //Specifies that the data was encoded using numeric mode. - IMAQ_QR_MODE_ALPHANUMERIC = 1, //Specifies that the data was encoded using alpha-numeric mode. - IMAQ_QR_MODE_RAW_BYTE = 2, //Specifies that the data was not encoded but is only raw binary bytes, or encoded in JIS-8. - IMAQ_QR_MODE_EAN128_TOKEN = 3, //Specifies that the data has a special meaning represented by the application ID. - IMAQ_QR_MODE_EAN128_DATA = 4, //Specifies that the data has a special meaning represented by the application ID. - IMAQ_QR_MODE_ECI = 5, //Specifies that the data was meant to be read using the language represented in the language ID. - IMAQ_QR_MODE_KANJI = 6, //Specifies that the data was encoded in Shift-JIS16 Japanese. - IMAQ_QR_MODE_SIZE_GUARD = 0xFFFFFFFF -} QRStreamMode; - -typedef enum ParticleClassifierType_enum { - IMAQ_PARTICLE_LARGEST = 0, //Use only the largest particle in the image. - IMAQ_PARTICLE_ALL = 1, //Use all particles in the image. - IMAQ_PARTICLE_CLASSIFIER_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ParticleClassifierType; - -typedef enum QRCellSampleSize_enum { - IMAQ_QR_CELL_SAMPLE_SIZE_AUTO_DETECT = -2, //The function will try each sample size and use the one which decodes the QR code within the fewest iterations and utilizing the least amount of error correction. - IMAQ_QR_CELL_SAMPLE_SIZE1X1 = 1, //The function will use a 1x1 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE2X2 = 2, //The function will use a 2x2 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE3X3 = 3, //The function will use a 3x3 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE4X4 = 4, //The function will use a 4x4 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE5X5 = 5, //The function will use a 5x5 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE6X6 = 6, //The function will use a 6x6 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_SIZE7X7 = 7, //The function will use a 7x7 sized sample from each cell. - IMAQ_QR_CELL_SAMPLE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} QRCellSampleSize; - -typedef enum RakeProcessType_enum { - IMAQ_GET_FIRST_EDGES = 0, - IMAQ_GET_FIRST_AND_LAST_EDGES = 1, - IMAQ_GET_ALL_EDGES = 2, - IMAQ_GET_BEST_EDGES = 3, - IMAQ_RAKE_PROCESS_TYPE_SIZE_GUARD = 0xFFFFFFFF -} RakeProcessType; - -typedef enum GeometricSetupDataItem_enum { - IMAQ_CURVE_EXTRACTION_MODE = 0, //Specifies how the function identifies curves in the image. - IMAQ_CURVE_EDGE_THRSHOLD = 1, //Specifies the minimum contrast an edge pixel must have for it to be considered part of a curve. - IMAQ_CURVE_EDGE_FILTER = 2, //Specifies the width of the edge filter that the function uses to identify curves in the image. - IMAQ_MINIMUM_CURVE_LENGTH = 3, //Specifies the length, in pixels, of the smallest curve that you want the function to identify. - IMAQ_CURVE_ROW_SEARCH_STEP_SIZE = 4, //Specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. - IMAQ_CURVE_COL_SEARCH_STEP_SIZE = 5, //Specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. - IMAQ_CURVE_MAX_END_POINT_GAP = 6, //Specifies the maximum gap, in pixels, between the endpoints of a curve that the function identifies as a closed curve. - IMAQ_EXTRACT_CLOSED_CURVES = 7, //Specifies whether to identify only closed curves in the image. - IMAQ_ENABLE_SUBPIXEL_CURVE_EXTRACTION = 8, //The function ignores this option. - IMAQ_ENABLE_CORRELATION_SCORE = 9, //Specifies that the function should calculate the Correlation Score and return it for each match result. - IMAQ_ENABLE_SUBPIXEL_ACCURACY = 10, //Determines whether to return the match results with subpixel accuracy. - IMAQ_SUBPIXEL_ITERATIONS = 11, //Specifies the maximum number of incremental improvements used to refine matches using subpixel information. - IMAQ_SUBPIXEL_TOLERANCE = 12, //Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the function stops refining the match position. - IMAQ_INITIAL_MATCH_LIST_LENGTH = 13, //Specifies the maximum size of the match list. - IMAQ_ENABLE_TARGET_TEMPLATE_CURVESCORE = 14, //Specifies whether the function should calculate the match curve to template curve score and return it for each match result. - IMAQ_MINIMUM_MATCH_SEPARATION_DISTANCE = 15, //Specifies the minimum separation distance, in pixels, between the origins of two matches that have unique positions. - IMAQ_MINIMUM_MATCH_SEPARATION_ANGLE = 16, //Specifies the minimum angular difference, in degrees, between two matches that have unique angles. - IMAQ_MINIMUM_MATCH_SEPARATION_SCALE = 17, //Specifies the minimum difference in scale, expressed as a percentage, between two matches that have unique scales. - IMAQ_MAXIMUM_MATCH_OVERLAP = 18, //Specifies whether you want the algorithm to spend less time accurately estimating the location of a match. - IMAQ_ENABLE_COARSE_RESULT = 19, //Specifies whether you want the algorithm to spend less time accurately estimating the location of a match. - IMAQ_ENABLE_CALIBRATION_SUPPORT = 20, //Specifies whether or not the algorithm treat the inspection image as a calibrated image. - IMAQ_ENABLE_CONTRAST_REVERSAL = 21, //Specifies the contrast of the matches to search for. - IMAQ_SEARCH_STRATEGY = 22, //Specifies the aggressiveness of the strategy used to find matches in the image. - IMAQ_REFINEMENT_MATCH_FACTOR = 23, //Specifies the factor applied to the number of matches requested to determine how many matches are refined in the pyramid stage. - IMAQ_SUBPIXEL_MATCH_FACTOR = 24, //Specifies the factor applied to the number for matches requested to determine how many matches are used for the final (subpixel) stage. - IMAQ_MAX_REFINEMENT_ITERATIONS = 25, //Specifies maximum refinement iteration. -} GeometricSetupDataItem; - -typedef enum DistortionModel_enum { - IMAQ_POLYNOMIAL_MODEL = 0, //Polynomial model. - IMAQ_DIVISION_MODEL = 1, //Division Model. - IMAQ_NO_DISTORTION_MODEL = -1, //Not a distortion model. -} DistortionModel; - -typedef enum CalibrationThumbnailType_enum { - IMAQ_CAMARA_MODEL_TYPE = 0, //Camara model thumbnail type. - IMAQ_PERSPECTIVE_TYPE = 1, //Perspective thumbnail type. - IMAQ_MICRO_PLANE_TYPE = 2, //Micro Plane thumbnail type. - IMAQ_CALIBRATION_THUMBNAIL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} CalibrationThumbnailType; - -typedef enum SettingType_enum { - IMAQ_ROTATION_ANGLE_RANGE = 0, //Set a range for this option to specify the angles at which you expect the Function to find template matches in the inspection image. - IMAQ_SCALE_RANGE = 1, //Set a range for this option to specify the sizes at which you expect the Function to find template matches in the inspection image. - IMAQ_OCCLUSION_RANGE = 2, //Set a range for this option to specify the amount of occlusion you expect for a match in the inspection image. - IMAQ_SETTING_TYPE_SIZE_GUARD = 0xFFFFFFFF -} SettingType; - -typedef enum SegmentationDistanceLevel_enum { - IMAQ_SEGMENTATION_LEVEL_CONSERVATIVE = 0, //Uses extensive criteria to determine the Maximum Distance. - IMAQ_SEGMENTATION_LEVEL_AGGRESSIVE = 1, //Uses few criteria to determine the Maximum Distance. - IMAQ_SEGMENTATION_LEVEL_SIZE_GUARD = 0xFFFFFFFF -} SegmentationDistanceLevel; - -typedef enum ExtractContourSelection_enum { - IMAQ_CLOSEST = 0, //Selects the curve closest to the ROI. - IMAQ_LONGEST = 1, //Selects the longest curve. - IMAQ_STRONGEST = 2, //Selects the curve with the highest edge strength averaged from each point on the curve. - IMAQ_EXTRACT_CONTOUR_SELECTION_SIZE_GUARD = 0xFFFFFFFF -} ExtractContourSelection; - -typedef enum FindTransformMode_enum { - IMAQ_FIND_REFERENCE = 0, //Update both parts of the coordinate system. - IMAQ_UPDATE_TRANSFORM = 1, //Update only the new reference system. - IMAQ_FIND_TRANSFORM_MODE_SIZE_GUARD = 0xFFFFFFFF -} FindTransformMode; - -typedef enum ExtractContourDirection_enum { - IMAQ_RECT_LEFT_RIGHT = 0, //Searches the ROI from left to right. - IMAQ_RECT_RIGHT_LEFT = 1, //Searches the ROI from right to left. - IMAQ_RECT_TOP_BOTTOM = 2, //Searches the ROI from top to bottom. - IMAQ_RECT_BOTTOM_TOP = 3, //Searches the ROI from bottom to top. - IMAQ_ANNULUS_INNER_OUTER = 4, //Searches the ROI from the inner radius to the outer radius. - IMAQ_ANNULUS_OUTER_INNER = 5, //Searches the ROI from the outer radius to the inner radius. - IMAQ_ANNULUS_START_STOP = 6, //Searches the ROI from start angle to end angle. - IMAQ_ANNULUS_STOP_START = 7, //Searches the ROI from end angle to start angle. - IMAQ_EXTRACT_CONTOUR_DIRECTION_SIZE_GUARD = 0xFFFFFFFF -} ExtractContourDirection; - -typedef enum EdgePolaritySearchMode_enum { - IMAQ_SEARCH_FOR_ALL_EDGES = 0, //Searches for all edges. - IMAQ_SEARCH_FOR_RISING_EDGES = 1, //Searches for rising edges only. - IMAQ_SEARCH_FOR_FALLING_EDGES = 2, //Searches for falling edges only. - IMAQ_EDGE_POLARITY_MODE_SIZE_GUARD = 0xFFFFFFFF -} EdgePolaritySearchMode; - -typedef enum Connectivity_enum { - IMAQ_FOUR_CONNECTED = 0, //Morphological reconstruction is performed in connectivity mode 4. - IMAQ_EIGHT_CONNECTED = 1, //Morphological reconstruction is performed in connectivity mode 8. - IMAQ_CONNECTIVITY_SIZE_GUARD = 0xFFFFFFFF -} Connectivity; - -typedef enum MorphologyReconstructOperation_enum { - IMAQ_DILATE_RECONSTRUCT = 0, //Performs Reconstruction by dilation. - IMAQ_ERODE_RECONSTRUCT = 1, //Performs Reconstruction by erosion. - IMAQ_MORPHOLOGY_RECONSTRUCT_OPERATION_SIZE_GUARD = 0xFFFFFFFF -} MorphologyReconstructOperation; - -typedef enum WaveletType_enum { - IMAQ_DB02 = 0, - IMAQ_DB03 = 1, - IMAQ_DB04 = 2, //Specifies the Wavelet Type as DB02. - IMAQ_DB05 = 3, - IMAQ_DB06 = 4, - IMAQ_DB07 = 5, - IMAQ_DB08 = 6, - IMAQ_DB09 = 7, - IMAQ_DB10 = 8, - IMAQ_DB11 = 9, - IMAQ_DB12 = 10, - IMAQ_DB13 = 11, - IMAQ_DB14 = 12, - IMAQ_HAAR = 13, - IMAQ_BIOR1_3 = 14, - IMAQ_BIOR1_5 = 15, - IMAQ_BIOR2_2 = 16, - IMAQ_BIOR2_4 = 17, - IMAQ_BIOR2_6 = 18, - IMAQ_BIOR2_8 = 19, - IMAQ_BIOR3_1 = 20, - IMAQ_BIOR3_3 = 21, - IMAQ_BIOR3_5 = 22, - IMAQ_BIOR3_7 = 23, - IMAQ_BIOR3_9 = 24, - IMAQ_BIOR4_4 = 25, - IMAQ_COIF1 = 26, - IMAQ_COIF2 = 27, - IMAQ_COIF3 = 28, - IMAQ_COIF4 = 29, - IMAQ_COIF5 = 30, - IMAQ_SYM2 = 31, - IMAQ_SYM3 = 32, - IMAQ_SYM4 = 33, - IMAQ_SYM5 = 34, - IMAQ_SYM6 = 35, - IMAQ_SYM7 = 36, - IMAQ_SYM8 = 37, - IMAQ_BIOR5_5 = 38, - IMAQ_BIOR6_8 = 39, - IMAQ_WAVE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} WaveletType; - -typedef enum ParticleClassifierThresholdType_enum { - IMAQ_THRESHOLD_MANUAL = 0, //The classifier performs a manual threshold on the image during preprocessing. - IMAQ_THRESHOLD_AUTO = 1, //The classifier performs an auto threshold on the image during preprocessing. - IMAQ_THRESHOLD_LOCAL = 2, //The classifier performs a local threshold on the image during preprocessing. -} ParticleClassifierThresholdType; - -typedef enum MeasureParticlesCalibrationMode_enum { - IMAQ_CALIBRATION_MODE_PIXEL = 0, //The function takes only pixel measurements on the particles in the image. - IMAQ_CALIBRATION_MODE_CALIBRATED = 1, //The function takes only calibrated measurements on the particles in the image. - IMAQ_CALIBRATION_MODE_BOTH = 2, //The function takes both pixel and calibrated measurements on the particles in the image. - IMAQ_MEASURE_PARTICLES_CALIBRATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} MeasureParticlesCalibrationMode; - -typedef enum GeometricMatchingSearchStrategy_enum { - IMAQ_GEOMETRIC_MATCHING_CONSERVATIVE = 0, //Instructs the pattern matching algorithm to use the largest possible amount of information from the image at the expense of slowing down the speed of the algorithm. - IMAQ_GEOMETRIC_MATCHING_BALANCED = 1, //Instructs the pattern matching algorithm to balance the amount of information from the image it uses with the speed of the algorithm. - IMAQ_GEOMETRIC_MATCHING_AGGRESSIVE = 2, //Instructs the pattern matching algorithm to use a lower amount of information from the image, which allows the algorithm to run quickly but at the expense of accuracy. - IMAQ_GEOMETRIC_MATCHING_SEARCH_STRATEGY_SIZE_GUARD = 0xFFFFFFFF -} GeometricMatchingSearchStrategy; - -typedef enum ColorClassificationResolution_enum { - IMAQ_CLASSIFIER_LOW_RESOLUTION = 0, //Low resolution version of the color classifier. - IMAQ_CLASSIFIER_MEDIUM_RESOLUTION = 1, //Medium resolution version of the color classifier. - IMAQ_CLASSIFIER_HIGH_RESOLUTION = 2, //High resolution version of the color classifier. - IMAQ_CLASSIFIER_RESOLUTION_SIZE_GUARD = 0xFFFFFFFF -} ColorClassificationResolution; - -typedef enum ConnectionConstraintType_enum { - IMAQ_DISTANCE_CONSTRAINT = 0, //Specifies the distance, in pixels, within which the end points of two curves must lie in order to be considered part of a contour. - IMAQ_ANGLE_CONSTRAINT = 1, //Specifies the range, in degrees, within which the difference between the angle of two curves, measured at the end points, must lie in order for the two curves to be considered part of a contour. - IMAQ_CONNECTIVITY_CONSTRAINT = 2, //Specifies the distance, in pixels, within which a line extended from the end point of a curve must pass the end point of another curve in order for the two curves to be considered part of a contour. - IMAQ_GRADIENT_CONSTRAINT = 3, //Specifies the range, in degrees, within which the gradient angles of two curves, measured at the end points, must lie in order for the two curves to be considered part of a contour. - IMAQ_NUM_CONNECTION_CONSTRAINT_TYPES = 4, //. - IMAQ_CONNECTION_CONSTRAINT_SIZE_GUARD = 0xFFFFFFFF -} ConnectionConstraintType; - -typedef enum Barcode2DContrast_enum { - IMAQ_ALL_BARCODE_2D_CONTRASTS = 0, //The function searches for barcodes of each contrast type. - IMAQ_BLACK_ON_WHITE_BARCODE_2D = 1, //The function searches for 2D barcodes containing black data on a white background. - IMAQ_WHITE_ON_BLACK_BARCODE_2D = 2, //The function searches for 2D barcodes containing white data on a black background. - IMAQ_BARCODE_2D_CONTRAST_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DContrast; - -typedef enum QRModelType_enum { - IMAQ_QR_MODELTYPE_AUTO_DETECT = 0, //Specifies that the function will auto-detect the type of QR code. - IMAQ_QR_MODELTYPE_MICRO = 1, //Specifies the QR code is of a micro type. - IMAQ_QR_MODELTYPE_MODEL1 = 2, //Specifies the QR code is of a model1 type. - IMAQ_QR_MODELTYPE_MODEL2 = 3, //Specifies the QR code is of a model2 type. - IMAQ_QR_MODEL_TYPE_SIZE_GUARD = 0xFFFFFFFF -} QRModelType; - -typedef enum WindowBackgroundFillStyle_enum { - IMAQ_FILL_STYLE_SOLID = 0, //Fill the display window with a solid color. - IMAQ_FILL_STYLE_HATCH = 2, //Fill the display window with a pattern defined by WindowBackgroundHatchStyle. - IMAQ_FILL_STYLE_DEFAULT = 3, //Fill the display window with the NI Vision default pattern. - IMAQ_FILL_STYLE_SIZE_GUARD = 0xFFFFFFFF -} WindowBackgroundFillStyle; - -typedef enum ExtractionMode_enum { - IMAQ_NORMAL_IMAGE = 0, //Specifies that the function makes no assumptions about the uniformity of objects in the image or the image background. - IMAQ_UNIFORM_REGIONS = 1, //Specifies that the function assumes that either the objects in the image or the image background consists of uniform pixel values. - IMAQ_EXTRACTION_MODE_SIZE_GUARD = 0xFFFFFFFF -} ExtractionMode; - -typedef enum EdgeFilterSize_enum { - IMAQ_FINE = 0, //Specifies that the function uses a fine (narrow) edge filter. - IMAQ_NORMAL = 1, //Specifies that the function uses a normal edge filter. - IMAQ_CONTOUR_TRACING = 2, //Sets the Edge Filter Size to contour tracing, which provides the best results for contour extraction but increases the time required to process the image. - IMAQ_EDGE_FILTER_SIZE_SIZE_GUARD = 0xFFFFFFFF -} EdgeFilterSize; - -typedef enum Barcode2DSearchMode_enum { - IMAQ_SEARCH_MULTIPLE = 0, //The function searches for multiple 2D barcodes. - IMAQ_SEARCH_SINGLE_CONSERVATIVE = 1, //The function searches for 2D barcodes using the same searching algorithm as IMAQ_SEARCH_MULTIPLE but stops searching after locating one valid barcode. - IMAQ_SEARCH_SINGLE_AGGRESSIVE = 2, //The function searches for a single 2D barcode using a method that assumes the barcode occupies a majority of the search region. - IMAQ_BARCODE_2D_SEARCH_MODE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DSearchMode; - -typedef enum DataMatrixSubtype_enum { - IMAQ_ALL_DATA_MATRIX_SUBTYPES = 0, //The function searches for Data Matrix barcodes of all subtypes. - IMAQ_DATA_MATRIX_SUBTYPES_ECC_000_ECC_140 = 1, //The function searches for Data Matrix barcodes of subtypes ECC 000, ECC 050, ECC 080, ECC 100 and ECC 140. - IMAQ_DATA_MATRIX_SUBTYPE_ECC_200 = 2, //The function searches for Data Matrix ECC 200 barcodes. - IMAQ_DATA_MATRIX_SUBTYPE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixSubtype; - -typedef enum FeatureType_enum { - IMAQ_NOT_FOUND_FEATURE = 0, //Specifies the feature is not found. - IMAQ_CIRCLE_FEATURE = 1, //Specifies the feature is a circle. - IMAQ_ELLIPSE_FEATURE = 2, //Specifies the feature is an ellipse. - IMAQ_CONST_CURVE_FEATURE = 3, //Specifies the features is a constant curve. - IMAQ_RECTANGLE_FEATURE = 4, //Specifies the feature is a rectangle. - IMAQ_LEG_FEATURE = 5, //Specifies the feature is a leg. - IMAQ_CORNER_FEATURE = 6, //Specifies the feature is a corner. - IMAQ_PARALLEL_LINE_PAIR_FEATURE = 7, //Specifies the feature is a parallel line pair. - IMAQ_PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE = 8, //Specifies the feature is a pair of parallel line pairs. - IMAQ_LINE_FEATURE = 9, //Specifies the feature is a line. - IMAQ_CLOSED_CURVE_FEATURE = 10, //Specifies the feature is a closed curve. - IMAQ_FEATURE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} FeatureType; - -typedef enum Barcode2DCellShape_enum { - IMAQ_SQUARE_CELLS = 0, //The function uses an algorithm for decoding the 2D barcode that works with square data cells. - IMAQ_ROUND_CELLS = 1, //The function uses an algorithm for decoding the 2D barcode that works with round data cells. - IMAQ_BARCODE_2D_CELL_SHAPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DCellShape; - -typedef enum LocalThresholdMethod_enum { - IMAQ_NIBLACK = 0, //The function computes thresholds for each pixel based on its local statistics using the Niblack local thresholding algorithm. - IMAQ_BACKGROUND_CORRECTION = 1, //The function performs background correction first to eliminate non-uniform lighting effects, then performs thresholding using the Otsu thresholding algorithm. - IMAQ_LOCAL_THRESHOLD_METHOD_SIZE_GUARD = 0xFFFFFFFF -} LocalThresholdMethod; - -typedef enum Barcode2DType_enum { - IMAQ_PDF417 = 0, //The 2D barcode is of type PDF417. - IMAQ_DATA_MATRIX_ECC_000 = 1, //The 2D barcode is of type Data Matrix ECC 000. - IMAQ_DATA_MATRIX_ECC_050 = 2, //The 2D barcode is of type Data Matrix ECC 050. - IMAQ_DATA_MATRIX_ECC_080 = 3, //The 2D barcode is of type Data Matrix ECC 080. - IMAQ_DATA_MATRIX_ECC_100 = 4, //The 2D barcode is of type Data Matrix ECC 100. - IMAQ_DATA_MATRIX_ECC_140 = 5, //The 2D barcode is of type Data Matrix ECC 140. - IMAQ_DATA_MATRIX_ECC_200 = 6, //The 2D barcode is of type Data Matrix ECC 200. - IMAQ_BARCODE_2D_TYPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DType; - -typedef enum ClassifierEngineType_enum { - IMAQ_ENGINE_NONE = 0, //No engine has been set on this classifier session. - IMAQ_ENGINE_NEAREST_NEIGHBOR = 1, //Nearest neighbor engine. - IMAQ_ENGINE_SUPPORT_VECTOR_MACHINE = 2, - IMAQ_CLASSIFIER_ENGINE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ClassifierEngineType; - -typedef enum ClassifierType_enum { - IMAQ_CLASSIFIER_CUSTOM = 0, //The classifier session classifies vectors of doubles. - IMAQ_CLASSIFIER_PARTICLE = 1, //The classifier session classifies particles in binary images. - IMAQ_CLASSIFIER_COLOR = 2, //The classifier session classifies an image based on its color. - IMAQ_CLASSIFIER_TEXTURE = 3, //The classifier session classifies an image based on its texture. - IMAQ_CLASSIFIER_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ClassifierType; - -typedef enum ParticleType_enum { - IMAQ_PARTICLE_BRIGHT = 0, //Bright particles. - IMAQ_PARTICLE_DARK = 1, //Dark particles. - IMAQ_PARTICLE_TYPE_SIZE_GUARD = 0xFFFFFFFF -} ParticleType; - -typedef enum VisionInfoType2_enum { - IMAQ_VISIONINFO_CALIBRATION = 0x01, //Used to indicate interaction with the Calibration information in an image. - IMAQ_VISIONINFO_OVERLAY = 0x02, //Used to indicate interaction with the Overlay information in an image. - IMAQ_VISIONINFO_GRAYTEMPLATE = 0x04, //Used to indicate interaction with the grayscale template information in an image. - IMAQ_VISIONINFO_COLORTEMPLATE = 0x08, //Used to indicate interaction with the color template information in an image. - IMAQ_VISIONINFO_GEOMETRICTEMPLATE = 0x10, //Used to indicate interaction with the geometric template information in an image. - IMAQ_VISIONINFO_CUSTOMDATA = 0x20, //Used to indicate interaction with the binary or text Custom Data in an image. - IMAQ_VISIONINFO_GOLDENTEMPLATE = 0x40, //Used to indicate interaction with the golden template information in an image. - IMAQ_VISIONINFO_GEOMETRICTEMPLATE2 = 0x80, //Used to indicate interaction with the geometric template 2 information in an image. - IMAQ_VISIONINFO_ALL = 0xFFFFFFFF, //Removes, checks for, or indicates the presence of all types of extra information in an image. -} VisionInfoType2; - -typedef enum ReadClassifierFileMode_enum { - IMAQ_CLASSIFIER_READ_ALL = 0, //Read all information from the classifier file. - IMAQ_CLASSIFIER_READ_SAMPLES = 1, //Read only the samples from the classifier file. - IMAQ_CLASSIFIER_READ_PROPERTIES = 2, //Read only the properties from the classifier file. - IMAQ_READ_CLASSIFIER_FILE_MODES_SIZE_GUARD = 0xFFFFFFFF -} ReadClassifierFileMode; - -typedef enum WriteClassifierFileMode_enum { - IMAQ_CLASSIFIER_WRITE_ALL = 0, //Writes all information to the classifier file. - IMAQ_CLASSIFIER_WRITE_CLASSIFY_ONLY = 1, //Write only the information needed to classify to the classifier file. - IMAQ_WRITE_CLASSIFIER_FILE_MODES_SIZE_GUARD = 0xFFFFFFFF -} WriteClassifierFileMode; - -typedef enum Barcode2DShape_enum { - IMAQ_SQUARE_BARCODE_2D = 0, //The function searches for square 2D barcodes. - IMAQ_RECTANGULAR_BARCODE_2D = 1, //The function searches for rectangular 2D barcodes. - IMAQ_BARCODE_2D_SHAPE_SIZE_GUARD = 0xFFFFFFFF -} Barcode2DShape; - -typedef enum DataMatrixRotationMode_enum { - IMAQ_UNLIMITED_ROTATION = 0, //The function allows for unlimited rotation. - IMAQ_0_DEGREES = 1, //The function allows for between -5 and 5 degrees of rotation. - IMAQ_90_DEGREES = 2, //The function allows for between 85 and 95 degrees of rotation. - IMAQ_180_DEGREES = 3, //The function allows for between 175 and 185 degrees of rotation. - IMAQ_270_DEGREES = 4, //The function allows for between 265 and 275 degrees of rotation. - IMAQ_DATA_MATRIX_ROTATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixRotationMode; - -typedef enum AIMGrade_enum { - IMAQ_AIM_GRADE_F = 0, //The Data Matrix barcode received a grade of F. - IMAQ_AIM_GRADE_D = 1, //The Data Matrix barcode received a grade of D. - IMAQ_AIM_GRADE_C = 2, //The Data Matrix barcode received a grade of C. - IMAQ_AIM_GRADE_B = 3, //The Data Matrix barcode received a grade of B. - IMAQ_AIM_GRADE_A = 4, //The Data Matrix barcode received a grade of A. - IMAQ_DATA_MATRIX_AIM_GRADE_SIZE_GUARD = 0xFFFFFFFF -} AIMGrade; - -typedef enum DataMatrixCellFillMode_enum { - IMAQ_AUTO_DETECT_CELL_FILL_MODE = -2, //Sets the function to determine the Data Matrix barcode cell fill percentage automatically. - IMAQ_LOW_FILL = 0, //Sets the function to read Data Matrix barcodes with a cell fill percentage of less than 30 percent. - IMAQ_NORMAL_FILL = 1, //Sets the function to read Data Matrix barcodes with a cell fill percentage greater than or equal to 30 percent. - IMAQ_DATA_MATRIX_CELL_FILL_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellFillMode; - -typedef enum DataMatrixDemodulationMode_enum { - IMAQ_AUTO_DETECT_DEMODULATION_MODE = -2, //The function will try each demodulation mode and use the one which decodes the Data Matrix barcode within the fewest iterations and utilizing the least amount of error correction. - IMAQ_HISTOGRAM = 0, //The function uses a histogram of all of the Data Matrix cells to calculate a threshold. - IMAQ_LOCAL_CONTRAST = 1, //The function examines each of the cell's neighbors to determine if the cell is on or off. - IMAQ_COMBINED = 2, //The function uses the histogram of the Data Matrix barcode to calculate a threshold. - IMAQ_ALL_DEMODULATION_MODES = 3, //The function tries IMAQ_HISTOGRAM, then IMAQ_LOCAL_CONTRAST and then IMAQ_COMBINATION, stopping once one mode is successful. - IMAQ_DATA_MATRIX_DEMODULATION_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixDemodulationMode; - -typedef enum DataMatrixECC_enum { - IMAQ_AUTO_DETECT_ECC = -2, //Sets the function to determine the Data Matrix barcode ECC automatically. - IMAQ_ECC_000 = 0, //Sets the function to read Data Matrix barcodes of ECC 000 only. - IMAQ_ECC_050 = 50, //Sets the function to read Data Matrix barcodes of ECC 050 only. - IMAQ_ECC_080 = 80, //Sets the function to read Data Matrix barcodes of ECC 080 only. - IMAQ_ECC_100 = 100, //Sets the function to read Data Matrix barcodes of ECC 100 only. - IMAQ_ECC_140 = 140, //Sets the function to read Data Matrix barcodes of ECC 140 only. - IMAQ_ECC_000_140 = 190, //Sets the function to read Data Matrix barcodes of ECC 000, ECC 050, ECC 080, ECC 100, and ECC 140 only. - IMAQ_ECC_200 = 200, //Sets the function to read Data Matrix barcodes of ECC 200 only. - IMAQ_DATA_MATRIX_ECC_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixECC; - -typedef enum DataMatrixPolarity_enum { - IMAQ_AUTO_DETECT_POLARITY = -2, //Sets the function to determine the Data Matrix barcode polarity automatically. - IMAQ_BLACK_DATA_ON_WHITE_BACKGROUND = 0, //Sets the function to read Data Matrix barcodes with dark data on a bright background. - IMAQ_WHITE_DATA_ON_BLACK_BACKGROUND = 1, //Sets the function to read Data Matrix barcodes with bright data on a dark background. - IMAQ_DATA_MATRIX_POLARITY_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixPolarity; - -typedef enum DataMatrixCellFilterMode_enum { - IMAQ_AUTO_DETECT_CELL_FILTER_MODE = -2, //The function will try all filter modes and uses the one that decodes the Data Matrix barcode within the fewest iterations and utilizing the least amount of error correction. - IMAQ_AVERAGE_FILTER = 0, //The function sets the pixel value for the cell to the average of the sampled pixels. - IMAQ_MEDIAN_FILTER = 1, //The function sets the pixel value for the cell to the median of the sampled pixels. - IMAQ_CENTRAL_AVERAGE_FILTER = 2, //The function sets the pixel value for the cell to the average of the pixels in the center of the cell sample. - IMAQ_HIGH_AVERAGE_FILTER = 3, //The function sets the pixel value for the cell to the average value of the half of the sampled pixels with the highest pixel values. - IMAQ_LOW_AVERAGE_FILTER = 4, //The function sets the pixel value for the cell to the average value of the half of the sampled pixels with the lowest pixel values. - IMAQ_VERY_HIGH_AVERAGE_FILTER = 5, //The function sets the pixel value for the cell to the average value of the ninth of the sampled pixels with the highest pixel values. - IMAQ_VERY_LOW_AVERAGE_FILTER = 6, //The function sets the pixel value for the cell to the average value of the ninth of the sampled pixels with the lowest pixel values. - IMAQ_ALL_CELL_FILTERS = 8, //The function tries each filter mode, starting with IMAQ_AVERAGE_FILTER and ending with IMAQ_VERY_LOW_AVERAGE_FILTER, stopping once a filter mode decodes correctly. - IMAQ_DATA_MATRIX_CELL_FILTER_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellFilterMode; - -typedef enum WindowBackgroundHatchStyle_enum { - IMAQ_HATCH_STYLE_HORIZONTAL = 0, //The background of the display window will be horizontal bars. - IMAQ_HATCH_STYLE_VERTICAL = 1, //The background of the display window will be vertical bars. - IMAQ_HATCH_STYLE_FORWARD_DIAGONAL = 2, //The background of the display window will be diagonal bars. - IMAQ_HATCH_STYLE_BACKWARD_DIAGONAL = 3, //The background of the display window will be diagonal bars. - IMAQ_HATCH_STYLE_CROSS = 4, //The background of the display window will be intersecting horizontal and vertical bars. - IMAQ_HATCH_STYLE_CROSS_HATCH = 5, //The background of the display window will be intersecting forward and backward diagonal bars. - IMAQ_HATCH_STYLE_SIZE_GUARD = 0xFFFFFFFF -} WindowBackgroundHatchStyle; - -typedef enum DataMatrixMirrorMode_enum { - IMAQ_AUTO_DETECT_MIRROR = -2, //Specifies that the function should determine if the Data Matrix barcode is mirrored. - IMAQ_APPEARS_NORMAL = 0, //Specifies that the function should expect the Data Matrix barcode to appear normal. - IMAQ_APPEARS_MIRRORED = 1, //Specifies that the function should expect the Data Matrix barcode to appear mirrored. - IMAQ_DATA_MATRIX_MIRROR_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixMirrorMode; - -typedef enum CalibrationMode2_enum { - IMAQ_PERSPECTIVE_MODE = 0, //Functions correct for distortion caused by the camera's perspective. - IMAQ_MICROPLANE_MODE = 1, //Functions correct for distortion caused by the camera's lens. - IMAQ_SIMPLE_CALIBRATION_MODE = 2, //Functions do not correct for distortion. - IMAQ_CORRECTED_IMAGE_MODE = 3, //The image is already corrected. - IMAQ_NO_CALIBRATION_MODE = 4, //Image with No calibration. - IMAQ_CALIBRATION_MODE2_SIZE_GUARD = 0xFFFFFFFF -} CalibrationMode2; - -typedef enum DataMatrixGradingMode_enum { - IMAQ_NO_GRADING = 0, //The function does not make any preparatory calculations. - IMAQ_PREPARE_FOR_AIM = 1, //The function prepares the image for grading using the AIM Print Quality metrics. - IMAQ_DATA_MATRIX_GRADING_MODE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixGradingMode; - -typedef enum WaveletTransformMode_enum { - IMAQ_WAVELET_TRANSFORM_INTEGER = 0, //Uses a 5-3 reversible integer transform. - IMAQ_WAVELET_TRANSFORM_FLOATING_POINT = 1, //Performs a 9-7 irreversible floating-point transform. - IMAQ_WAVELET_TRANSFORM_MODE_SIZE_GUARD = 0xFFFFFFFF -} WaveletTransformMode; - -typedef enum NormalizationMethod_enum { - IMAQ_NORMALIZATION_NONE = 0, //No normalization. - IMAQ_NORMALIZATION_HISTOGRAM_MATCHING = 1, //Adjust image so its histogram is similar to the golden template's histogram. - IMAQ_NORMALIZATION_AVERAGE_MATCHING = 2, //Adjust image so its mean pixel value equals the golden template's mean pixel value. - IMAQ_NORMALIZATION_SIZE_GUARD = 0xFFFFFFFF -} NormalizationMethod; - -typedef enum RegistrationMethod_enum { - IMAQ_REGISTRATION_NONE = 0, //No registration. - IMAQ_REGISTRATION_PERSPECTIVE = 1, //Adjust image to correct for minor variations in alignment or perspective. - IMAQ_REGISTRATION_SIZE_GUARD = 0xFFFFFFFF -} RegistrationMethod; - -typedef enum LinearAveragesMode_enum { - IMAQ_COLUMN_AVERAGES = 1, //Specifies that the function calculates the mean pixel value of each column. - IMAQ_ROW_AVERAGES = 2, //Specifies that the function calculates the mean pixel value of each row. - IMAQ_RISING_DIAGONAL_AVERAGES = 4, //Specifies that the function calculates the mean pixel value of each diagonal running from the lower left to the upper right of the inspected area of the image. - IMAQ_FALLING_DIAGONAL_AVERAGES = 8, //Specifies that the function calculates the mean pixel value of each diagonal running from the upper left to the lower right of the inspected area of the image. - IMAQ_ALL_LINEAR_AVERAGES = 15, //Specifies that the function calculates all four linear mean pixel values. - IMAQ_LINEAR_AVERAGES_MODE_SIZE_GUARD = 0xFFFFFFFF -} LinearAveragesMode; - -typedef enum CompressionType_enum { - IMAQ_COMPRESSION_NONE = 0, //Specifies that the function should not compress the image. - IMAQ_COMPRESSION_JPEG = 1, //Specifies that the function should use lossy JPEG compression on the image. - IMAQ_COMPRESSION_PACKED_BINARY = 2, //Specifies that the function should use lossless binary packing on the image. - IMAQ_COMPRESSION_TYPE_SIZE_GUARD = 0xFFFFFFFF -} CompressionType; - -typedef enum FlattenType_enum { - IMAQ_FLATTEN_IMAGE = 0, //Flattens just the image data. - IMAQ_FLATTEN_IMAGE_AND_VISION_INFO = 1, //Flattens the image data and any Vision information associated with the image. - IMAQ_FLATTEN_TYPE_SIZE_GUARD = 0xFFFFFFFF -} FlattenType; - -typedef enum DataMatrixCellSampleSize_enum { - IMAQ_AUTO_DETECT_CELL_SAMPLE_SIZE = -2, //The function will try each sample size and use the one which decodes the Data Matrix barcode within the fewest iterations and utilizing the least amount of error correction. - IMAQ_1x1 = 1, //The function will use a 1x1 sized sample from each cell. - IMAQ_2x2 = 2, //The function will use a 2x2 sized sample from each cell. - IMAQ_3x3 = 3, //The function will use a 3x3 sized sample from each cell. - IMAQ_4x4 = 4, //The function will use a 4x4 sized sample from each cell. - IMAQ_5x5 = 5, //The function will use a 5x5 sized sample from each cell. - IMAQ_6x6 = 6, //The function will use a 6x6 sized sample from each cell. - IMAQ_7x7 = 7, //The function will use a 7x7 sized sample from each cell. - IMAQ_DATA_MATRIX_CELL_SAMPLE_SIZE_SIZE_GUARD = 0xFFFFFFFF -} DataMatrixCellSampleSize; - - -//============================================================================ -// Forward Declare Data Structures -//============================================================================ -typedef struct Image_struct Image; -typedef struct ROI_struct ROI; -typedef struct Overlay_struct Overlay; -typedef struct ClassifierSession_struct ClassifierSession; -typedef struct MultipleGeometricPattern_struct MultipleGeometricPattern; -typedef int ContourID; -typedef unsigned long SESSION_ID; -typedef int AVISession; -typedef char* FilterName; -typedef char String255[256]; -typedef struct CharSet_struct CharSet; -typedef struct OCRSpacingOptions_struct OCRSpacingOptions; -typedef struct OCRProcessingOptions_struct OCRProcessingOptions; -typedef struct ReadTextOptions_struct ReadTextOptions; -typedef struct CharInfo_struct CharInfo; -typedef struct CharReport_struct CharReport; -typedef struct ReadTextReport_struct ReadTextReport; -typedef struct DivisionModel_struct DivisionModel; -typedef struct FocalLength_struct FocalLength; -typedef struct PolyModel_struct PolyModel; -typedef struct DistortionModelParams_struct DistortionModelParams; -typedef struct PointFloat_struct PointFloat; -typedef struct InternalParameters_struct InternalParameters; -typedef struct MaxGridSize_struct MaxGridSize; -typedef struct ImageSize_struct ImageSize; -typedef struct CalibrationReferencePoints_struct CalibrationReferencePoints; -typedef struct GetCameraParametersReport_struct GetCameraParametersReport; -typedef struct CalibrationAxisInfo_struct CalibrationAxisInfo; -typedef struct CalibrationLearnSetupInfo_struct CalibrationLearnSetupInfo; -typedef struct GridDescriptor_struct GridDescriptor; -typedef struct ErrorStatistics_struct ErrorStatistics; -typedef struct GetCalibrationInfoReport_struct GetCalibrationInfoReport; -typedef struct EdgePolarity_struct EdgePolarity; -typedef struct ClampSettings_struct ClampSettings; -typedef struct PointDouble_struct PointDouble; -typedef struct PointDoublePair_struct PointDoublePair; -typedef struct ClampResults_struct ClampResults; -typedef struct ClampPoints_struct ClampPoints; -typedef struct RGBValue_struct RGBValue; -typedef struct ClampOverlaySettings_struct ClampOverlaySettings; -typedef struct ClampMax2Report_struct ClampMax2Report; -typedef struct ContourFitSplineReport_struct ContourFitSplineReport; -typedef struct LineFloat_struct LineFloat; -typedef struct LineEquation_struct LineEquation; -typedef struct ContourFitLineReport_struct ContourFitLineReport; -typedef struct ContourFitPolynomialReport_struct ContourFitPolynomialReport; -typedef struct PartialCircle_struct PartialCircle; -typedef struct PartialEllipse_struct PartialEllipse; -typedef struct SetupMatchPatternData_struct SetupMatchPatternData; -typedef struct RangeSettingDouble_struct RangeSettingDouble; -typedef struct GeometricAdvancedSetupDataOption_struct GeometricAdvancedSetupDataOption; -typedef struct ContourInfoReport_struct ContourInfoReport; -typedef struct ROILabel_struct ROILabel; -typedef struct SupervisedColorSegmentationReport_struct SupervisedColorSegmentationReport; -typedef struct LabelToROIReport_struct LabelToROIReport; -typedef struct ColorSegmenationOptions_struct ColorSegmenationOptions; -typedef struct ClassifiedCurve_struct ClassifiedCurve; -typedef struct RangeDouble_struct RangeDouble; -typedef struct RangeLabel_struct RangeLabel; -typedef struct CurvatureAnalysisReport_struct CurvatureAnalysisReport; -typedef struct Disparity_struct Disparity; -typedef struct ComputeDistancesReport_struct ComputeDistancesReport; -typedef struct MatchMode_struct MatchMode; -typedef struct ClassifiedDisparity_struct ClassifiedDisparity; -typedef struct ClassifyDistancesReport_struct ClassifyDistancesReport; -typedef struct ContourComputeCurvatureReport_struct ContourComputeCurvatureReport; -typedef struct ContourOverlaySettings_struct ContourOverlaySettings; -typedef struct CurveParameters_struct CurveParameters; -typedef struct ExtractContourReport_struct ExtractContourReport; -typedef struct ConnectionConstraint_struct ConnectionConstraint; -typedef struct ExtractTextureFeaturesReport_struct ExtractTextureFeaturesReport; -typedef struct WaveletBandsReport_struct WaveletBandsReport; -typedef struct CircleFitOptions_struct CircleFitOptions; -typedef struct EdgeOptions2_struct EdgeOptions2; -typedef struct FindCircularEdgeOptions_struct FindCircularEdgeOptions; -typedef struct FindConcentricEdgeOptions_struct FindConcentricEdgeOptions; -typedef struct ConcentricEdgeFitOptions_struct ConcentricEdgeFitOptions; -typedef struct FindConcentricEdgeReport_struct FindConcentricEdgeReport; -typedef struct FindCircularEdgeReport_struct FindCircularEdgeReport; -typedef struct WindowSize_struct WindowSize; -typedef struct DisplacementVector_struct DisplacementVector; -typedef struct WaveletOptions_struct WaveletOptions; -typedef struct CooccurrenceOptions_struct CooccurrenceOptions; -typedef struct ParticleClassifierLocalThresholdOptions_struct ParticleClassifierLocalThresholdOptions; -typedef struct RangeFloat_struct RangeFloat; -typedef struct ParticleClassifierAutoThresholdOptions_struct ParticleClassifierAutoThresholdOptions; -typedef struct ParticleClassifierPreprocessingOptions2_struct ParticleClassifierPreprocessingOptions2; -typedef struct MeasureParticlesReport_struct MeasureParticlesReport; -typedef struct GeometricPatternMatch3_struct GeometricPatternMatch3; -typedef struct MatchGeometricPatternAdvancedOptions3_struct MatchGeometricPatternAdvancedOptions3; -typedef struct ColorOptions_struct ColorOptions; -typedef struct SampleScore_struct SampleScore; -typedef struct ClassifierReportAdvanced_struct ClassifierReportAdvanced; -typedef struct LearnGeometricPatternAdvancedOptions2_struct LearnGeometricPatternAdvancedOptions2; -typedef struct ParticleFilterOptions2_struct ParticleFilterOptions2; -typedef struct FindEdgeOptions2_struct FindEdgeOptions2; -typedef struct FindEdgeReport_struct FindEdgeReport; -typedef struct FindTransformRectOptions2_struct FindTransformRectOptions2; -typedef struct FindTransformRectsOptions2_struct FindTransformRectsOptions2; -typedef struct ReadTextReport3_struct ReadTextReport3; -typedef struct CharacterStatistics_struct CharacterStatistics; -typedef struct CharReport3_struct CharReport3; -typedef struct ArcInfo2_struct ArcInfo2; -typedef struct EdgeReport2_struct EdgeReport2; -typedef struct SearchArcInfo_struct SearchArcInfo; -typedef struct ConcentricRakeReport2_struct ConcentricRakeReport2; -typedef struct SpokeReport2_struct SpokeReport2; -typedef struct EdgeInfo_struct EdgeInfo; -typedef struct SearchLineInfo_struct SearchLineInfo; -typedef struct RakeReport2_struct RakeReport2; -typedef struct TransformBehaviors_struct TransformBehaviors; -typedef struct QRCodeDataToken_struct QRCodeDataToken; -typedef struct ParticleFilterOptions_struct ParticleFilterOptions; -typedef struct StraightEdgeReport2_struct StraightEdgeReport2; -typedef struct StraightEdgeOptions_struct StraightEdgeOptions; -typedef struct StraightEdge_struct StraightEdge; -typedef struct QRCodeSearchOptions_struct QRCodeSearchOptions; -typedef struct QRCodeSizeOptions_struct QRCodeSizeOptions; -typedef struct QRCodeDescriptionOptions_struct QRCodeDescriptionOptions; -typedef struct QRCodeReport_struct QRCodeReport; -typedef struct AIMGradeReport_struct AIMGradeReport; -typedef struct DataMatrixSizeOptions_struct DataMatrixSizeOptions; -typedef struct DataMatrixDescriptionOptions_struct DataMatrixDescriptionOptions; -typedef struct DataMatrixSearchOptions_struct DataMatrixSearchOptions; -typedef struct DataMatrixReport_struct DataMatrixReport; -typedef struct JPEG2000FileAdvancedOptions_struct JPEG2000FileAdvancedOptions; -typedef struct MatchGeometricPatternAdvancedOptions2_struct MatchGeometricPatternAdvancedOptions2; -typedef struct InspectionAlignment_struct InspectionAlignment; -typedef struct InspectionOptions_struct InspectionOptions; -typedef struct CharReport2_struct CharReport2; -typedef struct CharInfo2_struct CharInfo2; -typedef struct ReadTextReport2_struct ReadTextReport2; -typedef struct EllipseFeature_struct EllipseFeature; -typedef struct CircleFeature_struct CircleFeature; -typedef struct ConstCurveFeature_struct ConstCurveFeature; -typedef struct RectangleFeature_struct RectangleFeature; -typedef struct LegFeature_struct LegFeature; -typedef struct CornerFeature_struct CornerFeature; -typedef struct LineFeature_struct LineFeature; -typedef struct ParallelLinePairFeature_struct ParallelLinePairFeature; -typedef struct PairOfParallelLinePairsFeature_struct PairOfParallelLinePairsFeature; -typedef union GeometricFeature_union GeometricFeature; -typedef struct FeatureData_struct FeatureData; -typedef struct GeometricPatternMatch2_struct GeometricPatternMatch2; -typedef struct ClosedCurveFeature_struct ClosedCurveFeature; -typedef struct LineMatch_struct LineMatch; -typedef struct LineDescriptor_struct LineDescriptor; -typedef struct RectangleDescriptor_struct RectangleDescriptor; -typedef struct RectangleMatch_struct RectangleMatch; -typedef struct EllipseDescriptor_struct EllipseDescriptor; -typedef struct EllipseMatch_struct EllipseMatch; -typedef struct CircleMatch_struct CircleMatch; -typedef struct CircleDescriptor_struct CircleDescriptor; -typedef struct ShapeDetectionOptions_struct ShapeDetectionOptions; -typedef struct Curve_struct Curve; -typedef struct CurveOptions_struct CurveOptions; -typedef struct Barcode2DInfo_struct Barcode2DInfo; -typedef struct DataMatrixOptions_struct DataMatrixOptions; -typedef struct ClassifierAccuracyReport_struct ClassifierAccuracyReport; -typedef struct NearestNeighborClassResult_struct NearestNeighborClassResult; -typedef struct NearestNeighborTrainingReport_struct NearestNeighborTrainingReport; -typedef struct ParticleClassifierPreprocessingOptions_struct ParticleClassifierPreprocessingOptions; -typedef struct ClassifierSampleInfo_struct ClassifierSampleInfo; -typedef struct ClassScore_struct ClassScore; -typedef struct ClassifierReport_struct ClassifierReport; -typedef struct NearestNeighborOptions_struct NearestNeighborOptions; -typedef struct ParticleClassifierOptions_struct ParticleClassifierOptions; -typedef struct RGBU64Value_struct RGBU64Value; -typedef struct GeometricPatternMatch_struct GeometricPatternMatch; -typedef struct MatchGeometricPatternAdvancedOptions_struct MatchGeometricPatternAdvancedOptions; -typedef struct MatchGeometricPatternOptions_struct MatchGeometricPatternOptions; -typedef struct LearnGeometricPatternAdvancedOptions_struct LearnGeometricPatternAdvancedOptions; -typedef struct FitEllipseOptions_struct FitEllipseOptions; -typedef struct FitCircleOptions_struct FitCircleOptions; -typedef struct ConstructROIOptions2_struct ConstructROIOptions2; -typedef struct HSLValue_struct HSLValue; -typedef struct HSVValue_struct HSVValue; -typedef struct HSIValue_struct HSIValue; -typedef struct CIELabValue_struct CIELabValue; -typedef struct CIEXYZValue_struct CIEXYZValue; -typedef union Color2_union Color2; -typedef struct BestEllipse2_struct BestEllipse2; -typedef struct LearnPatternAdvancedOptions_struct LearnPatternAdvancedOptions; -typedef struct AVIInfo_struct AVIInfo; -typedef struct LearnPatternAdvancedShiftOptions_struct LearnPatternAdvancedShiftOptions; -typedef struct LearnPatternAdvancedRotationOptions_struct LearnPatternAdvancedRotationOptions; -typedef struct MatchPatternAdvancedOptions_struct MatchPatternAdvancedOptions; -typedef struct ParticleFilterCriteria2_struct ParticleFilterCriteria2; -typedef struct BestCircle2_struct BestCircle2; -typedef struct OCRSpacingOptions_struct OCRSpacingOptions; -typedef struct OCRProcessingOptions_struct OCRProcessingOptions; -typedef struct ReadTextOptions_struct ReadTextOptions; -typedef struct CharInfo_struct CharInfo; -#if !defined(USERINT_HEADER) && !defined(_CVI_RECT_DEFINED) -typedef struct Rect_struct Rect; -#endif -typedef struct CharReport_struct CharReport; -typedef struct ReadTextReport_struct ReadTextReport; -#if !defined(USERINT_HEADER) && !defined(_CVI_POINT_DEFINED) -typedef struct Point_struct Point; -#endif -typedef struct Annulus_struct Annulus; -typedef struct EdgeLocationReport_struct EdgeLocationReport; -typedef struct EdgeOptions_struct EdgeOptions; -typedef struct EdgeReport_struct EdgeReport; -typedef struct ExtremeReport_struct ExtremeReport; -typedef struct FitLineOptions_struct FitLineOptions; -typedef struct DisplayMapping_struct DisplayMapping; -typedef struct DetectExtremesOptions_struct DetectExtremesOptions; -typedef struct ImageInfo_struct ImageInfo; -typedef struct LCDOptions_struct LCDOptions; -typedef struct LCDReport_struct LCDReport; -typedef struct LCDSegments_struct LCDSegments; -typedef struct LearnCalibrationOptions_struct LearnCalibrationOptions; -typedef struct LearnColorPatternOptions_struct LearnColorPatternOptions; -typedef struct Line_struct Line; -typedef struct LinearAverages_struct LinearAverages; -typedef struct LineProfile_struct LineProfile; -typedef struct MatchColorPatternOptions_struct MatchColorPatternOptions; -typedef struct HistogramReport_struct HistogramReport; -typedef struct ArcInfo_struct ArcInfo; -typedef struct AxisReport_struct AxisReport; -typedef struct BarcodeInfo_struct BarcodeInfo; -typedef struct BCGOptions_struct BCGOptions; -typedef struct BestCircle_struct BestCircle; -typedef struct BestEllipse_struct BestEllipse; -typedef struct BestLine_struct BestLine; -typedef struct BrowserOptions_struct BrowserOptions; -typedef struct CoordinateSystem_struct CoordinateSystem; -typedef struct CalibrationInfo_struct CalibrationInfo; -typedef struct CalibrationPoints_struct CalibrationPoints; -typedef struct CaliperOptions_struct CaliperOptions; -typedef struct CaliperReport_struct CaliperReport; -typedef struct DrawTextOptions_struct DrawTextOptions; -typedef struct CircleReport_struct CircleReport; -typedef struct ClosedContour_struct ClosedContour; -typedef struct ColorHistogramReport_struct ColorHistogramReport; -typedef struct ColorInformation_struct ColorInformation; -typedef struct Complex_struct Complex; -typedef struct ConcentricRakeReport_struct ConcentricRakeReport; -typedef struct ConstructROIOptions_struct ConstructROIOptions; -typedef struct ContourInfo_struct ContourInfo; -typedef union ContourUnion_union ContourUnion; -typedef struct ContourInfo2_struct ContourInfo2; -typedef struct ContourPoint_struct ContourPoint; -typedef struct CoordinateTransform_struct CoordinateTransform; -typedef struct CoordinateTransform2_struct CoordinateTransform2; -typedef struct CannyOptions_struct CannyOptions; -typedef struct Range_struct Range; -typedef struct UserPointSymbol_struct UserPointSymbol; -typedef struct View3DOptions_struct View3DOptions; -typedef struct MatchPatternOptions_struct MatchPatternOptions; -typedef struct TIFFFileOptions_struct TIFFFileOptions; -typedef union Color_union Color; -typedef union PixelValue_union PixelValue; -typedef struct OpenContour_struct OpenContour; -typedef struct OverlayTextOptions_struct OverlayTextOptions; -typedef struct ParticleFilterCriteria_struct ParticleFilterCriteria; -typedef struct ParticleReport_struct ParticleReport; -typedef struct PatternMatch_struct PatternMatch; -typedef struct QuantifyData_struct QuantifyData; -typedef struct QuantifyReport_struct QuantifyReport; -typedef struct RakeOptions_struct RakeOptions; -typedef struct RakeReport_struct RakeReport; -typedef struct TransformReport_struct TransformReport; -typedef struct ShapeReport_struct ShapeReport; -typedef struct MeterArc_struct MeterArc; -typedef struct ThresholdData_struct ThresholdData; -typedef struct StructuringElement_struct StructuringElement; -typedef struct SpokeReport_struct SpokeReport; -typedef struct SimpleEdgeOptions_struct SimpleEdgeOptions; -typedef struct SelectParticleCriteria_struct SelectParticleCriteria; -typedef struct SegmentInfo_struct SegmentInfo; -typedef struct RotationAngleRange_struct RotationAngleRange; -typedef struct RotatedRect_struct RotatedRect; -typedef struct ROIProfile_struct ROIProfile; -typedef struct ToolWindowOptions_struct ToolWindowOptions; -typedef struct SpokeOptions_struct SpokeOptions; - -//============================================================================ -// Data Structures -//============================================================================ -#if !defined __GNUC__ && !defined _M_X64 -#pragma pack(push,1) -#endif -typedef struct DivisionModel_struct { - float kappa; //The learned kappa coefficient of division model. -} DivisionModel; - -typedef struct FocalLength_struct { - float fx; //Focal length in X direction. - float fy; //Focal length in Y direction. -} FocalLength; - -typedef struct PolyModel_struct { - float* kCoeffs; //The learned radial coefficients of polynomial model. - unsigned int numKCoeffs; //Number of K coefficients. - float p1; //The P1(learned tangential coefficients of polynomial model). - float p2; //The P2(learned tangential coefficients of polynomial model). -} PolyModel; - -typedef struct DistortionModelParams_struct { - DistortionModel distortionModel; //Type of learned distortion model. - PolyModel polyModel; //The learned coefficients of polynomial model. - DivisionModel divisionModel; //The learned coefficient of division model. -} DistortionModelParams; - -typedef struct PointFloat_struct { - float x; //The x-coordinate of the point. - float y; //The y-coordinate of the point. -} PointFloat; - -typedef struct InternalParameters_struct { - char isInsufficientData; - FocalLength focalLength; - PointFloat opticalCenter; -} InternalParameters; - -typedef struct MaxGridSize_struct { - unsigned int xMax; //Maximum x limit for the grid size. - unsigned int yMax; //Maximum y limit for the grid size. -} MaxGridSize; - -typedef struct ImageSize_struct { - unsigned int xRes; //X resolution of the image. - unsigned int yRes; //Y resolution of the image. -} ImageSize; - -typedef struct CalibrationReferencePoints_struct { - PointDouble* pixelCoords; //Specifies the coordinates of the pixel reference points. - unsigned int numPixelCoords; //Number of pixel coordinates. - PointDouble* realCoords; //Specifies the measuring unit associated with the image. - unsigned int numRealCoords; //Number of real coordinates. - CalibrationUnit units; //Specifies the units of X Step and Y Step. - ImageSize imageSize; //Specifies the size of calibration template image. -} CalibrationReferencePoints; - -typedef struct GetCameraParametersReport_struct { - double* projectionMatrix; //The projection(homography) matrix of working plane. - unsigned int projectionMatrixRows; //Number of rows in projection matrix. - unsigned int projectionMatrixCols; //Number of columns in projection matrix. - DistortionModelParams distortion; //Distortion model Coefficients. - InternalParameters internalParams; //The learned internal paramters of camera model such as focal length and optical center. -} GetCameraParametersReport; - -typedef struct CalibrationAxisInfo_struct { - PointFloat center; //The origin of the reference coordinate system, expressed in pixel units. - float rotationAngle; //The angle of the x-axis of the real-world coordinate system, in relation to the horizontal. - AxisOrientation axisDirection; //Specifies the direction of the calibraiton axis which is either Direct or Indirect. -} CalibrationAxisInfo; - -typedef struct CalibrationLearnSetupInfo_struct { - CalibrationMode2 calibrationMethod; //Type of calibration method used. - DistortionModel distortionModel; //Type of learned distortion model. - ScalingMethod scaleMode; //The aspect scaling to use when correcting an image. - CalibrationROI roiMode; //The ROI to use when correcting an image. - char learnCorrectionTable; //Set this input to true value if you want the correction table to be determined and stored. -} CalibrationLearnSetupInfo; - -typedef struct GridDescriptor_struct { - float xStep; //The distance in the x direction between two adjacent pixels in units specified by unit. - float yStep; //The distance in the y direction between two adjacent pixels in units specified by unit. - CalibrationUnit unit; //The unit of measure for the image. -} GridDescriptor; - -typedef struct ErrorStatistics_struct { - double mean; //Mean error statistics value. - double maximum; //Maximum value of error. - double standardDeviation; //The standard deviation error statistiscs value. - double distortion; //The distortion error statistics value. -} ErrorStatistics; - -typedef struct GetCalibrationInfoReport_struct { - ROI* userRoi; //Specifies the ROI the user provided when learning the calibration. - ROI* calibrationRoi; //Specifies the ROI that corresponds to the region of the image where the calibration information is accurate. - CalibrationAxisInfo axisInfo; //Reference Coordinate System for the real-world coordinates. - CalibrationLearnSetupInfo learnSetupInfo; //Calibration learn setup information. - GridDescriptor gridDescriptor; //Specifies scaling constants used to calibrate the image. - float* errorMap; //The the error map of calibration template image. - unsigned int errorMapRows; //Number of rows in error map. - unsigned int errorMapCols; //Number of Columns in error map. - ErrorStatistics errorStatistics; //Error statistics of the calibration. -} GetCalibrationInfoReport; - -typedef struct EdgePolarity_struct { - EdgePolaritySearchMode start; - EdgePolaritySearchMode end; -} EdgePolarity; - -typedef struct ClampSettings_struct { - double angleRange; //Specifies the angle range. - EdgePolarity edgePolarity; //Specifies the edge polarity. -} ClampSettings; - -typedef struct PointDouble_struct { - double x; //The x-coordinate of the point. - double y; //The y-coordinate of the point. -} PointDouble; - -typedef struct PointDoublePair_struct { - PointDouble start; //The Start co-ordinate of the pair. - PointDouble end; //The End co-ordinate of the pair. -} PointDoublePair; - -typedef struct ClampResults_struct { - double distancePix; //Defines the Pixel world distance. - double distanceRealWorld; //Defines the real world distance. - double angleAbs; //Defines the absolute angle. - double angleRelative; //Defines the relative angle. -} ClampResults; - -typedef struct ClampPoints_struct { - PointDoublePair pixel; //Specifies the pixel world point pair for clamp. - PointDoublePair realWorld; //Specifies the real world point pair for clamp. -} ClampPoints; - -typedef struct RGBValue_struct { - unsigned char B; //The blue value of the color. - unsigned char G; //The green value of the color. - unsigned char R; //The red value of the color. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} RGBValue; - -typedef struct ClampOverlaySettings_struct { - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showCurves; //If TRUE, the function overlays the curves on the image. - int showClampLocation; //If TRUE, the function overlays the clamp location on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue curvesColor; //Specifies the RGB color value to use to overlay the curves. - RGBValue clampLocationsColor; //Specifies the RGB color value to use to overlay the clamp locations. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the group overlay name for the step overlays. -} ClampOverlaySettings; - -typedef struct ClampMax2Report_struct { - ClampResults clampResults; //Specifies the Clamp results information returned by the function. - ClampPoints clampPoints; //Specifies the clamp points information returned by the function. - unsigned int calibrationValid; //Specifies if the calibration information is valid or not. -} ClampMax2Report; - -typedef struct ContourFitSplineReport_struct { - PointDouble* points; //It returns the points of the best-fit B-spline curve. - int numberOfPoints; //Number of Best fit points returned. -} ContourFitSplineReport; - -typedef struct LineFloat_struct { - PointFloat start; //The coordinate location of the start of the line. - PointFloat end; //The coordinate location of the end of the line. -} LineFloat; - -typedef struct LineEquation_struct { - double a; //The a coefficient of the line equation. - double b; //The b coefficient of the line equation. - double c; //The c coefficient of the line equation. -} LineEquation; - -typedef struct ContourFitLineReport_struct { - LineFloat lineSegment; //Line Segment represents the intersection of the line equation and the contour. - LineEquation lineEquation; //Line Equation is a structure of three coefficients A, B, and C of the equation in the normal form (Ax + By + C=0) of the best fit line. -} ContourFitLineReport; - -typedef struct ContourFitPolynomialReport_struct { - PointDouble* bestFit; //It returns the points of the best-fit polynomial. - int numberOfPoints; //Number of Best fit points returned. - double* polynomialCoefficients; //Polynomial Coefficients returns the coefficients of the polynomial equation. - int numberOfCoefficients; //Number of Coefficients returned in the polynomial coefficients array. -} ContourFitPolynomialReport; - -typedef struct PartialCircle_struct { - PointFloat center; //Center of the circle. - double radius; //Radius of the circle. - double startAngle; //Start angle of the fitted structure. - double endAngle; //End angle of the fitted structure. -} PartialCircle; - -typedef struct PartialEllipse_struct { - PointFloat center; //Center of the Ellipse. - double angle; //Angle of the ellipse. - double majorRadius; //The length of the semi-major axis of the ellipse. - double minorRadius; //The length of the semi-minor axis of the ellipse. - double startAngle; //Start angle of the fitted structure. - double endAngle; //End angle of the fitted structure. -} PartialEllipse; - -typedef struct SetupMatchPatternData_struct { - unsigned char* matchSetupData; //String containing the match setup data. - int numMatchSetupData; //Number of match setup data. -} SetupMatchPatternData; - -typedef struct RangeSettingDouble_struct { - SettingType settingType; //Match Constraints specifies the match option whose values you want to constrain by the given range. - double min; //Min is the minimum value of the range for a given Match Constraint. - double max; //Max is the maximum value of the range for a given Match Constraint. -} RangeSettingDouble; - -typedef struct GeometricAdvancedSetupDataOption_struct { - GeometricSetupDataItem type; //It determines the option you want to use during the matching phase. - double value; //Value is the value for the option you want to use during the matching phase. -} GeometricAdvancedSetupDataOption; - -typedef struct ContourInfoReport_struct { - PointDouble* pointsPixel; //Points (pixel) specifies the location of every point detected on the curve, in pixels. - unsigned int numPointsPixel; //Number of points pixel elements. - PointDouble* pointsReal; //Points (real) specifies the location of every point detected on the curve, in calibrated units. - unsigned int numPointsReal; //Number of points real elements. - double* curvaturePixel; //Curvature Pixel displays the curvature profile for the selected contour, in pixels. - unsigned int numCurvaturePixel; //Number of curvature pixels. - double* curvatureReal; //Curvature Real displays the curvature profile for the selected contour, in calibrated units. - unsigned int numCurvatureReal; //Number of curvature Real elements. - double length; //Length (pixel) specifies the length, in pixels, of the curves in the image. - double lengthReal; //Length (real) specifies the length, in calibrated units, of the curves within the curvature range. - unsigned int hasEquation; //Has Equation specifies whether the contour has a fitted equation. -} ContourInfoReport; - -typedef struct ROILabel_struct { - char* className; //Specifies the classname you want to segment. - unsigned int label; //Label is the label number associated with the Class Name. -} ROILabel; - -typedef struct SupervisedColorSegmentationReport_struct { - ROILabel* labelOut; //The Roi labels array. - unsigned int numLabelOut; //The number of elements in labelOut array. -} SupervisedColorSegmentationReport; - -typedef struct LabelToROIReport_struct { - ROI** roiArray; //Array of ROIs. - unsigned int numOfROIs; //Number of ROIs in the roiArray. - unsigned int* labelsOutArray; //Array of labels. - unsigned int numOfLabels; //Number of labels. - int* isTooManyVectorsArray; //isTooManyVectorsArray array. - unsigned int isTooManyVectorsArraySize; //Number of elements in isTooManyVectorsArray. -} LabelToROIReport; - -typedef struct ColorSegmenationOptions_struct { - unsigned int windowX; //X is the window size in x direction. - unsigned int windowY; //Y is the window size in y direction. - unsigned int stepSize; //Step Size is the distance between two windows. - unsigned int minParticleArea; //Min Particle Area is the minimum number of allowed pixels. - unsigned int maxParticleArea; //Max Particle Area is the maximum number of allowed pixels. - short isFineSegment; //When enabled, the step processes the boundary pixels of each segmentation cluster using a step size of 1. -} ColorSegmenationOptions; - -typedef struct ClassifiedCurve_struct { - double length; //Specifies the length, in pixels, of the curves within the curvature range. - double lengthReal; //specifies the length, in calibrated units, of the curves within the curvature range. - double maxCurvature; //specifies the maximum curvature, in pixels, for the selected curvature range. - double maxCurvatureReal; //specifies the maximum curvature, in calibrated units, for the selected curvature range. - unsigned int label; //specifies the class to which the the sample belongs. - PointDouble* curvePoints; //Curve Points is a point-coordinate cluster that defines the points of the curve. - unsigned int numCurvePoints; //Number of curve points. -} ClassifiedCurve; - -typedef struct RangeDouble_struct { - double minValue; //The minimum value of the range. - double maxValue; //The maximum value of the range. -} RangeDouble; - -typedef struct RangeLabel_struct { - RangeDouble range; //Specifies the range of curvature values. - unsigned int label; //Class Label specifies the class to which the the sample belongs. -} RangeLabel; - -typedef struct CurvatureAnalysisReport_struct { - ClassifiedCurve* curves; - unsigned int numCurves; -} CurvatureAnalysisReport; - -typedef struct Disparity_struct { - PointDouble current; //Current is a array of points that defines the target contour. - PointDouble reference; //reference is a array of points that defines the template contour. - double distance; //Specifies the distance, in pixels, between the template contour point and the target contour point. -} Disparity; - -typedef struct ComputeDistancesReport_struct { - Disparity* distances; //Distances is an array containing the computed distances. - unsigned int numDistances; //Number elements in the distances array. - Disparity* distancesReal; //Distances Real is an array containing the computed distances in calibrated units. - unsigned int numDistancesReal; //Number of elements in real distances array. -} ComputeDistancesReport; - -typedef struct MatchMode_struct { - unsigned int rotation; //Rotation When enabled, the Function searches for occurrences of the template in the inspection image, allowing for template matches to be rotated. - unsigned int scale; //Rotation When enabled, the Function searches for occurrences of the template in the inspection image, allowing for template matches to be rotated. - unsigned int occlusion; //Occlusion specifies whether or not to search for occluded versions of the shape. -} MatchMode; - -typedef struct ClassifiedDisparity_struct { - double length; //Length (pixel) specifies the length, in pixels, of the curves within the curvature range. - double lengthReal; //Length (real) specifies the length, in calibrated units, of the curves within the curvature range. - double maxDistance; //Maximum Distance (pixel) specifies the maximum distance, in pixels, between points along the selected contour and the template contour. - double maxDistanceReal; //Maximum Distance (real) specifies the maximum distance, in calibrated units, between points along the selected contour and the template contour. - unsigned int label; //Class Label specifies the class to which the the sample belongs. - PointDouble* templateSubsection; //Template subsection points is an array of points that defines the boundary of the template. - unsigned int numTemplateSubsection; //Number of reference points. - PointDouble* targetSubsection; //Current Points(Target subsection points) is an array of points that defines the boundary of the target. - unsigned int numTargetSubsection; //Number of current points. -} ClassifiedDisparity; - -typedef struct ClassifyDistancesReport_struct { - ClassifiedDisparity* classifiedDistances; //Disparity array containing the classified distances. - unsigned int numClassifiedDistances; //Number of elements in the disparity array. -} ClassifyDistancesReport; - -typedef struct ContourComputeCurvatureReport_struct { - double* curvaturePixel; //Curvature Pixel displays the curvature profile for the selected contour, in pixels. - unsigned int numCurvaturePixel; //Number of curvature pixels. - double* curvatureReal; //Curvature Real displays the curvature profile for the selected contour, in calibrated units. - unsigned int numCurvatureReal; //Number of curvature Real elements. -} ContourComputeCurvatureReport; - -typedef struct ContourOverlaySettings_struct { - unsigned int overlay; //Overlay specifies whether to display the overlay on the image. - RGBValue color; //Color is the color of the overlay. - unsigned int width; //Width specifies the width of the overlay in pixels. - unsigned int maintainWidth; //Maintain Width? specifies whether you want the overlay measured in screen pixels or image pixels. -} ContourOverlaySettings; - -typedef struct CurveParameters_struct { - ExtractionMode extractionMode; //Specifies the method the function uses to identify curves in the image. - int threshold; //Specifies the minimum contrast a seed point must have in order to begin a curve. - EdgeFilterSize filterSize; //Specifies the width of the edge filter the function uses to identify curves in the image. - int minLength; //Specifies the length, in pixels, of the smallest curve the function will extract. - int searchStep; //Search Step Size specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. - int maxEndPointGap; //Specifies the maximum gap, in pixels, between the endpoints of a curve that the function identifies as a closed curve. - int subpixel; //Subpixel specifies whether to detect curve points with subpixel accuracy. -} CurveParameters; - -typedef struct ExtractContourReport_struct { - PointDouble* contourPoints; //Contour Points specifies every point found on the contour. - int numContourPoints; //Number of contour points. - PointDouble* sourcePoints; //Source Image Points specifies every point found on the contour in the source image. - int numSourcePoints; //Number of source points. -} ExtractContourReport; - -typedef struct ConnectionConstraint_struct { - ConnectionConstraintType constraintType; //Constraint Type specifies what criteria to use to consider two curves part of a contour. - RangeDouble range; //Specifies range for a given Match Constraint. -} ConnectionConstraint; - -typedef struct ExtractTextureFeaturesReport_struct { - int* waveletBands; //The array having all the Wavelet Banks used for extraction. - int numWaveletBands; //Number of wavelet banks in the Array. - double** textureFeatures; //2-D array to store all the Texture features extracted. - int textureFeaturesRows; //Number of Rows in the Texture Features array. - int textureFeaturesCols; //Number of Cols in Texture Features array. -} ExtractTextureFeaturesReport; - -typedef struct WaveletBandsReport_struct { - float** LLBand; //2-D array for LL Band. - float** LHBand; //2-D array for LH Band. - float** HLBand; //2-D array for HL Band. - float** HHBand; //2-D array for HH Band. - float** LLLBand; //2-D array for LLL Band. - float** LLHBand; //2-D array for LLH Band. - float LHLBand; //2-D array for LHL Band. - float** LHHBand; //2-D array for LHH Band. - int rows; //Number of Rows for each of the 2-D arrays. - int cols; //Number of Columns for each of the 2-D arrays. -} WaveletBandsReport; - -typedef struct CircleFitOptions_struct { - int maxRadius; //Specifies the acceptable distance, in pixels, that a point determined to belong to the circle can be from the perimeter of the circle. - double stepSize; //Step Size is the angle, in degrees, between each radial line in the annular region. - RakeProcessType processType; //Method used to process the data extracted for edge detection. -} CircleFitOptions; - -typedef struct EdgeOptions2_struct { - EdgePolaritySearchMode polarity; //Specifies the polarity of the edges to be found. - unsigned int kernelSize; //Specifies the size of the edge detection kernel. - unsigned int width; //Specifies the number of pixels averaged perpendicular to the search direction to compute the edge profile strength at each point along the search ROI. - float minThreshold; //Specifies the minimum edge strength (gradient magnitude) required for a detected edge. - InterpolationMethod interpolationType; //Specifies the interpolation method used to locate the edge position. - ColumnProcessingMode columnProcessingMode; //Specifies the method used to find the straight edge. -} EdgeOptions2; - -typedef struct FindCircularEdgeOptions_struct { - SpokeDirection direction; //Specifies the Spoke direction to search in the ROI. - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showSearchLines; //If TRUE, the function overlays the search lines used to locate the edges on the image. - int showEdgesFound; //If TRUE, the function overlays the locations of the edges found on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue searchLinesColor; //Specifies the RGB color value to use to overlay the search lines. - RGBValue searchEdgesColor; //Specifies the RGB color value to use to overlay the search edges. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the overlay group name to assign to the overlays. - EdgeOptions2 edgeOptions; //Specifies the edge detection options along a single search line. -} FindCircularEdgeOptions; - -typedef struct FindConcentricEdgeOptions_struct { - ConcentricRakeDirection direction; //Specifies the Concentric Rake direction. - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showSearchLines; //If TRUE, the function overlays the search lines used to locate the edges on the image. - int showEdgesFound; //If TRUE, the function overlays the locations of the edges found on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue searchLinesColor; //Specifies the RGB color value to use to overlay the search lines. - RGBValue searchEdgesColor; //Specifies the RGB color value to use to overlay the search edges. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the overlay group name to assign to the overlays. - EdgeOptions2 edgeOptions; //Specifies the edge detection options along a single search line. -} FindConcentricEdgeOptions; - -typedef struct ConcentricEdgeFitOptions_struct { - int maxRadius; //Specifies the acceptable distance, in pixels, that a point determined to belong to the circle can be from the perimeter of the circle. - double stepSize; //The sampling factor that determines the gap between the rake lines. - RakeProcessType processType; //Method used to process the data extracted for edge detection. -} ConcentricEdgeFitOptions; - -typedef struct FindConcentricEdgeReport_struct { - PointFloat startPt; //Pixel Coordinates for starting point of the edge. - PointFloat endPt; //Pixel Coordinates for end point of the edge. - PointFloat startPtCalibrated; //Real world Coordinates for starting point of the edge. - PointFloat endPtCalibrated; //Real world Coordinates for end point of the edge. - double angle; //Angle of the edge found. - double angleCalibrated; //Calibrated angle of the edge found. - double straightness; //The straightness value of the detected straight edge. - double avgStrength; //Average strength of the egde found. - double avgSNR; //Average SNR(Signal to Noise Ratio) for the edge found. - int lineFound; //If the edge is found or not. -} FindConcentricEdgeReport; - -typedef struct FindCircularEdgeReport_struct { - PointFloat centerCalibrated; //Real world Coordinates of the Center. - double radiusCalibrated; //Real world radius of the Circular Edge found. - PointFloat center; //Pixel Coordinates of the Center. - double radius; //Radius in pixels of the Circular Edge found. - double roundness; //The roundness of the calculated circular edge. - double avgStrength; //Average strength of the egde found. - double avgSNR; //Average SNR(Signal to Noise Ratio) for the edge found. - int circleFound; //If the circlular edge is found or not. -} FindCircularEdgeReport; - -typedef struct WindowSize_struct { - int x; //Window lenght on X direction. - int y; //Window lenght on Y direction. - int stepSize; //Distance between windows. -} WindowSize; - -typedef struct DisplacementVector_struct { - int x; //length on X direction. - int y; //length on Y direction. -} DisplacementVector; - -typedef struct WaveletOptions_struct { - WaveletType typeOfWavelet; //Type of wavelet(db, bior. - float minEnergy; //Minimum Energy in the bands to consider for texture defect detection. -} WaveletOptions; - -typedef struct CooccurrenceOptions_struct { - int level; //Level/size of matrix. - DisplacementVector displacement; //Displacemnet between pixels to accumulate the matrix. -} CooccurrenceOptions; - -typedef struct ParticleClassifierLocalThresholdOptions_struct { - LocalThresholdMethod method; //Specifies the local thresholding method the function uses. - ParticleType particleType; //Specifies what kind of particles to look for. - unsigned int windowWidth; //The width of the rectangular window around the pixel on which the function performs the local threshold. - unsigned int windowHeight; //The height of the rectangular window around the pixel on which the function performs the local threshold. - double deviationWeight; //Specifies the k constant used in the Niblack local thresholding algorithm, which determines the weight applied to the variance calculation. -} ParticleClassifierLocalThresholdOptions; - -typedef struct RangeFloat_struct { - float minValue; //The minimum value of the range. - float maxValue; //The maximum value of the range. -} RangeFloat; - -typedef struct ParticleClassifierAutoThresholdOptions_struct { - ThresholdMethod method; //The method for binary thresholding, which specifies how to calculate the classes. - ParticleType particleType; //Specifies what kind of particles to look for. - RangeFloat limits; //The limits on the automatic threshold range. -} ParticleClassifierAutoThresholdOptions; - -typedef struct ParticleClassifierPreprocessingOptions2_struct { - ParticleClassifierThresholdType thresholdType; //The type of threshold to perform on the image. - RangeFloat manualThresholdRange; //The range of pixels to keep if manually thresholding the image. - ParticleClassifierAutoThresholdOptions autoThresholdOptions; //The options used to auto threshold the image. - ParticleClassifierLocalThresholdOptions localThresholdOptions; //The options used to local threshold the image. - int rejectBorder; //Set this element to TRUE to reject border particles. - int numErosions; //The number of erosions to perform. -} ParticleClassifierPreprocessingOptions2; - -typedef struct MeasureParticlesReport_struct { - double** pixelMeasurements; //The measurements on the particles in the image, in pixel coordinates. - double** calibratedMeasurements; //The measurements on the particles in the image, in real-world coordinates. - size_t numParticles; //The number of particles on which measurements were taken. - size_t numMeasurements; //The number of measurements taken. -} MeasureParticlesReport; - -typedef struct GeometricPatternMatch3_struct { - PointFloat position; //The location of the origin of the template in the match. - float rotation; //The rotation of the match relative to the template image, in degrees. - float scale; //The size of the match relative to the size of the template image, expressed as a percentage. - float score; //The accuracy of the match. - PointFloat corner[4]; //An array of four points describing the rectangle surrounding the template image. - int inverse; //This element is TRUE if the match is an inverse of the template image. - float occlusion; //The percentage of the match that is occluded. - float templateMatchCurveScore; //The accuracy of the match obtained by comparing the template curves to the curves in the match region. - float matchTemplateCurveScore; //The accuracy of the match obtained by comparing the curves in the match region to the template curves. - float correlationScore; //The accuracy of the match obtained by comparing the template image to the match region using a correlation metric that compares the two regions as a function of their pixel values. - PointFloat calibratedPosition; //The location of the origin of the template in the match. - float calibratedRotation; //The rotation of the match relative to the template image, in degrees. - PointFloat calibratedCorner[4]; //An array of four points describing the rectangle surrounding the template image. -} GeometricPatternMatch3; - -typedef struct MatchGeometricPatternAdvancedOptions3_struct { - unsigned int subpixelIterations; //Specifies the maximum number of incremental improvements used to refine matches with subpixel information. - double subpixelTolerance; //Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the function stops refining the match position. - unsigned int initialMatchListLength; //Specifies the maximum size of the match list. - int targetTemplateCurveScore; //Set this element to TRUE to specify that the function should calculate the match curve to template curve score and return it for each match result. - int correlationScore; //Set this element to TRUE to specify that the function should calculate the correlation score and return it for each match result. - double minMatchSeparationDistance; //Specifies the minimum separation distance, in pixels, between the origins of two matches that have unique positions. - double minMatchSeparationAngle; //Specifies the minimum angular difference, in degrees, between two matches that have unique angles. - double minMatchSeparationScale; //Specifies the minimum difference in scale, expressed as a percentage, between two matches that have unique scales. - double maxMatchOverlap; //Specifies the maximum amount of overlap, expressed as a percentage, allowed between the bounding rectangles of two unique matches. - int coarseResult; //Specifies whether you want the function to spend less time accurately estimating the location of a match. - int enableCalibrationSupport; //Set this element to TRUE to specify the algorithm treat the inspection image as a calibrated image. - ContrastMode enableContrastReversal; //Use this element to specify the contrast of the matches to search for in the image. - GeometricMatchingSearchStrategy matchStrategy; //Specifies the aggressiveness of the search strategy. - unsigned int refineMatchFactor; //Specifies the factor that is applied to the number of matches requested by the user to determine the number of matches that are refined at the initial matching stage. - unsigned int subpixelMatchFactor; //Specifies the factor that is applied to the number of matches requested by the user to determine the number of matches that are evaluated at the final subpixel matching stage. -} MatchGeometricPatternAdvancedOptions3; - -typedef struct ColorOptions_struct { - ColorClassificationResolution colorClassificationResolution; //Specifies the color resolution of the classifier. - unsigned int useLuminance; //Specifies if the luminance band is going to be used in the feature vector. - ColorMode colorMode; //Specifies the color mode of the classifier. -} ColorOptions; - -typedef struct SampleScore_struct { - char* className; //The name of the class. - float distance; //The distance from the item to this class. - unsigned int index; //index of this sample. -} SampleScore; - -typedef struct ClassifierReportAdvanced_struct { - char* bestClassName; //The name of the best class for the sample. - float classificationScore; //The similarity of the sample and the two closest classes in the classifier. - float identificationScore; //The similarity of the sample and the assigned class. - ClassScore* allScores; //All classes and their scores. - int allScoresSize; //The number of entries in allScores. - SampleScore* sampleScores; //All samples and their scores. - int sampleScoresSize; //The number of entries in sampleScores. -} ClassifierReportAdvanced; - -typedef struct LearnGeometricPatternAdvancedOptions2_struct { - double minScaleFactor; //Specifies the minimum scale factor that the template is learned for. - double maxScaleFactor; //Specifies the maximum scale factor the template is learned for. - double minRotationAngleValue; //Specifies the minimum rotation angle the template is learned for. - double maxRotationAngleValue; //Specifies the maximum rotation angle the template is learned for. - unsigned int imageSamplingFactor; //Specifies the factor that is used to subsample the template and the image for the initial matching phase. -} LearnGeometricPatternAdvancedOptions2; - -typedef struct ParticleFilterOptions2_struct { - int rejectMatches; //Set this parameter to TRUE to transfer only those particles that do not meet all the criteria. - int rejectBorder; //Set this element to TRUE to reject border particles. - int fillHoles; //Set this element to TRUE to fill holes in particles. - int connectivity8; //Set this parameter to TRUE to use connectivity-8 to determine whether particles are touching. -} ParticleFilterOptions2; - -typedef struct FindEdgeOptions2_struct { - RakeDirection direction; //The direction to search in the ROI. - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showSearchLines; //If TRUE, the function overlays the search lines used to locate the edges on the image. - int showEdgesFound; //If TRUE, the function overlays the locations of the edges found on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue searchLinesColor; //Specifies the RGB color value to use to overlay the search lines. - RGBValue searchEdgesColor; //Specifies the RGB color value to use to overlay the search edges. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the overlay group name to assign to the overlays. - EdgeOptions2 edgeOptions; //Specifies the edge detection options along a single search line. -} FindEdgeOptions2; - -typedef struct FindEdgeReport_struct { - StraightEdge* straightEdges; //An array of straight edges detected. - unsigned int numStraightEdges; //Indicates the number of straight edges found. -} FindEdgeReport; - -typedef struct FindTransformRectOptions2_struct { - FindReferenceDirection direction; //Specifies the direction and orientation in which the function searches for the primary axis. - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showSearchLines; //If TRUE, the function overlays the search lines used to locate the edges on the image. - int showEdgesFound; //If TRUE, the function overlays the locations of the edges found on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue searchLinesColor; //Specifies the RGB color value to use to overlay the search lines. - RGBValue searchEdgesColor; //Specifies the RGB color value to use to overlay the search edges. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the overlay group name to assign to the overlays. - EdgeOptions2 edgeOptions; //Specifies the edge detection options along a single search line. -} FindTransformRectOptions2; - -typedef struct FindTransformRectsOptions2_struct { - FindReferenceDirection direction; //Specifies the direction and orientation in which the function searches for the primary axis. - int showSearchArea; //If TRUE, the function overlays the search area on the image. - int showSearchLines; //If TRUE, the function overlays the search lines used to locate the edges on the image. - int showEdgesFound; //If TRUE, the function overlays the locations of the edges found on the image. - int showResult; //If TRUE, the function overlays the hit lines to the object and the edge used to generate the hit line on the result image. - RGBValue searchAreaColor; //Specifies the RGB color value to use to overlay the search area. - RGBValue searchLinesColor; //Specifies the RGB color value to use to overlay the search lines. - RGBValue searchEdgesColor; //Specifies the RGB color value to use to overlay the search edges. - RGBValue resultColor; //Specifies the RGB color value to use to overlay the results. - char* overlayGroupName; //Specifies the overlay group name to assign to the overlays. - EdgeOptions2 primaryEdgeOptions; //Specifies the parameters used to compute the edge gradient information and detect the edges for the primary ROI. - EdgeOptions2 secondaryEdgeOptions; //Specifies the parameters used to compute the edge gradient information and detect the edges for the secondary ROI. -} FindTransformRectsOptions2; - -typedef struct ReadTextReport3_struct { - const char* readString; //The read string. - CharReport3* characterReport; //An array of reports describing the properties of each identified character. - int numCharacterReports; //The number of identified characters. - ROI* roiBoundingCharacters; //An array specifying the coordinates of the character bounding ROI. -} ReadTextReport3; - -typedef struct CharacterStatistics_struct { - int left; //The left offset of the character bounding rectangles in the current ROI. - int top; //The top offset of the character bounding rectangles in the current ROI. - int width; //The width of each of the characters you trained in the current ROI. - int height; //The height of each trained character in the current ROI. - int characterSize; //The size of the character in pixels. -} CharacterStatistics; - -typedef struct CharReport3_struct { - const char* character; //The character value. - int classificationScore; //The degree to which the assigned character class represents the object better than the other character classes in the character set. - int verificationScore; //The similarity of the character and the reference character for the character class. - int verified; //This element is TRUE if a reference character was found for the character class and FALSE if a reference character was not found. - int lowThreshold; //The minimum value of the threshold range used for this character. - int highThreshold; //The maximum value of the threshold range used for this character. - CharacterStatistics characterStats; //Describes the characters segmented in the ROI. -} CharReport3; - -typedef struct ArcInfo2_struct { - PointFloat center; //The center point of the arc. - double radius; //The radius of the arc. - double startAngle; //The starting angle of the arc, specified counter-clockwise from the x-axis. - double endAngle; //The ending angle of the arc, specified counter-clockwise from the x-axis. -} ArcInfo2; - -typedef struct EdgeReport2_struct { - EdgeInfo* edges; //An array of edges detected. - unsigned int numEdges; //Indicates the number of edges detected. - double* gradientInfo; //An array that contains the calculated edge strengths along the user-defined search area. - unsigned int numGradientInfo; //Indicates the number of elements contained in gradientInfo. - int calibrationValid; //Indicates if the calibration data corresponding to the location of the edges is correct. -} EdgeReport2; - -typedef struct SearchArcInfo_struct { - ArcInfo2 arcCoordinates; //Describes the arc used for edge detection. - EdgeReport2 edgeReport; //Describes the edges found in this search line. -} SearchArcInfo; - -typedef struct ConcentricRakeReport2_struct { - EdgeInfo* firstEdges; //The first edge point detected along each search line in the ROI. - unsigned int numFirstEdges; //The number of points in the firstEdges array. - EdgeInfo* lastEdges; //The last edge point detected along each search line in the ROI. - unsigned int numLastEdges; //The number of points in the lastEdges array. - SearchArcInfo* searchArcs; //Contains the arcs used for edge detection and the edge information for each arc. - unsigned int numSearchArcs; //The number of arcs in the searchArcs array. -} ConcentricRakeReport2; - -typedef struct SpokeReport2_struct { - EdgeInfo* firstEdges; //The first edge point detected along each search line in the ROI. - unsigned int numFirstEdges; //The number of points in the firstEdges array. - EdgeInfo* lastEdges; //The last edge point detected along each search line in the ROI. - unsigned int numLastEdges; //The number of points in the lastEdges array. - SearchLineInfo* searchLines; //The search lines used for edge detection. - unsigned int numSearchLines; //The number of search lines used in the edge detection. -} SpokeReport2; - -typedef struct EdgeInfo_struct { - PointFloat position; //The location of the edge in the image. - PointFloat calibratedPosition; //The position of the edge in the image in real-world coordinates. - double distance; //The location of the edge from the first point along the boundary of the input ROI. - double calibratedDistance; //The location of the edge from the first point along the boundary of the input ROI in real-world coordinates. - double magnitude; //The intensity contrast at the edge. - double noisePeak; //The strength of the noise associated with the current edge. - int rising; //Indicates the polarity of the edge. -} EdgeInfo; - -typedef struct SearchLineInfo_struct { - LineFloat lineCoordinates; //The endpoints of the search line. - EdgeReport2 edgeReport; //Describes the edges found in this search line. -} SearchLineInfo; - -typedef struct RakeReport2_struct { - EdgeInfo* firstEdges; //The first edge point detected along each search line in the ROI. - unsigned int numFirstEdges; //The number of points in the firstEdges array. - EdgeInfo* lastEdges; //The last edge point detected along each search line in the ROI. - unsigned int numLastEdges; //The number of points in the lastEdges array. - SearchLineInfo* searchLines; //The search lines used for edge detection. - unsigned int numSearchLines; //The number of search lines used in the edge detection. -} RakeReport2; - -typedef struct TransformBehaviors_struct { - GroupBehavior ShiftBehavior; //Specifies the behavior of an overlay group when a shift operation is applied to an image. - GroupBehavior ScaleBehavior; //Specifies the behavior of an overlay group when a scale operation is applied to an image. - GroupBehavior RotateBehavior; //Specifies the behavior of an overlay group when a rotate operation is applied to an image. - GroupBehavior SymmetryBehavior; //Specifies the behavior of an overlay group when a symmetry operation is applied to an image. -} TransformBehaviors; - -typedef struct QRCodeDataToken_struct { - QRStreamMode mode; //Specifies the stream mode or the format of the data that is encoded in the QR code. - unsigned int modeData; //Indicates specifiers used by the user to postprocess the data if it requires it. - unsigned char* data; //Shows the encoded data in the QR code. - unsigned int dataLength; //Specifies the length of the data found in the QR code. -} QRCodeDataToken; - -typedef struct ParticleFilterOptions_struct { - int rejectMatches; //Set this parameter to TRUE to transfer only those particles that do not meet all the criteria. - int rejectBorder; //Set this element to TRUE to reject border particles. - int connectivity8; //Set this parameter to TRUE to use connectivity-8 to determine whether particles are touching. -} ParticleFilterOptions; - -typedef struct StraightEdgeReport2_struct { - StraightEdge* straightEdges; //Contains an array of found straight edges. - unsigned int numStraightEdges; //Indicates the number of straight edges found. - SearchLineInfo* searchLines; //Contains an array of all search lines used in the detection. - unsigned int numSearchLines; //The number of search lines used in the edge detection. -} StraightEdgeReport2; - -typedef struct StraightEdgeOptions_struct { - unsigned int numLines; //Specifies the number of straight edges to find. - StraightEdgeSearchMode searchMode; //Specifies the method used to find the straight edge. - double minScore; //Specifies the minimum score of a detected straight edge. - double maxScore; //Specifies the maximum score of a detected edge. - double orientation; //Specifies the angle at which the straight edge is expected to be found. - double angleRange; //Specifies the +/- range around the orientation within which the straight edge is expected to be found. - double angleTolerance; //Specifies the expected angular accuracy of the straight edge. - unsigned int stepSize; //Specifies the gap in pixels between the search lines used with the rake-based methods. - double minSignalToNoiseRatio; //Specifies the minimum signal to noise ratio (SNR) of the edge points used to fit the straight edge. - double minCoverage; //Specifies the minimum number of points as a percentage of the number of search lines that need to be included in the detected straight edge. - unsigned int houghIterations; //Specifies the number of iterations used in the Hough-based method. -} StraightEdgeOptions; - -typedef struct StraightEdge_struct { - LineFloat straightEdgeCoordinates; //End points of the detected straight edge in pixel coordinates. - LineFloat calibratedStraightEdgeCoordinates; //End points of the detected straight edge in real-world coordinates. - double angle; //Angle of the found edge using the pixel coordinates. - double calibratedAngle; //Angle of the found edge using the real-world coordinates. - double score; //Describes the score of the detected edge. - double straightness; //The straightness value of the detected straight edge. - double averageSignalToNoiseRatio; //Describes the average signal to noise ratio (SNR) of the detected edge. - int calibrationValid; //Indicates if the calibration data for the straight edge is valid. - EdgeInfo* usedEdges; //An array of edges that were used to determine this straight line. - unsigned int numUsedEdges; //Indicates the number of edges in the usedEdges array. -} StraightEdge; - -typedef struct QRCodeSearchOptions_struct { - QRRotationMode rotationMode; //Specifies the amount of QR code rotation the function should allow for. - unsigned int skipLocation; //If set to TRUE, specifies that the function should assume that the QR code occupies the entire image (or the entire search region). - unsigned int edgeThreshold; //The strength of the weakest edge the function uses to find the coarse location of the QR code in the image. - QRDemodulationMode demodulationMode; //The demodulation mode the function uses to locate the QR code. - QRCellSampleSize cellSampleSize; //The cell sample size the function uses to locate the QR code. - QRCellFilterMode cellFilterMode; //The cell filter mode the function uses to locate the QR code. - unsigned int skewDegreesAllowed; //Specifies the amount of skew in the QR code the function should allow for. -} QRCodeSearchOptions; - -typedef struct QRCodeSizeOptions_struct { - unsigned int minSize; //Specifies the minimum size (in pixels) of the QR code in the image. - unsigned int maxSize; //Specifies the maximum size (in pixels) of the QR code in the image. -} QRCodeSizeOptions; - -typedef struct QRCodeDescriptionOptions_struct { - QRDimensions dimensions; //The number of rows and columns that are populated for the QR code, measured in cells. - QRPolarities polarity; //The polarity of the QR code. - QRMirrorMode mirror; //This element is TRUE if the QR code appears mirrored in the image and FALSE if the QR code appears normally in the image. - QRModelType modelType; //This option allows you to specify the type of QR code. -} QRCodeDescriptionOptions; - -typedef struct QRCodeReport_struct { - unsigned int found; //This element is TRUE if the function located and decoded a QR code and FALSE if the function failed to locate and decode a QR code. - unsigned char* data; //The data encoded in the QR code. - unsigned int dataLength; //The length of the data array. - PointFloat boundingBox[4]; //An array of four points describing the rectangle surrounding the QR code. - QRCodeDataToken* tokenizedData; //Contains the data tokenized in exactly the way it was encoded in the code. - unsigned int sizeOfTokenizedData; //Size of the tokenized data. - unsigned int numErrorsCorrected; //The number of errors the function corrected when decoding the QR code. - unsigned int dimensions; //The number of rows and columns that are populated for the QR code, measured in cells. - unsigned int version; //The version of the QR code. - QRModelType modelType; //This option allows you to specify what type of QR code this is. - QRStreamMode streamMode; //The format of the data encoded in the stream. - QRPolarities matrixPolarity; //The polarity of the QR code. - unsigned int mirrored; //This element is TRUE if the QR code appears mirrored in the image and FALSE if the QR code appears normally in the image. - unsigned int positionInAppendStream; //Indicates what position the QR code is in with respect to the stream of data in all codes. - unsigned int sizeOfAppendStream; //Specifies how many QR codes are part of a larger array of codes. - int firstEAN128ApplicationID; //The first EAN-128 Application ID encountered in the stream. - int firstECIDesignator; //The first Regional Language Designator encountered in the stream. - unsigned int appendStreamIdentifier; //Specifies what stream the QR code is in relation to when the code is part of a larger array of codes. - unsigned int minimumEdgeStrength; //The strength of the weakest edge the function used to find the coarse location of the QR code in the image. - QRDemodulationMode demodulationMode; //The demodulation mode the function used to locate the QR code. - QRCellSampleSize cellSampleSize; //The cell sample size the function used to locate the QR code. - QRCellFilterMode cellFilterMode; //The cell filter mode the function used to locate the QR code. -} QRCodeReport; - -typedef struct AIMGradeReport_struct { - AIMGrade overallGrade; //The overall letter grade, which is equal to the lowest of the other five letter grades. - AIMGrade decodingGrade; //The letter grade assigned to a Data Matrix barcode based on the success of the function in decoding the Data Matrix barcode. - AIMGrade symbolContrastGrade; //The letter grade assigned to a Data Matrix barcode based on the symbol contrast raw score. - float symbolContrast; //The symbol contrast raw score representing the percentage difference between the mean of the reflectance of the darkest 10 percent and lightest 10 percent of the Data Matrix barcode. - AIMGrade printGrowthGrade; //The print growth letter grade for the Data Matrix barcode. - float printGrowth; //The print growth raw score for the barcode, which is based on the extent to which dark or light markings appropriately fill their module boundaries. - AIMGrade axialNonuniformityGrade; //The axial nonuniformity grade for the Data Matrix barcode. - float axialNonuniformity; //The axial nonuniformity raw score for the barcode, which is based on how much the sampling point spacing differs from one axis to another. - AIMGrade unusedErrorCorrectionGrade; //The unused error correction letter grade for the Data Matrix barcode. - float unusedErrorCorrection; //The unused error correction raw score for the Data Matrix barcode, which is based on the extent to which regional or spot damage in the Data Matrix barcode has eroded the reading safety margin provided by the error correction. -} AIMGradeReport; - -typedef struct DataMatrixSizeOptions_struct { - unsigned int minSize; //Specifies the minimum size (in pixels) of the Data Matrix barcode in the image. - unsigned int maxSize; //Specifies the maximum size (in pixels) of the Data Matrix barcode in the image. - unsigned int quietZoneWidth; //Specifies the expected minimum size of the quiet zone, in pixels. -} DataMatrixSizeOptions; - -typedef struct DataMatrixDescriptionOptions_struct { - float aspectRatio; //Specifies the ratio of the width of each Data Matrix barcode cell (in pixels) to the height of the Data Matrix barcode (in pixels). - unsigned int rows; //Specifies the number of rows in the Data Matrix barcode. - unsigned int columns; //Specifies the number of columns in the Data Matrix barcode. - int rectangle; //Set this element to TRUE to specify that the Data Matrix barcode is rectangular. - DataMatrixECC ecc; //Specifies the ECC used for this Data Matrix barcode. - DataMatrixPolarity polarity; //Specifies the data-to-background contrast for the Data Matrix barcode. - DataMatrixCellFillMode cellFill; //Specifies the fill percentage for a cell of the Data Matrix barcode that is in the "ON" state. - float minBorderIntegrity; //Specifies the minimum percentage of the border (locator pattern and timing pattern) the function should expect in the Data Matrix barcode. - DataMatrixMirrorMode mirrorMode; //Specifies if the Data Matrix barcode appears normally in the image or if the barcode appears mirrored in the image. -} DataMatrixDescriptionOptions; - -typedef struct DataMatrixSearchOptions_struct { - DataMatrixRotationMode rotationMode; //Specifies the amount of Data Matrix barcode rotation the function should allow for. - int skipLocation; //If set to TRUE, specifies that the function should assume that the Data Matrix barcode occupies the entire image (or the entire search region). - unsigned int edgeThreshold; //Specifies the minimum contrast a pixel must have in order to be considered part of a matrix cell edge. - DataMatrixDemodulationMode demodulationMode; //Specifies the mode the function should use to demodulate (determine which cells are on and which cells are off) the Data Matrix barcode. - DataMatrixCellSampleSize cellSampleSize; //Specifies the sample size, in pixels, the function should take to determine if each cell is on or off. - DataMatrixCellFilterMode cellFilterMode; //Specifies the mode the function uses to determine the pixel value for each cell. - unsigned int skewDegreesAllowed; //Specifies the amount of skew in the Data Matrix barcode the function should allow for. - unsigned int maxIterations; //Specifies the maximum number of iterations before the function stops looking for the Data Matrix barcode. - unsigned int initialSearchVectorWidth; //Specifies the number of pixels the function should average together to determine the location of an edge. -} DataMatrixSearchOptions; - -typedef struct DataMatrixReport_struct { - int found; //This element is TRUE if the function located and decoded a Data Matrix barcode and FALSE if the function failed to locate and decode a Data Matrix barcode. - int binary; //This element is TRUE if the Data Matrix barcode contains binary data and FALSE if the Data Matrix barcode contains text data. - unsigned char* data; //The data encoded in the Data Matrix barcode. - unsigned int dataLength; //The length of the data array. - PointFloat boundingBox[4]; //An array of four points describing the rectangle surrounding the Data Matrix barcode. - unsigned int numErrorsCorrected; //The number of errors the function corrected when decoding the Data Matrix barcode. - unsigned int numErasuresCorrected; //The number of erasures the function corrected when decoding the Data Matrix barcode. - float aspectRatio; //Specifies the aspect ratio of the Data Matrix barcode in the image, which equals the ratio of the width of a Data Matrix barcode cell (in pixels) to the height of a Data Matrix barcode cell (in pixels). - unsigned int rows; //The number of rows in the Data Matrix barcode. - unsigned int columns; //The number of columns in the Data Matrix barcode. - DataMatrixECC ecc; //The Error Correction Code (ECC) used by the Data Matrix barcode. - DataMatrixPolarity polarity; //The polarity of the Data Matrix barcode. - DataMatrixCellFillMode cellFill; //The cell fill percentage of the Data Matrix barcode. - float borderIntegrity; //The percentage of the Data Matrix barcode border that appears correctly in the image. - int mirrored; //This element is TRUE if the Data Matrix barcode appears mirrored in the image and FALSE if the Data Matrix barcode appears normally in the image. - unsigned int minimumEdgeStrength; //The strength of the weakest edge the function used to find the coarse location of the Data Matrix barcode in the image. - DataMatrixDemodulationMode demodulationMode; //The demodulation mode the function used to locate the Data Matrix barcode. - DataMatrixCellSampleSize cellSampleSize; //The cell sample size the function used to locate the Data Matrix barcode. - DataMatrixCellFilterMode cellFilterMode; //The cell filter mode the function used to locate the Data Matrix barcode. - unsigned int iterations; //The number of iterations the function took in attempting to locate the Data Matrix barcode. -} DataMatrixReport; - -typedef struct JPEG2000FileAdvancedOptions_struct { - WaveletTransformMode waveletMode; //Determines which wavelet transform to use when writing the file. - int useMultiComponentTransform; //Set this parameter to TRUE to use an additional transform on RGB images. - unsigned int maxWaveletTransformLevel; //Specifies the maximum allowed level of wavelet transform. - float quantizationStepSize; //Specifies the absolute base quantization step size for derived quantization mode. -} JPEG2000FileAdvancedOptions; - -typedef struct MatchGeometricPatternAdvancedOptions2_struct { - int minFeaturesUsed; //Specifies the minimum number of features the function uses when matching. - int maxFeaturesUsed; //Specifies the maximum number of features the function uses when matching. - int subpixelIterations; //Specifies the maximum number of incremental improvements used to refine matches with subpixel information. - double subpixelTolerance; //Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the function stops refining the match position. - int initialMatchListLength; //Specifies the maximum size of the match list. - float matchTemplateCurveScore; //Set this element to TRUE to specify that the function should calculate the match curve to template curve score and return it for each match result. - int correlationScore; //Set this element to TRUE to specify that the function should calculate the correlation score and return it for each match result. - double minMatchSeparationDistance; //Specifies the minimum separation distance, in pixels, between the origins of two matches that have unique positions. - double minMatchSeparationAngle; //Specifies the minimum angular difference, in degrees, between two matches that have unique angles. - double minMatchSeparationScale; //Specifies the minimum difference in scale, expressed as a percentage, between two matches that have unique scales. - double maxMatchOverlap; //Specifies the maximum amount of overlap, expressed as a percentage, allowed between the bounding rectangles of two unique matches. - int coarseResult; //Specifies whether you want the function to spend less time accurately estimating the location of a match. - int smoothContours; //Set this element to TRUE to specify smoothing be done on the contours of the inspection image before feature extraction. - int enableCalibrationSupport; //Set this element to TRUE to specify the algorithm treat the inspection image as a calibrated image. -} MatchGeometricPatternAdvancedOptions2; - -typedef struct InspectionAlignment_struct { - PointFloat position; //The location of the center of the golden template in the image under inspection. - float rotation; //The rotation of the golden template in the image under inspection, in degrees. - float scale; //The percentage of the size of the area under inspection compared to the size of the golden template. -} InspectionAlignment; - -typedef struct InspectionOptions_struct { - RegistrationMethod registrationMethod; //Specifies how the function registers the golden template and the target image. - NormalizationMethod normalizationMethod; //Specifies how the function normalizes the golden template to the target image. - int edgeThicknessToIgnore; //Specifies desired thickness of edges to be ignored. - float brightThreshold; //Specifies the threshold for areas where the target image is brighter than the golden template. - float darkThreshold; //Specifies the threshold for areas where the target image is darker than the golden template. - int binary; //Specifies whether the function should return a binary image giving the location of defects, or a grayscale image giving the intensity of defects. -} InspectionOptions; - -typedef struct CharReport2_struct { - const char* character; //The character value. - PointFloat corner[4]; //An array of four points that describes the rectangle that surrounds the character. - int lowThreshold; //The minimum value of the threshold range used for this character. - int highThreshold; //The maximum value of the threshold range used for this character. - int classificationScore; //The degree to which the assigned character class represents the object better than the other character classes in the character set. - int verificationScore; //The similarity of the character and the reference character for the character class. - int verified; //This element is TRUE if a reference character was found for the character class and FALSE if a reference character was not found. -} CharReport2; - -typedef struct CharInfo2_struct { - const char* charValue; //Retrieves the character value of the corresponding character in the character set. - const Image* charImage; //The image you used to train this character. - const Image* internalImage; //The internal representation that NI Vision uses to match objects to this character. - int isReferenceChar; //This element is TRUE if the character is the reference character for the character class. -} CharInfo2; - -typedef struct ReadTextReport2_struct { - const char* readString; //The read string. - CharReport2* characterReport; //An array of reports describing the properties of each identified character. - int numCharacterReports; //The number of identified characters. -} ReadTextReport2; - -typedef struct EllipseFeature_struct { - PointFloat position; //The location of the center of the ellipse. - double rotation; //The orientation of the semi-major axis of the ellipse with respect to the horizontal. - double minorRadius; //The length of the semi-minor axis of the ellipse. - double majorRadius; //The length of the semi-major axis of the ellipse. -} EllipseFeature; - -typedef struct CircleFeature_struct { - PointFloat position; //The location of the center of the circle. - double radius; //The radius of the circle. -} CircleFeature; - -typedef struct ConstCurveFeature_struct { - PointFloat position; //The center of the circle that this constant curve lies upon. - double radius; //The radius of the circle that this constant curve lies upon. - double startAngle; //When traveling along the constant curve from one endpoint to the next in a counterclockwise manner, this is the angular component of the vector originating at the center of the constant curve and pointing towards the first endpoint of the constant curve. - double endAngle; //When traveling along the constant curve from one endpoint to the next in a counterclockwise manner, this is the angular component of the vector originating at the center of the constant curve and pointing towards the second endpoint of the constant curve. -} ConstCurveFeature; - -typedef struct RectangleFeature_struct { - PointFloat position; //The center of the rectangle. - PointFloat corner[4]; //The four corners of the rectangle. - double rotation; //The orientation of the rectangle with respect to the horizontal. - double width; //The width of the rectangle. - double height; //The height of the rectangle. -} RectangleFeature; - -typedef struct LegFeature_struct { - PointFloat position; //The location of the leg feature. - PointFloat corner[4]; //The four corners of the leg feature. - double rotation; //The orientation of the leg with respect to the horizontal. - double width; //The width of the leg. - double height; //The height of the leg. -} LegFeature; - -typedef struct CornerFeature_struct { - PointFloat position; //The location of the corner feature. - double rotation; //The angular component of the vector bisecting the corner from position. - double enclosedAngle; //The measure of the enclosed angle of the corner. - int isVirtual; -} CornerFeature; - -typedef struct LineFeature_struct { - PointFloat startPoint; //The starting point of the line. - PointFloat endPoint; //The ending point of the line. - double length; //The length of the line measured in pixels from the start point to the end point. - double rotation; //The orientation of the line with respect to the horizontal. -} LineFeature; - -typedef struct ParallelLinePairFeature_struct { - PointFloat firstStartPoint; //The starting point of the first line of the pair. - PointFloat firstEndPoint; //The ending point of the first line of the pair. - PointFloat secondStartPoint; //The starting point of the second line of the pair. - PointFloat secondEndPoint; //The ending point of the second line of the pair. - double rotation; //The orientation of the feature with respect to the horizontal. - double distance; //The distance from the first line to the second line. -} ParallelLinePairFeature; - -typedef struct PairOfParallelLinePairsFeature_struct { - ParallelLinePairFeature firstParallelLinePair; //The first parallel line pair. - ParallelLinePairFeature secondParallelLinePair; //The second parallel line pair. - double rotation; //The orientation of the feature with respect to the horizontal. - double distance; //The distance from the midline of the first parallel line pair to the midline of the second parallel line pair. -} PairOfParallelLinePairsFeature; - -typedef union GeometricFeature_union { - CircleFeature* circle; //A pointer to a CircleFeature. - EllipseFeature* ellipse; //A pointer to an EllipseFeature. - ConstCurveFeature* constCurve; //A pointer to a ConstCurveFeature. - RectangleFeature* rectangle; //A pointer to a RectangleFeature. - LegFeature* leg; //A pointer to a LegFeature. - CornerFeature* corner; //A pointer to a CornerFeature. - ParallelLinePairFeature* parallelLinePair; //A pointer to a ParallelLinePairFeature. - PairOfParallelLinePairsFeature* pairOfParallelLinePairs; //A pointer to a PairOfParallelLinePairsFeature. - LineFeature* line; //A pointer to a LineFeature. - ClosedCurveFeature* closedCurve; //A pointer to a ClosedCurveFeature. -} GeometricFeature; - -typedef struct FeatureData_struct { - FeatureType type; //An enumeration representing the type of the feature. - PointFloat* contourPoints; //A set of points describing the contour of the feature. - int numContourPoints; //The number of points in the contourPoints array. - GeometricFeature feature; //The feature data specific to this type of feature. -} FeatureData; - -typedef struct GeometricPatternMatch2_struct { - PointFloat position; //The location of the origin of the template in the match. - float rotation; //The rotation of the match relative to the template image, in degrees. - float scale; //The size of the match relative to the size of the template image, expressed as a percentage. - float score; //The accuracy of the match. - PointFloat corner[4]; //An array of four points describing the rectangle surrounding the template image. - int inverse; //This element is TRUE if the match is an inverse of the template image. - float occlusion; //The percentage of the match that is occluded. - float templateMatchCurveScore; //The accuracy of the match obtained by comparing the template curves to the curves in the match region. - float matchTemplateCurveScore; //The accuracy of the match obtained by comparing the curves in the match region to the template curves. - float correlationScore; //The accuracy of the match obtained by comparing the template image to the match region using a correlation metric that compares the two regions as a function of their pixel values. - String255 label; //The label corresponding to this match when the match is returned by imaqMatchMultipleGeometricPatterns(). - FeatureData* featureData; //The features used in this match. - int numFeatureData; //The size of the featureData array. - PointFloat calibratedPosition; //The location of the origin of the template in the match. - float calibratedRotation; //The rotation of the match relative to the template image, in degrees. - PointFloat calibratedCorner[4]; //An array of four points describing the rectangle surrounding the template image. -} GeometricPatternMatch2; - -typedef struct ClosedCurveFeature_struct { - PointFloat position; //The center of the closed curve feature. - double arcLength; //The arc length of the closed curve feature. -} ClosedCurveFeature; - -typedef struct LineMatch_struct { - PointFloat startPoint; //The starting point of the matched line. - PointFloat endPoint; //The ending point of the matched line. - double length; //The length of the line measured in pixels from the start point to the end point. - double rotation; //The orientation of the matched line. - double score; //The score of the matched line. -} LineMatch; - -typedef struct LineDescriptor_struct { - double minLength; //Specifies the minimum length of a line the function will return. - double maxLength; //Specifies the maximum length of a line the function will return. -} LineDescriptor; - -typedef struct RectangleDescriptor_struct { - double minWidth; //Specifies the minimum width of a rectangle the algorithm will return. - double maxWidth; //Specifies the maximum width of a rectangle the algorithm will return. - double minHeight; //Specifies the minimum height of a rectangle the algorithm will return. - double maxHeight; //Specifies the maximum height of a rectangle the algorithm will return. -} RectangleDescriptor; - -typedef struct RectangleMatch_struct { - PointFloat corner[4]; //The corners of the matched rectangle. - double rotation; //The orientation of the matched rectangle. - double width; //The width of the matched rectangle. - double height; //The height of the matched rectangle. - double score; //The score of the matched rectangle. -} RectangleMatch; - -typedef struct EllipseDescriptor_struct { - double minMajorRadius; //Specifies the minimum length of the semi-major axis of an ellipse the function will return. - double maxMajorRadius; //Specifies the maximum length of the semi-major axis of an ellipse the function will return. - double minMinorRadius; //Specifies the minimum length of the semi-minor axis of an ellipse the function will return. - double maxMinorRadius; //Specifies the maximum length of the semi-minor axis of an ellipse the function will return. -} EllipseDescriptor; - -typedef struct EllipseMatch_struct { - PointFloat position; //The location of the center of the matched ellipse. - double rotation; //The orientation of the matched ellipse. - double majorRadius; //The length of the semi-major axis of the matched ellipse. - double minorRadius; //The length of the semi-minor axis of the matched ellipse. - double score; //The score of the matched ellipse. -} EllipseMatch; - -typedef struct CircleMatch_struct { - PointFloat position; //The location of the center of the matched circle. - double radius; //The radius of the matched circle. - double score; //The score of the matched circle. -} CircleMatch; - -typedef struct CircleDescriptor_struct { - double minRadius; //Specifies the minimum radius of a circle the function will return. - double maxRadius; //Specifies the maximum radius of a circle the function will return. -} CircleDescriptor; - -typedef struct ShapeDetectionOptions_struct { - unsigned int mode; //Specifies the method used when looking for the shape in the image. - RangeFloat* angleRanges; //An array of angle ranges, in degrees, where each range specifies how much you expect the shape to be rotated in the image. - int numAngleRanges; //The size of the orientationRanges array. - RangeFloat scaleRange; //A range that specifies the sizes of the shapes you expect to be in the image, expressed as a ratio percentage representing the size of the pattern in the image divided by size of the original pattern multiplied by 100. - double minMatchScore; -} ShapeDetectionOptions; - -typedef struct Curve_struct { - PointFloat* points; //The points on the curve. - unsigned int numPoints; //The number of points in the curve. - int closed; //This element is TRUE if the curve is closed and FALSE if the curve is open. - double curveLength; //The length of the curve. - double minEdgeStrength; //The lowest edge strength detected on the curve. - double maxEdgeStrength; //The highest edge strength detected on the curve. - double averageEdgeStrength; //The average of all edge strengths detected on the curve. -} Curve; - -typedef struct CurveOptions_struct { - ExtractionMode extractionMode; //Specifies the method the function uses to identify curves in the image. - int threshold; //Specifies the minimum contrast a seed point must have in order to begin a curve. - EdgeFilterSize filterSize; //Specifies the width of the edge filter the function uses to identify curves in the image. - int minLength; //Specifies the length, in pixels, of the smallest curve the function will extract. - int rowStepSize; //Specifies the distance, in the y direction, between lines the function inspects for curve seed points. - int columnStepSize; //Specifies the distance, in the x direction, between columns the function inspects for curve seed points. - int maxEndPointGap; //Specifies the maximum gap, in pixels, between the endpoints of a curve that the function identifies as a closed curve. - int onlyClosed; //Set this element to TRUE to specify that the function should only identify closed curves in the image. - int subpixelAccuracy; //Set this element to TRUE to specify that the function identifies the location of curves with subpixel accuracy by interpolating between points to find the crossing of threshold. -} CurveOptions; - -typedef struct Barcode2DInfo_struct { - Barcode2DType type; //The type of the 2D barcode. - int binary; //This element is TRUE if the 2D barcode contains binary data and FALSE if the 2D barcode contains text data. - unsigned char* data; //The data encoded in the 2D barcode. - unsigned int dataLength; //The length of the data array. - PointFloat boundingBox[4]; //An array of four points describing the rectangle surrounding the 2D barcode. - unsigned int numErrorsCorrected; //The number of errors the function corrected when decoding the 2D barcode. - unsigned int numErasuresCorrected; //The number of erasures the function corrected when decoding the 2D barcode. - unsigned int rows; //The number of rows in the 2D barcode. - unsigned int columns; //The number of columns in the 2D barcode. -} Barcode2DInfo; - -typedef struct DataMatrixOptions_struct { - Barcode2DSearchMode searchMode; //Specifies the mode the function uses to search for barcodes. - Barcode2DContrast contrast; //Specifies the contrast of the barcodes that the function searches for. - Barcode2DCellShape cellShape; //Specifies the shape of the barcode data cells, which affects how the function decodes the barcode. - Barcode2DShape barcodeShape; //Specifies the shape of the barcodes that the function searches for. - DataMatrixSubtype subtype; //Specifies the Data Matrix subtypes of the barcodes that the function searches for. -} DataMatrixOptions; - -typedef struct ClassifierAccuracyReport_struct { - int size; //The size of the arrays in this structure. - float accuracy; //The overall accuracy of the classifier, from 0 to 1000. - char** classNames; //The names of the classes of this classifier. - double* classAccuracy; //An array of size elements that contains accuracy information for each class. - double* classPredictiveValue; //An array containing size elements that contains the predictive values of each class. - int** classificationDistribution; //A two-dimensional array containing information about how the classifier classifies its samples. -} ClassifierAccuracyReport; - -typedef struct NearestNeighborClassResult_struct { - char* className; //The name of the class. - float standardDeviation; //The standard deviation of the members of this class. - int count; //The number of samples in this class. -} NearestNeighborClassResult; - -typedef struct NearestNeighborTrainingReport_struct { - float** classDistancesTable; //The confidence in the training. - NearestNeighborClassResult* allScores; //All classes and their scores. - int allScoresSize; //The number of entries in allScores. -} NearestNeighborTrainingReport; - -typedef struct ParticleClassifierPreprocessingOptions_struct { - int manualThreshold; //Set this element to TRUE to specify the threshold range manually. - RangeFloat manualThresholdRange; //If a manual threshold is being done, the range of pixels to keep. - ThresholdMethod autoThresholdMethod; //If an automatic threshold is being done, the method used to calculate the threshold range. - RangeFloat limits; //The limits on the automatic threshold range. - ParticleType particleType; //Specifies what kind of particles to look for. - int rejectBorder; //Set this element to TRUE to reject border particles. - int numErosions; //The number of erosions to perform. -} ParticleClassifierPreprocessingOptions; - -typedef struct ClassifierSampleInfo_struct { - char* className; //The name of the class this sample is in. - double* featureVector; //The feature vector of this sample, or NULL if this is not a custom classifier session. - int featureVectorSize; //The number of elements in the feature vector. - Image* thumbnail; //A thumbnail image of this sample, or NULL if no image was specified. -} ClassifierSampleInfo; - -typedef struct ClassScore_struct { - char* className; //The name of the class. - float distance; //The distance from the item to this class. -} ClassScore; - -typedef struct ClassifierReport_struct { - char* bestClassName; //The name of the best class for the sample. - float classificationScore; //The similarity of the sample and the two closest classes in the classifier. - float identificationScore; //The similarity of the sample and the assigned class. - ClassScore* allScores; //All classes and their scores. - int allScoresSize; //The number of entries in allScores. -} ClassifierReport; - -typedef struct NearestNeighborOptions_struct { - NearestNeighborMethod method; //The method to use. - NearestNeighborMetric metric; //The metric to use. - int k; //The value of k, if the IMAQ_K_NEAREST_NEIGHBOR method is used. -} NearestNeighborOptions; - -typedef struct ParticleClassifierOptions_struct { - float scaleDependence; //The relative importance of scale when classifying particles. - float mirrorDependence; //The relative importance of mirror symmetry when classifying particles. -} ParticleClassifierOptions; - -typedef struct RGBU64Value_struct { - unsigned short B; //The blue value of the color. - unsigned short G; //The green value of the color. - unsigned short R; //The red value of the color. - unsigned short alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} RGBU64Value; - -typedef struct GeometricPatternMatch_struct { - PointFloat position; //The location of the origin of the template in the match. - float rotation; //The rotation of the match relative to the template image, in degrees. - float scale; //The size of the match relative to the size of the template image, expressed as a percentage. - float score; //The accuracy of the match. - PointFloat corner[4]; //An array of four points describing the rectangle surrounding the template image. - int inverse; //This element is TRUE if the match is an inverse of the template image. - float occlusion; //The percentage of the match that is occluded. - float templateMatchCurveScore; //The accuracy of the match obtained by comparing the template curves to the curves in the match region. - float matchTemplateCurveScore; //The accuracy of the match obtained by comparing the curves in the match region to the template curves. - float correlationScore; //The accuracy of the match obtained by comparing the template image to the match region using a correlation metric that compares the two regions as a function of their pixel values. -} GeometricPatternMatch; - -typedef struct MatchGeometricPatternAdvancedOptions_struct { - int minFeaturesUsed; //Specifies the minimum number of features the function uses when matching. - int maxFeaturesUsed; //Specifies the maximum number of features the function uses when matching. - int subpixelIterations; //Specifies the maximum number of incremental improvements used to refine matches with subpixel information. - double subpixelTolerance; //Specifies the maximum amount of change, in pixels, between consecutive incremental improvements in the match position before the function stops refining the match position. - int initialMatchListLength; //Specifies the maximum size of the match list. - int matchTemplateCurveScore; //Set this element to TRUE to specify that the function should calculate the match curve to template curve score and return it for each match result. - int correlationScore; //Set this element to TRUE to specify that the function should calculate the correlation score and return it for each match result. - double minMatchSeparationDistance; //Specifies the minimum separation distance, in pixels, between the origins of two matches that have unique positions. - double minMatchSeparationAngle; //Specifies the minimum angular difference, in degrees, between two matches that have unique angles. - double minMatchSeparationScale; //Specifies the minimum difference in scale, expressed as a percentage, between two matches that have unique scales. - double maxMatchOverlap; //Specifies the maximum amount of overlap, expressed as a percentage, allowed between the bounding rectangles of two unique matches. - int coarseResult; //Specifies whether you want the function to spend less time accurately estimating the location of a match. -} MatchGeometricPatternAdvancedOptions; - -typedef struct MatchGeometricPatternOptions_struct { - unsigned int mode; //Specifies the method imaqMatchGeometricPattern() uses when looking for the pattern in the image. - int subpixelAccuracy; //Set this element to TRUE to specify that the function should calculate match locations with subpixel accuracy. - RangeFloat* angleRanges; //An array of angle ranges, in degrees, where each range specifies how much you expect the template to be rotated in the image. - int numAngleRanges; //Number of angle ranges in the angleRanges array. - RangeFloat scaleRange; //A range that specifies the sizes of the pattern you expect to be in the image, expressed as a ratio percentage representing the size of the pattern in the image divided by size of the original pattern multiplied by 100. - RangeFloat occlusionRange; //A range that specifies the percentage of the pattern you expect to be occluded in the image. - int numMatchesRequested; //Number of valid matches expected. - float minMatchScore; //The minimum score a match can have for the function to consider the match valid. -} MatchGeometricPatternOptions; - -typedef struct LearnGeometricPatternAdvancedOptions_struct { - int minRectLength; //Specifies the minimum length for each side of a rectangular feature. - double minRectAspectRatio; //Specifies the minimum aspect ratio of a rectangular feature. - int minRadius; //Specifies the minimum radius for a circular feature. - int minLineLength; //Specifies the minimum length for a linear feature. - double minFeatureStrength; //Specifies the minimum strength for a feature. - int maxFeaturesUsed; //Specifies the maximum number of features the function uses when learning. - int maxPixelDistanceFromLine; //Specifies the maximum number of pixels between an edge pixel and a linear feature for the function to consider that edge pixel as part of the linear feature. -} LearnGeometricPatternAdvancedOptions; - -typedef struct FitEllipseOptions_struct { - int rejectOutliers; //Whether to use every given point or only a subset of the points to fit the ellipse. - double minScore; //Specifies the required quality of the fitted ellipse. - double pixelRadius; //The acceptable distance, in pixels, that a point determined to belong to the ellipse can be from the circumference of the ellipse. - int maxIterations; //Specifies the number of refinement iterations you allow the function to perform on the initial subset of points. -} FitEllipseOptions; - -typedef struct FitCircleOptions_struct { - int rejectOutliers; //Whether to use every given point or only a subset of the points to fit the circle. - double minScore; //Specifies the required quality of the fitted circle. - double pixelRadius; //The acceptable distance, in pixels, that a point determined to belong to the circle can be from the circumference of the circle. - int maxIterations; //Specifies the number of refinement iterations you allow the function to perform on the initial subset of points. -} FitCircleOptions; - -typedef struct ConstructROIOptions2_struct { - int windowNumber; //The window number of the image window. - const char* windowTitle; //Specifies the message string that the function displays in the title bar of the window. - PaletteType type; //The palette type to use. - RGBValue* palette; //If type is IMAQ_PALETTE_USER, this array is the palette of colors to use with the window. - int numColors; //If type is IMAQ_PALETTE_USER, this element is the number of colors in the palette array. - unsigned int maxContours; //The maximum number of contours the user will be able to select. -} ConstructROIOptions2; - -typedef struct HSLValue_struct { - unsigned char L; //The color luminance. - unsigned char S; //The color saturation. - unsigned char H; //The color hue. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} HSLValue; - -typedef struct HSVValue_struct { - unsigned char V; //The color value. - unsigned char S; //The color saturation. - unsigned char H; //The color hue. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} HSVValue; - -typedef struct HSIValue_struct { - unsigned char I; //The color intensity. - unsigned char S; //The color saturation. - unsigned char H; //The color hue. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} HSIValue; - -typedef struct CIELabValue_struct { - double b; //The yellow/blue information of the color. - double a; //The red/green information of the color. - double L; //The color lightness. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} CIELabValue; - -typedef struct CIEXYZValue_struct { - double Z; //The Z color information. - double Y; //The color luminance. - double X; //The X color information. - unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. -} CIEXYZValue; - -typedef union Color2_union { - RGBValue rgb; //The information needed to describe a color in the RGB (Red, Green, and Blue) color space. - HSLValue hsl; //The information needed to describe a color in the HSL (Hue, Saturation, and Luminance) color space. - HSVValue hsv; //The information needed to describe a color in the HSI (Hue, Saturation, and Value) color space. - HSIValue hsi; //The information needed to describe a color in the HSI (Hue, Saturation, and Intensity) color space. - CIELabValue cieLab; //The information needed to describe a color in the CIE L*a*b* (L, a, b) color space. - CIEXYZValue cieXYZ; //The information needed to describe a color in the CIE XYZ (X, Y, Z) color space. - int rawValue; //The integer value for the data in the color union. -} Color2; - -typedef struct BestEllipse2_struct { - PointFloat center; //The coordinate location of the center of the ellipse. - PointFloat majorAxisStart; //The coordinate location of the start of the major axis of the ellipse. - PointFloat majorAxisEnd; //The coordinate location of the end of the major axis of the ellipse. - PointFloat minorAxisStart; //The coordinate location of the start of the minor axis of the ellipse. - PointFloat minorAxisEnd; //The coordinate location of the end of the minor axis of the ellipse. - double area; //The area of the ellipse. - double perimeter; //The length of the perimeter of the ellipse. - double error; //Represents the least square error of the fitted ellipse to the entire set of points. - int valid; //This element is TRUE if the function achieved the minimum score within the number of allowed refinement iterations and FALSE if the function did not achieve the minimum score. - int* pointsUsed; //An array of the indexes for the points array indicating which points the function used to fit the ellipse. - int numPointsUsed; //The number of points the function used to fit the ellipse. -} BestEllipse2; - -typedef struct LearnPatternAdvancedOptions_struct { - LearnPatternAdvancedShiftOptions* shiftOptions; //Use this element to control the behavior of imaqLearnPattern2() during the shift-invariant learning phase. - LearnPatternAdvancedRotationOptions* rotationOptions; //Use this element to control the behavior of imaqLearnPattern2()during the rotation-invariant learning phase. -} LearnPatternAdvancedOptions; - -typedef struct AVIInfo_struct { - unsigned int width; //The width of each frame. - unsigned int height; //The height of each frame. - ImageType imageType; //The type of images this AVI contains. - unsigned int numFrames; //The number of frames in the AVI. - unsigned int framesPerSecond; //The number of frames per second this AVI should be shown at. - char* filterName; //The name of the compression filter used to create this AVI. - int hasData; //Specifies whether this AVI has data attached to each frame or not. - unsigned int maxDataSize; //If this AVI has data, the maximum size of the data in each frame. -} AVIInfo; - -typedef struct LearnPatternAdvancedShiftOptions_struct { - int initialStepSize; //The largest number of image pixels to shift the sample across the inspection image during the initial phase of shift-invariant matching. - int initialSampleSize; //Specifies the number of template pixels that you want to include in a sample for the initial phase of shift-invariant matching. - double initialSampleSizeFactor; //Specifies the size of the sample for the initial phase of shift-invariant matching as a percent of the template size, in pixels. - int finalSampleSize; //Specifies the number of template pixels you want to add to initialSampleSize for the final phase of shift-invariant matching. - double finalSampleSizeFactor; //Specifies the size of the sample for the final phase of shift-invariant matching as a percent of the edge points in the template, in pixels. - int subpixelSampleSize; //Specifies the number of template pixels that you want to include in a sample for the subpixel phase of shift-invariant matching. - double subpixelSampleSizeFactor; //Specifies the size of the sample for the subpixel phase of shift-invariant matching as a percent of the template size, in pixels. -} LearnPatternAdvancedShiftOptions; - -typedef struct LearnPatternAdvancedRotationOptions_struct { - SearchStrategy searchStrategySupport; //Specifies the aggressiveness of the rotation search strategy available during the matching phase. - int initialStepSize; //The largest number of image pixels to shift the sample across the inspection image during the initial phase of matching. - int initialSampleSize; //Specifies the number of template pixels that you want to include in a sample for the initial phase of rotation-invariant matching. - double initialSampleSizeFactor; //Specifies the size of the sample for the initial phase of rotation-invariant matching as a percent of the template size, in pixels. - int initialAngularAccuracy; //Sets the angle accuracy, in degrees, to use during the initial phase of rotation-invariant matching. - int finalSampleSize; //Specifies the number of template pixels you want to add to initialSampleSize for the final phase of rotation-invariant matching. - double finalSampleSizeFactor; //Specifies the size of the sample for the final phase of rotation-invariant matching as a percent of the edge points in the template, in pixels. - int finalAngularAccuracy; //Sets the angle accuracy, in degrees, to use during the final phase of the rotation-invariant matching. - int subpixelSampleSize; //Specifies the number of template pixels that you want to include in a sample for the subpixel phase of rotation-invariant matching. - double subpixelSampleSizeFactor; //Specifies the size of the sample for the subpixel phase of rotation-invariant matching as a percent of the template size, in pixels. -} LearnPatternAdvancedRotationOptions; - -typedef struct MatchPatternAdvancedOptions_struct { - int subpixelIterations; //Defines the maximum number of incremental improvements used to refine matching using subpixel information. - double subpixelTolerance; //Defines the maximum amount of change, in pixels, between consecutive incremental improvements in the match position that you want to trigger the end of the refinement process. - int initialMatchListLength; //Specifies the maximum size of the match list. - int matchListReductionFactor; //Specifies the reduction of the match list as matches are refined. - int initialStepSize; //Specifies the number of pixels to shift the sample across the inspection image during the initial phase of shift-invariant matching. - SearchStrategy searchStrategy; //Specifies the aggressiveness of the rotation search strategy. - int intermediateAngularAccuracy; //Specifies the accuracy to use during the intermediate phase of rotation-invariant matching. -} MatchPatternAdvancedOptions; - -typedef struct ParticleFilterCriteria2_struct { - MeasurementType parameter; //The morphological measurement that the function uses for filtering. - float lower; //The lower bound of the criteria range. - float upper; //The upper bound of the criteria range. - int calibrated; //Set this element to TRUE to take calibrated measurements. - int exclude; //Set this element to TRUE to indicate that a match occurs when the measurement is outside the criteria range. -} ParticleFilterCriteria2; - -typedef struct BestCircle2_struct { - PointFloat center; //The coordinate location of the center of the circle. - double radius; //The radius of the circle. - double area; //The area of the circle. - double perimeter; //The length of the perimeter of the circle. - double error; //Represents the least square error of the fitted circle to the entire set of points. - int valid; //This element is TRUE if the function achieved the minimum score within the number of allowed refinement iterations and FALSE if the function did not achieve the minimum score. - int* pointsUsed; //An array of the indexes for the points array indicating which points the function used to fit the circle. - int numPointsUsed; //The number of points the function used to fit the circle. -} BestCircle2; - -typedef struct OCRSpacingOptions_struct { - int minCharSpacing; //The minimum number of pixels that must be between two characters for NI Vision to train or read the characters separately. - int minCharSize; //The minimum number of pixels required for an object to be a potentially identifiable character. - int maxCharSize; //The maximum number of pixels required for an object to be a potentially identifiable character. - int maxHorizontalElementSpacing; //The maximum horizontal spacing, in pixels, allowed between character elements to train or read the character elements as a single character. - int maxVerticalElementSpacing; //The maximum vertical element spacing in pixels. - int minBoundingRectWidth; //The minimum possible width, in pixels, for a character bounding rectangle. - int maxBoundingRectWidth; //The maximum possible width, in pixels, for a character bounding rectangle. - int minBoundingRectHeight; //The minimum possible height, in pixels, for a character bounding rectangle. - int maxBoundingRectHeight; //The maximum possible height, in pixels, for a character bounding rectangle. - int autoSplit; //Set this element to TRUE to automatically adjust the location of the character bounding rectangle when characters overlap vertically. -} OCRSpacingOptions; - -typedef struct OCRProcessingOptions_struct { - ThresholdMode mode; //The thresholding mode. - int lowThreshold; //The low threshold value when you set mode to IMAQ_FIXED_RANGE. - int highThreshold; //The high threshold value when you set mode to IMAQ_FIXED_RANGE. - int blockCount; //The number of blocks for threshold calculation algorithms that require blocks. - int fastThreshold; //Set this element to TRUE to use a faster, less accurate threshold calculation algorithm. - int biModalCalculation; //Set this element to TRUE to calculate both the low and high threshold values when using the fast thresholding method. - int darkCharacters; //Set this element to TRUE to read or train dark characters on a light background. - int removeParticlesTouchingROI; //Set this element to TRUE to remove the particles touching the ROI. - int erosionCount; //The number of erosions to perform. -} OCRProcessingOptions; - -typedef struct ReadTextOptions_struct { - String255 validChars[255]; //An array of strings that specifies the valid characters. - int numValidChars; //The number of strings in the validChars array that you have initialized. - char substitutionChar; //The character to substitute for objects that the function cannot match with any of the trained characters. - ReadStrategy readStrategy; //The read strategy, which determines how closely the function analyzes images in the reading process to match objects with trained characters. - int acceptanceLevel; //The minimum acceptance level at which an object is considered a trained character. - int aspectRatio; //The maximum aspect ratio variance percentage for valid characters. - ReadResolution readResolution; //The read resolution, which determines how much of the trained character data the function uses to match objects to trained characters. -} ReadTextOptions; - -typedef struct CharInfo_struct { - const char* charValue; //Retrieves the character value of the corresponding character in the character set. - const Image* charImage; //The image you used to train this character. - const Image* internalImage; //The internal representation that NI Vision uses to match objects to this character. -} CharInfo; - -#if !defined(USERINT_HEADER) && !defined(_CVI_RECT_DEFINED) -typedef struct Rect_struct { - int top; //Location of the top edge of the rectangle. - int left; //Location of the left edge of the rectangle. - int height; //Height of the rectangle. - int width; //Width of the rectangle. -} Rect; -#define _CVI_RECT_DEFINED -#endif - -typedef struct CharReport_struct { - const char* character; //The character value. - PointFloat corner[4]; //An array of four points that describes the rectangle that surrounds the character. - int reserved; //This element is reserved. - int lowThreshold; //The minimum value of the threshold range used for this character. - int highThreshold; //The maximum value of the threshold range used for this character. -} CharReport; - -typedef struct ReadTextReport_struct { - const char* readString; //The read string. - const CharReport* characterReport; //An array of reports describing the properties of each identified character. - int numCharacterReports; //The number of identified characters. -} ReadTextReport; - -#if !defined(USERINT_HEADER) && !defined(_CVI_POINT_DEFINED) -typedef struct Point_struct { - int x; //The x-coordinate of the point. - int y; //The y-coordinate of the point. -} Point; -#define _CVI_POINT_DEFINED -#endif - -typedef struct Annulus_struct { - Point center; //The coordinate location of the center of the annulus. - int innerRadius; //The internal radius of the annulus. - int outerRadius; //The external radius of the annulus. - double startAngle; //The start angle, in degrees, of the annulus. - double endAngle; //The end angle, in degrees, of the annulus. -} Annulus; - -typedef struct EdgeLocationReport_struct { - PointFloat* edges; //The coordinate location of all edges detected by the search line. - int numEdges; //The number of points in the edges array. -} EdgeLocationReport; - -typedef struct EdgeOptions_struct { - unsigned threshold; //Specifies the threshold value for the contrast of the edge. - unsigned width; //The number of pixels that the function averages to find the contrast at either side of the edge. - unsigned steepness; //The span, in pixels, of the slope of the edge projected along the path specified by the input points. - InterpolationMethod subpixelType; //The method for interpolating. - unsigned subpixelDivisions; //The number of samples the function obtains from a pixel. -} EdgeOptions; - -typedef struct EdgeReport_struct { - float location; //The location of the edge from the first point in the points array. - float contrast; //The contrast at the edge. - PolarityType polarity; //The polarity of the edge. - float reserved; //This element is reserved. - PointFloat coordinate; //The coordinates of the edge. -} EdgeReport; - -typedef struct ExtremeReport_struct { - double location; //The locations of the extreme. - double amplitude; //The amplitude of the extreme. - double secondDerivative; //The second derivative of the extreme. -} ExtremeReport; - -typedef struct FitLineOptions_struct { - float minScore; //Specifies the required quality of the fitted line. - float pixelRadius; //Specifies the neighborhood pixel relationship for the initial subset of points being used. - int numRefinements; //Specifies the number of refinement iterations you allow the function to perform on the initial subset of points. -} FitLineOptions; - -typedef struct DisplayMapping_struct { - MappingMethod method; //Describes the method for converting 16-bit pixels to 8-bit pixels. - int minimumValue; //When method is IMAQ_RANGE, minimumValue represents the value that is mapped to 0. - int maximumValue; //When method is IMAQ_RANGE, maximumValue represents the value that is mapped to 255. - int shiftCount; //When method is IMAQ_DOWNSHIFT, shiftCount represents the number of bits the function right-shifts the 16-bit pixel values. -} DisplayMapping; - -typedef struct DetectExtremesOptions_struct { - double threshold; //Defines which extremes are too small. - int width; //Specifies the number of consecutive data points the function uses in the quadratic least-squares fit. -} DetectExtremesOptions; - -typedef struct ImageInfo_struct { - CalibrationUnit imageUnit; //If you set calibration information with imaqSetSimpleCalibrationInfo(), imageUnit is the calibration unit. - float stepX; //If you set calibration information with imaqSetCalibrationInfo(), stepX is the distance in the calibration unit between two pixels in the x direction. - float stepY; //If you set calibration information with imaqSetCalibrationInfo(), stepY is the distance in the calibration unit between two pixels in the y direction. - ImageType imageType; //The type of the image. - int xRes; //The number of columns in the image. - int yRes; //The number of rows in the image. - int xOffset; //If you set mask offset information with imaqSetMaskOffset(), xOffset is the offset of the mask origin in the x direction. - int yOffset; //If you set mask offset information with imaqSetMaskOffset(), yOffset is the offset of the mask origin in the y direction. - int border; //The number of border pixels around the image. - int pixelsPerLine; //The number of pixels stored for each line of the image. - void* reserved0; //This element is reserved. - void* reserved1; //This element is reserved. - void* imageStart; //A pointer to pixel (0,0). -} ImageInfo; - -typedef struct LCDOptions_struct { - int litSegments; //Set this parameter to TRUE if the segments are brighter than the background. - float threshold; //Determines whether a segment is ON or OFF. - int sign; //Indicates whether the function must read the sign of the indicator. - int decimalPoint; //Determines whether to look for a decimal separator after each digit. -} LCDOptions; - -typedef struct LCDReport_struct { - const char* text; //A string of the characters of the LCD. - LCDSegments* segmentInfo; //An array of LCDSegment structures describing which segments of each digit are on. - int numCharacters; //The number of characters that the function reads. - int reserved; //This element is reserved. -} LCDReport; - -typedef struct LCDSegments_struct { - unsigned a:1; //True if the a segment is on. - unsigned b:1; //True if the b segment is on. - unsigned c:1; //True if the c segment is on. - unsigned d:1; //True if the d segment is on. - unsigned e:1; //True if the e segment is on. - unsigned f:1; //True if the f segment is on. - unsigned g:1; //True if the g segment is on. - unsigned reserved:25; //This element is reserved. -} LCDSegments; - -typedef struct LearnCalibrationOptions_struct { - CalibrationMode mode; //Specifies the type of algorithm you want to use to reduce distortion in your image. - ScalingMethod method; //Defines the scaling method correction functions use to correct the image. - CalibrationROI roi; //Specifies the ROI correction functions use when correcting an image. - int learnMap; //Set this element to TRUE if you want the function to calculate and store an error map during the learning process. - int learnTable; //Set this element to TRUE if you want the function to calculate and store the correction table. -} LearnCalibrationOptions; - -typedef struct LearnColorPatternOptions_struct { - LearningMode learnMode; //Specifies the invariance mode the function uses when learning the pattern. - ImageFeatureMode featureMode; //Specifies the features the function uses when learning the color pattern. - int threshold; //Specifies the saturation threshold the function uses to distinguish between two colors that have the same hue values. - ColorIgnoreMode ignoreMode; //Specifies whether the function excludes certain colors from the color features of the template image. - ColorInformation* colorsToIgnore; //An array of ColorInformation structures providing a set of colors to exclude from the color features of the template image. - int numColorsToIgnore; //The number of ColorInformation structures in the colorsToIgnore array. -} LearnColorPatternOptions; - -typedef struct Line_struct { - Point start; //The coordinate location of the start of the line. - Point end; //The coordinate location of the end of the line. -} Line; - -typedef struct LinearAverages_struct { - float* columnAverages; //An array containing the mean pixel value of each column. - int columnCount; //The number of elements in the columnAverages array. - float* rowAverages; //An array containing the mean pixel value of each row. - int rowCount; //The number of elements in the rowAverages array. - float* risingDiagAverages; //An array containing the mean pixel value of each diagonal running from the lower left to the upper right of the inspected area of the image. - int risingDiagCount; //The number of elements in the risingDiagAverages array. - float* fallingDiagAverages; //An array containing the mean pixel value of each diagonal running from the upper left to the lower right of the inspected area of the image. - int fallingDiagCount; //The number of elements in the fallingDiagAverages array. -} LinearAverages; - -typedef struct LineProfile_struct { - float* profileData; //An array containing the value of each pixel in the line. - Rect boundingBox; //The bounding rectangle of the line. - float min; //The smallest pixel value in the line profile. - float max; //The largest pixel value in the line profile. - float mean; //The mean value of the pixels in the line profile. - float stdDev; //The standard deviation of the line profile. - int dataCount; //The size of the profileData array. -} LineProfile; - -typedef struct MatchColorPatternOptions_struct { - MatchingMode matchMode; //Specifies the method to use when looking for the color pattern in the image. - ImageFeatureMode featureMode; //Specifies the features to use when looking for the color pattern in the image. - int minContrast; //Specifies the minimum contrast expected in the image. - int subpixelAccuracy; //Set this parameter to TRUE to return areas in the image that match the pattern area with subpixel accuracy. - RotationAngleRange* angleRanges; //An array of angle ranges, in degrees, where each range specifies how much you expect the pattern to be rotated in the image. - int numRanges; //Number of angle ranges in the angleRanges array. - double colorWeight; //Determines the percent contribution of the color score to the final color pattern matching score. - ColorSensitivity sensitivity; //Specifies the sensitivity of the color information in the image. - SearchStrategy strategy; //Specifies how the color features of the image are used during the search phase. - int numMatchesRequested; //Number of valid matches expected. - float minMatchScore; //The minimum score a match can have for the function to consider the match valid. -} MatchColorPatternOptions; - -typedef struct HistogramReport_struct { - int* histogram; //An array describing the number of pixels that fell into each class. - int histogramCount; //The number of elements in the histogram array. - float min; //The smallest pixel value that the function classified. - float max; //The largest pixel value that the function classified. - float start; //The smallest pixel value that fell into the first class. - float width; //The size of each class. - float mean; //The mean value of the pixels that the function classified. - float stdDev; //The standard deviation of the pixels that the function classified. - int numPixels; //The number of pixels that the function classified. -} HistogramReport; - -typedef struct ArcInfo_struct { - Rect boundingBox; //The coordinate location of the bounding box of the arc. - double startAngle; //The counterclockwise angle from the x-axis in degrees to the start of the arc. - double endAngle; //The counterclockwise angle from the x-axis in degrees to the end of the arc. -} ArcInfo; - -typedef struct AxisReport_struct { - PointFloat origin; //The origin of the coordinate system, which is the intersection of the two axes of the coordinate system. - PointFloat mainAxisEnd; //The end of the main axis, which is the result of the computation of the intersection of the main axis with the rectangular search area. - PointFloat secondaryAxisEnd; //The end of the secondary axis, which is the result of the computation of the intersection of the secondary axis with the rectangular search area. -} AxisReport; - -typedef struct BarcodeInfo_struct { - const char* outputString; //A string containing the decoded barcode data. - int size; //The size of the output string. - char outputChar1; //The contents of this character depend on the barcode type. - char outputChar2; //The contents of this character depend on the barcode type. - double confidenceLevel; //A quality measure of the decoded barcode ranging from 0 to 100, with 100 being the best. - BarcodeType type; //The type of barcode. -} BarcodeInfo; - -typedef struct BCGOptions_struct { - float brightness; //Adjusts the brightness of the image. - float contrast; //Adjusts the contrast of the image. - float gamma; //Performs gamma correction. -} BCGOptions; - -typedef struct BestCircle_struct { - PointFloat center; //The coordinate location of the center of the circle. - double radius; //The radius of the circle. - double area; //The area of the circle. - double perimeter; //The length of the perimeter of the circle. - double error; //Represents the least square error of the fitted circle to the entire set of points. -} BestCircle; - -typedef struct BestEllipse_struct { - PointFloat center; //The coordinate location of the center of the ellipse. - PointFloat majorAxisStart; //The coordinate location of the start of the major axis of the ellipse. - PointFloat majorAxisEnd; //The coordinate location of the end of the major axis of the ellipse. - PointFloat minorAxisStart; //The coordinate location of the start of the minor axis of the ellipse. - PointFloat minorAxisEnd; //The coordinate location of the end of the minor axis of the ellipse. - double area; //The area of the ellipse. - double perimeter; //The length of the perimeter of the ellipse. -} BestEllipse; - -typedef struct BestLine_struct { - PointFloat start; //The coordinate location of the start of the line. - PointFloat end; //The coordinate location of the end of the line. - LineEquation equation; //Defines the three coefficients of the equation of the best fit line. - int valid; //This element is TRUE if the function achieved the minimum score within the number of allowed refinement iterations and FALSE if the function did not achieve the minimum score. - double error; //Represents the least square error of the fitted line to the entire set of points. - int* pointsUsed; //An array of the indexes for the points array indicating which points the function used to fit the line. - int numPointsUsed; //The number of points the function used to fit the line. -} BestLine; - -typedef struct BrowserOptions_struct { - int width; //The width to make the browser. - int height; //The height to make the browser image. - int imagesPerLine; //The number of images to place on a single line. - RGBValue backgroundColor; //The background color of the browser. - int frameSize; //Specifies the number of pixels with which to border each thumbnail. - BrowserFrameStyle style; //The style for the frame around each thumbnail. - float ratio; //Specifies the width to height ratio of each thumbnail. - RGBValue focusColor; //The color to use to display focused cells. -} BrowserOptions; - -typedef struct CoordinateSystem_struct { - PointFloat origin; //The origin of the coordinate system. - float angle; //The angle, in degrees, of the x-axis of the coordinate system relative to the image x-axis. - AxisOrientation axisOrientation; //The direction of the y-axis of the coordinate reference system. -} CoordinateSystem; - -typedef struct CalibrationInfo_struct { - float* errorMap; //The error map for the calibration. - int mapColumns; //The number of columns in the error map. - int mapRows; //The number of rows in the error map. - ROI* userRoi; //Specifies the ROI the user provided when learning the calibration. - ROI* calibrationRoi; //Specifies the ROI that corresponds to the region of the image where the calibration information is accurate. - LearnCalibrationOptions options; //Specifies the calibration options the user provided when learning the calibration. - GridDescriptor grid; //Specifies the scaling constants for the image. - CoordinateSystem system; //Specifies the coordinate system for the real world coordinates. - RangeFloat range; //The range of the grayscale the function used to represent the circles in the grid image. - float quality; //The quality score of the learning process, which is a value between 0-1000. -} CalibrationInfo; - -typedef struct CalibrationPoints_struct { - PointFloat* pixelCoordinates; //The array of pixel coordinates. - PointFloat* realWorldCoordinates; //The array of corresponding real-world coordinates. - int numCoordinates; //The number of coordinates in both of the arrays. -} CalibrationPoints; - -typedef struct CaliperOptions_struct { - TwoEdgePolarityType polarity; //Specifies the edge polarity of the edge pairs. - float separation; //The distance between edge pairs. - float separationDeviation; //Sets the range around the separation value. -} CaliperOptions; - -typedef struct CaliperReport_struct { - float edge1Contrast; //The contrast of the first edge. - PointFloat edge1Coord; //The coordinates of the first edge. - float edge2Contrast; //The contrast of the second edge. - PointFloat edge2Coord; //The coordinates of the second edge. - float separation; //The distance between the two edges. - float reserved; //This element is reserved. -} CaliperReport; - -typedef struct DrawTextOptions_struct { - char fontName[32]; //The font name to use. - int fontSize; //The size of the font. - int bold; //Set this parameter to TRUE to bold text. - int italic; //Set this parameter to TRUE to italicize text. - int underline; //Set this parameter to TRUE to underline text. - int strikeout; //Set this parameter to TRUE to strikeout text. - TextAlignment textAlignment; //Sets the alignment of text. - FontColor fontColor; //Sets the font color. -} DrawTextOptions; - -typedef struct CircleReport_struct { - Point center; //The coordinate point of the center of the circle. - int radius; //The radius of the circle, in pixels. - int area; //The area of the circle, in pixels. -} CircleReport; - -typedef struct ClosedContour_struct { - Point* points; //The points that make up the closed contour. - int numPoints; //The number of points in the array. -} ClosedContour; - -typedef struct ColorHistogramReport_struct { - HistogramReport plane1; //The histogram report of the first color plane. - HistogramReport plane2; //The histogram report of the second plane. - HistogramReport plane3; //The histogram report of the third plane. -} ColorHistogramReport; - -typedef struct ColorInformation_struct { - int infoCount; //The size of the info array. - int saturation; //The saturation level the function uses to learn the color information. - double* info; //An array of color information that represents the color spectrum analysis of a region of an image in a compact form. -} ColorInformation; - -typedef struct Complex_struct { - float r; //The real part of the value. - float i; //The imaginary part of the value. -} Complex; - -typedef struct ConcentricRakeReport_struct { - ArcInfo* rakeArcs; //An array containing the location of each concentric arc line used for edge detection. - int numArcs; //The number of arc lines in the rakeArcs array. - PointFloat* firstEdges; //The coordinate location of all edges detected as first edges. - int numFirstEdges; //The number of points in the first edges array. - PointFloat* lastEdges; //The coordinate location of all edges detected as last edges. - int numLastEdges; //The number of points in the last edges array. - EdgeLocationReport* allEdges; //An array of reports describing the location of the edges located by each concentric rake arc line. - int* linesWithEdges; //An array of indices into the rakeArcs array indicating the concentric rake arc lines on which the function detected at least one edge. - int numLinesWithEdges; //The number of concentric rake arc lines along which the function detected edges. -} ConcentricRakeReport; - -typedef struct ConstructROIOptions_struct { - int windowNumber; //The window number of the image window. - const char* windowTitle; //Specifies the message string that the function displays in the title bar of the window. - PaletteType type; //The palette type to use. - RGBValue* palette; //If type is IMAQ_PALETTE_USER, this array is the palette of colors to use with the window. - int numColors; //If type is IMAQ_PALETTE_USER, this element is the number of colors in the palette array. -} ConstructROIOptions; - -typedef struct ContourInfo_struct { - ContourType type; //The contour type. - unsigned numPoints; //The number of points that make up the contour. - Point* points; //The points describing the contour. - RGBValue contourColor; //The contour color. -} ContourInfo; - -typedef union ContourUnion_union { - Point* point; //Use this member when the contour is of type IMAQ_POINT. - Line* line; //Use this member when the contour is of type IMAQ_LINE. - Rect* rect; //Use this member when the contour is of type IMAQ_RECT. - Rect* ovalBoundingBox; //Use this member when the contour is of type IMAQ_OVAL. - ClosedContour* closedContour; //Use this member when the contour is of type IMAQ_CLOSED_CONTOUR. - OpenContour* openContour; //Use this member when the contour is of type IMAQ_OPEN_CONTOUR. - Annulus* annulus; //Use this member when the contour is of type IMAQ_ANNULUS. - RotatedRect* rotatedRect; //Use this member when the contour is of type IMAQ_ROTATED_RECT. -} ContourUnion; - -typedef struct ContourInfo2_struct { - ContourType type; //The contour type. - RGBValue color; //The contour color. - ContourUnion structure; //The information necessary to describe the contour in coordinate space. -} ContourInfo2; - -typedef struct ContourPoint_struct { - double x; //The x-coordinate value in the image. - double y; //The y-coordinate value in the image. - double curvature; //The change in slope at this edge point of the segment. - double xDisplacement; //The x displacement of the current edge pixel from a cubic spline fit of the current edge segment. - double yDisplacement; //The y displacement of the current edge pixel from a cubic spline fit of the current edge segment. -} ContourPoint; - -typedef struct CoordinateTransform_struct { - Point initialOrigin; //The origin of the initial coordinate system. - float initialAngle; //The angle, in degrees, of the x-axis of the initial coordinate system relative to the image x-axis. - Point finalOrigin; //The origin of the final coordinate system. - float finalAngle; //The angle, in degrees, of the x-axis of the final coordinate system relative to the image x-axis. -} CoordinateTransform; - -typedef struct CoordinateTransform2_struct { - CoordinateSystem referenceSystem; //Defines the coordinate system for input coordinates. - CoordinateSystem measurementSystem; //Defines the coordinate system in which the function should perform measurements. -} CoordinateTransform2; - -typedef struct CannyOptions_struct { - float sigma; //The sigma of the Gaussian smoothing filter that the function applies to the image before edge detection. - float upperThreshold; //The upper fraction of pixel values in the image from which the function chooses a seed or starting point of an edge segment. - float lowerThreshold; //The function multiplies this value by upperThreshold to determine the lower threshold for all the pixels in an edge segment. - int windowSize; //The window size of the Gaussian filter that the function applies to the image. -} CannyOptions; - -typedef struct Range_struct { - int minValue; //The minimum value of the range. - int maxValue; //The maximum value of the range. -} Range; - -typedef struct UserPointSymbol_struct { - int cols; //Number of columns in the symbol. - int rows; //Number of rows in the symbol. - int* pixels; //The pixels of the symbol. -} UserPointSymbol; - -typedef struct View3DOptions_struct { - int sizeReduction; //A divisor the function uses when determining the final height and width of the 3D image. - int maxHeight; //Defines the maximum height of a pixel from the image source drawn in 3D. - Direction3D direction; //Defines the 3D orientation. - float alpha; //Determines the angle between the horizontal and the baseline. - float beta; //Determines the angle between the horizontal and the second baseline. - int border; //Defines the border size. - int background; //Defines the background color. - Plane3D plane; //Indicates the view a function uses to show complex images. -} View3DOptions; - -typedef struct MatchPatternOptions_struct { - MatchingMode mode; //Specifies the method to use when looking for the pattern in the image. - int minContrast; //Specifies the minimum contrast expected in the image. - int subpixelAccuracy; //Set this element to TRUE to return areas in the image that match the pattern area with subpixel accuracy. - RotationAngleRange* angleRanges; //An array of angle ranges, in degrees, where each range specifies how much you expect the pattern to be rotated in the image. - int numRanges; //Number of angle ranges in the angleRanges array. - int numMatchesRequested; //Number of valid matches expected. - int matchFactor; //Controls the number of potential matches that the function examines. - float minMatchScore; //The minimum score a match can have for the function to consider the match valid. -} MatchPatternOptions; - -typedef struct TIFFFileOptions_struct { - int rowsPerStrip; //Indicates the number of rows that the function writes per strip. - PhotometricMode photoInterp; //Designates which photometric interpretation to use. - TIFFCompressionType compressionType; //Indicates the type of compression to use on the TIFF file. -} TIFFFileOptions; - -typedef union Color_union { - RGBValue rgb; //The information needed to describe a color in the RGB (Red, Green, and Blue) color space. - HSLValue hsl; //The information needed to describe a color in the HSL (Hue, Saturation, and Luminance) color space. - HSVValue hsv; //The information needed to describe a color in the HSI (Hue, Saturation, and Value) color space. - HSIValue hsi; //The information needed to describe a color in the HSI (Hue, Saturation, and Intensity) color space. - int rawValue; //The integer value for the data in the color union. -} Color; - -typedef union PixelValue_union { - float grayscale; //A grayscale pixel value. - RGBValue rgb; //A RGB pixel value. - HSLValue hsl; //A HSL pixel value. - Complex complex; //A complex pixel value. - RGBU64Value rgbu64; //An unsigned 64-bit RGB pixel value. -} PixelValue; - -typedef struct OpenContour_struct { - Point* points; //The points that make up the open contour. - int numPoints; //The number of points in the array. -} OpenContour; - -typedef struct OverlayTextOptions_struct { - const char* fontName; //The name of the font to use. - int fontSize; //The size of the font. - int bold; //Set this element to TRUE to bold the text. - int italic; //Set this element to TRUE to italicize the text. - int underline; //Set this element to TRUE to underline the text. - int strikeout; //Set this element to TRUE to strikeout the text. - TextAlignment horizontalTextAlignment; //Sets the alignment of the text. - VerticalTextAlignment verticalTextAlignment; //Sets the vertical alignment for the text. - RGBValue backgroundColor; //Sets the color for the text background pixels. - double angle; //The counterclockwise angle, in degrees, of the text relative to the x-axis. -} OverlayTextOptions; - -typedef struct ParticleFilterCriteria_struct { - MeasurementValue parameter; //The morphological measurement that the function uses for filtering. - float lower; //The lower bound of the criteria range. - float upper; //The upper bound of the criteria range. - int exclude; //Set this element to TRUE to indicate that a match occurs when the value is outside the criteria range. -} ParticleFilterCriteria; - -typedef struct ParticleReport_struct { - int area; //The number of pixels in the particle. - float calibratedArea; //The size of the particle, calibrated to the calibration information of the image. - float perimeter; //The length of the perimeter, calibrated to the calibration information of the image. - int numHoles; //The number of holes in the particle. - int areaOfHoles; //The total surface area, in pixels, of all the holes in a particle. - float perimeterOfHoles; //The length of the perimeter of all the holes in the particle calibrated to the calibration information of the image. - Rect boundingBox; //The smallest rectangle that encloses the particle. - float sigmaX; //The sum of the particle pixels on the x-axis. - float sigmaY; //The sum of the particle pixels on the y-axis. - float sigmaXX; //The sum of the particle pixels on the x-axis, squared. - float sigmaYY; //The sum of the particle pixels on the y-axis, squared. - float sigmaXY; //The sum of the particle pixels on the x-axis and y-axis. - int longestLength; //The length of the longest horizontal line segment. - Point longestPoint; //The location of the leftmost pixel of the longest segment in the particle. - int projectionX; //The length of the particle when projected onto the x-axis. - int projectionY; //The length of the particle when projected onto the y-axis. - int connect8; //This element is TRUE if the function used connectivity-8 to determine if particles are touching. -} ParticleReport; - -typedef struct PatternMatch_struct { - PointFloat position; //The location of the center of the match. - float rotation; //The rotation of the match relative to the template image, in degrees. - float scale; //The size of the match relative to the size of the template image, expressed as a percentage. - float score; //The accuracy of the match. - PointFloat corner[4]; //An array of four points describing the rectangle surrounding the template image. -} PatternMatch; - -typedef struct QuantifyData_struct { - float mean; //The mean value of the pixel values. - float stdDev; //The standard deviation of the pixel values. - float min; //The smallest pixel value. - float max; //The largest pixel value. - float calibratedArea; //The area, calibrated to the calibration information of the image. - int pixelArea; //The area, in number of pixels. - float relativeSize; //The proportion, expressed as a percentage, of the associated region relative to the whole image. -} QuantifyData; - -typedef struct QuantifyReport_struct { - QuantifyData global; //Statistical data of the whole image. - QuantifyData* regions; //An array of QuantifyData structures containing statistical data of each region of the image. - int regionCount; //The number of regions. -} QuantifyReport; - -typedef struct RakeOptions_struct { - int threshold; //Specifies the threshold value for the contrast of the edge. - int width; //The number of pixels that the function averages to find the contrast at either side of the edge. - int steepness; //The span, in pixels, of the slope of the edge projected along the path specified by the input points. - int subsamplingRatio; //Specifies the number of pixels that separate two consecutive search lines. - InterpolationMethod subpixelType; //The method for interpolating. - int subpixelDivisions; //The number of samples the function obtains from a pixel. -} RakeOptions; - -typedef struct RakeReport_struct { - LineFloat* rakeLines; //The coordinate location of each of the rake lines used by the function. - int numRakeLines; //The number of lines in the rakeLines array. - PointFloat* firstEdges; //The coordinate location of all edges detected as first edges. - unsigned int numFirstEdges; //The number of points in the firstEdges array. - PointFloat* lastEdges; //The coordinate location of all edges detected as last edges. - unsigned int numLastEdges; //The number of points in the lastEdges array. - EdgeLocationReport* allEdges; //An array of reports describing the location of the edges located by each rake line. - int* linesWithEdges; //An array of indices into the rakeLines array indicating the rake lines on which the function detected at least one edge. - int numLinesWithEdges; //The number of rake lines along which the function detected edges. -} RakeReport; - -typedef struct TransformReport_struct { - PointFloat* points; //An array of transformed coordinates. - int* validPoints; //An array of values that describe the validity of each of the coordinates according to the region of interest you calibrated using either imaqLearnCalibrationGrid() or imaqLearnCalibrationPoints(). - int numPoints; //The length of both the points array and the validPoints array. -} TransformReport; - -typedef struct ShapeReport_struct { - Rect coordinates; //The bounding rectangle of the object. - Point centroid; //The coordinate location of the centroid of the object. - int size; //The size, in pixels, of the object. - double score; //A value ranging between 1 and 1,000 that specifies how similar the object in the image is to the template. -} ShapeReport; - -typedef struct MeterArc_struct { - PointFloat needleBase; //The coordinate location of the base of the meter needle. - PointFloat* arcCoordPoints; //An array of points describing the coordinate location of the meter arc. - int numOfArcCoordPoints; //The number of points in the arcCoordPoints array. - int needleColor; //This element is TRUE when the meter has a light-colored needle on a dark background. -} MeterArc; - -typedef struct ThresholdData_struct { - float rangeMin; //The lower boundary of the range to keep. - float rangeMax; //The upper boundary of the range to keep. - float newValue; //If useNewValue is TRUE, newValue is the replacement value for pixels within the range. - int useNewValue; //If TRUE, the function sets pixel values within [rangeMin, rangeMax] to the value specified in newValue. -} ThresholdData; - -typedef struct StructuringElement_struct { - int matrixCols; //Number of columns in the matrix. - int matrixRows; //Number of rows in the matrix. - int hexa; //Set this element to TRUE if you specify a hexagonal structuring element in kernel. - int* kernel; //The values of the structuring element. -} StructuringElement; - -typedef struct SpokeReport_struct { - LineFloat* spokeLines; //The coordinate location of each of the spoke lines used by the function. - int numSpokeLines; //The number of lines in the spokeLines array. - PointFloat* firstEdges; //The coordinate location of all edges detected as first edges. - int numFirstEdges; //The number of points in the firstEdges array. - PointFloat* lastEdges; //The coordinate location of all edges detected as last edges. - int numLastEdges; //The number of points in the lastEdges array. - EdgeLocationReport* allEdges; //An array of reports describing the location of the edges located by each spoke line. - int* linesWithEdges; //An array of indices into the spokeLines array indicating the rake lines on which the function detected at least one edge. - int numLinesWithEdges; //The number of spoke lines along which the function detects edges. -} SpokeReport; - -typedef struct SimpleEdgeOptions_struct { - LevelType type; //Determines how the function evaluates the threshold and hysteresis values. - int threshold; //The pixel value at which an edge occurs. - int hysteresis; //A value that helps determine edges in noisy images. - EdgeProcess process; //Determines which edges the function looks for. - int subpixel; //Set this element to TRUE to find edges with subpixel accuracy by interpolating between points to find the crossing of the given threshold. -} SimpleEdgeOptions; - -typedef struct SelectParticleCriteria_struct { - MeasurementValue parameter; //The morphological measurement that the function uses for filtering. - float lower; //The lower boundary of the criteria range. - float upper; //The upper boundary of the criteria range. -} SelectParticleCriteria; - -typedef struct SegmentInfo_struct { - int numberOfPoints; //The number of points in the segment. - int isOpen; //If TRUE, the contour is open. - double weight; //The significance of the edge in terms of the gray values that constitute the edge. - ContourPoint* points; //The points of the segment. -} SegmentInfo; - -typedef struct RotationAngleRange_struct { - float lower; //The lowest amount of rotation, in degrees, a valid pattern can have. - float upper; //The highest amount of rotation, in degrees, a valid pattern can have. -} RotationAngleRange; - -typedef struct RotatedRect_struct { - int top; //Location of the top edge of the rectangle before rotation. - int left; //Location of the left edge of the rectangle before rotation. - int height; //Height of the rectangle. - int width; //Width of the rectangle. - double angle; //The rotation, in degrees, of the rectangle. -} RotatedRect; - -typedef struct ROIProfile_struct { - LineProfile report; //Quantifying information about the points along the edge of each contour in the ROI. - Point* pixels; //An array of the points along the edge of each contour in the ROI. -} ROIProfile; - -typedef struct ToolWindowOptions_struct { - int showSelectionTool; //If TRUE, the selection tool becomes visible. - int showZoomTool; //If TRUE, the zoom tool becomes visible. - int showPointTool; //If TRUE, the point tool becomes visible. - int showLineTool; //If TRUE, the line tool becomes visible. - int showRectangleTool; //If TRUE, the rectangle tool becomes visible. - int showOvalTool; //If TRUE, the oval tool becomes visible. - int showPolygonTool; //If TRUE, the polygon tool becomes visible. - int showClosedFreehandTool; //If TRUE, the closed freehand tool becomes visible. - int showPolyLineTool; //If TRUE, the polyline tool becomes visible. - int showFreehandTool; //If TRUE, the freehand tool becomes visible. - int showAnnulusTool; //If TRUE, the annulus becomes visible. - int showRotatedRectangleTool; //If TRUE, the rotated rectangle tool becomes visible. - int showPanTool; //If TRUE, the pan tool becomes visible. - int showZoomOutTool; //If TRUE, the zoom out tool becomes visible. - int reserved2; //This element is reserved and should be set to FALSE. - int reserved3; //This element is reserved and should be set to FALSE. - int reserved4; //This element is reserved and should be set to FALSE. -} ToolWindowOptions; - -typedef struct SpokeOptions_struct { - int threshold; //Specifies the threshold value for the contrast of the edge. - int width; //The number of pixels that the function averages to find the contrast at either side of the edge. - int steepness; //The span, in pixels, of the slope of the edge projected along the path specified by the input points. - double subsamplingRatio; //The angle, in degrees, between each radial search line in the spoke. - InterpolationMethod subpixelType; //The method for interpolating. - int subpixelDivisions; //The number of samples the function obtains from a pixel. -} SpokeOptions; - -#if !defined __GNUC__ && !defined _M_X64 -#pragma pack(pop) -#endif - -//============================================================================ -// Callback Function Type -//============================================================================ -#ifndef __GNUC__ -typedef void (IMAQ_CALLBACK* EventCallback)(WindowEventType event, int windowNumber, Tool tool, Rect rect); -#endif - -//============================================================================ -// Globals -//============================================================================ -#ifndef __GNUC__ -#pragma const_seg("IMAQVisionColorConstants") -#endif -static const RGBValue IMAQ_RGB_TRANSPARENT = { 0, 0, 0, 1 }; -static const RGBValue IMAQ_RGB_RED = { 0, 0, 255, 0 }; -static const RGBValue IMAQ_RGB_BLUE = { 255, 0, 0, 0 }; -static const RGBValue IMAQ_RGB_GREEN = { 0, 255, 0, 0 }; -static const RGBValue IMAQ_RGB_YELLOW = { 0, 255, 255, 0 }; -static const RGBValue IMAQ_RGB_WHITE = { 255, 255, 255, 0 }; -static const RGBValue IMAQ_RGB_BLACK = { 0, 0, 0, 0 }; -#ifndef __GNUC__ -#pragma const_seg() -#endif - -//============================================================================ -// Backwards Compatibility -//============================================================================ -typedef ColorSensitivity ColorComplexity; -#define IMAQ_COMPLEXITY_LOW IMAQ_SENSITIVITY_LOW -#define IMAQ_COMPLEXITY_MED IMAQ_SENSITIVITY_MED -#define IMAQ_COMPLEXITY_HIGH IMAQ_SENSITIVITY_HIGH -#define ERR_INVALID_COLORCOMPLEXITY ERR_INVALID_COLORSENSITIVITY - -//============================================================================ -// Logical functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAnd(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqAndConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqCompare(Image* dest, const Image* source, const Image* compareImage, ComparisonFunction compare); -IMAQ_FUNC int IMAQ_STDCALL imaqCompareConstant(Image* dest, const Image* source, PixelValue value, ComparisonFunction compare); -IMAQ_FUNC int IMAQ_STDCALL imaqLogicalDifference(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqLogicalDifferenceConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqNand(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqNandConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqNor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqNorConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqOr(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqOrConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqXnor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqXnorConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqXor(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqXorConstant(Image* dest, const Image* source, PixelValue value); - -//============================================================================ -// Particle Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCountParticles(Image* image, int connectivity8, int* numParticles); -IMAQ_FUNC int IMAQ_STDCALL imaqMeasureParticle(Image* image, int particleNumber, int calibrated, MeasurementType measurement, double* value); -IMAQ_FUNC MeasureParticlesReport* IMAQ_STDCALL imaqMeasureParticles(Image* image, MeasureParticlesCalibrationMode calibrationMode, const MeasurementType* measurements, size_t numMeasurements); -IMAQ_FUNC int IMAQ_STDCALL imaqParticleFilter4(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, const ParticleFilterOptions2* options, const ROI* roi, int* numParticles); - -//============================================================================ -// Morphology functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqConvexHull(Image* dest, Image* source, int connectivity8); -IMAQ_FUNC int IMAQ_STDCALL imaqDanielssonDistance(Image* dest, Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqFillHoles(Image* dest, const Image* source, int connectivity8); -IMAQ_FUNC CircleReport* IMAQ_STDCALL imaqFindCircles(Image* dest, Image* source, float minRadius, float maxRadius, int* numCircles); -IMAQ_FUNC int IMAQ_STDCALL imaqLabel2(Image* dest, Image* source, int connectivity8, int* particleCount); -IMAQ_FUNC int IMAQ_STDCALL imaqMorphology(Image* dest, Image* source, MorphologyMethod method, const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL imaqRejectBorder(Image* dest, Image* source, int connectivity8); -IMAQ_FUNC int IMAQ_STDCALL imaqSegmentation(Image* dest, Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqSeparation(Image* dest, Image* source, int erosions, const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL imaqSimpleDistance(Image* dest, Image* source, const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL imaqSizeFilter(Image* dest, Image* source, int connectivity8, int erosions, SizeType keepSize, const StructuringElement* structuringElement); -IMAQ_FUNC int IMAQ_STDCALL imaqSkeleton(Image* dest, Image* source, SkeletonMethod method); - - -//============================================================================ -// Acquisition functions -//============================================================================ -IMAQ_FUNC Image* IMAQ_STDCALL imaqCopyFromRing(SESSION_ID sessionID, Image* image, int imageToCopy, int* imageNumber, Rect rect); -IMAQ_FUNC Image* IMAQ_STDCALL imaqEasyAcquire(const char* interfaceName); -IMAQ_FUNC Image* IMAQ_STDCALL imaqExtractFromRing(SESSION_ID sessionID, int imageToExtract, int* imageNumber); -IMAQ_FUNC Image* IMAQ_STDCALL imaqGrab(SESSION_ID sessionID, Image* image, int immediate); -IMAQ_FUNC int IMAQ_STDCALL imaqReleaseImage(SESSION_ID sessionID); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupGrab(SESSION_ID sessionID, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupRing(SESSION_ID sessionID, Image** images, int numImages, int skipCount, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupSequence(SESSION_ID sessionID, Image** images, int numImages, int skipCount, Rect rect); -IMAQ_FUNC Image* IMAQ_STDCALL imaqSnap(SESSION_ID sessionID, Image* image, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqStartAcquisition(SESSION_ID sessionID); -IMAQ_FUNC int IMAQ_STDCALL imaqStopAcquisition(SESSION_ID sessionID); - -//============================================================================ -// Arithmetic functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAbsoluteDifference(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqAbsoluteDifferenceConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqAdd(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqAddConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqAverage(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqAverageConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqDivide2(Image* dest, const Image* sourceA, const Image* sourceB, RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL imaqDivideConstant2(Image* dest, const Image* source, PixelValue value, RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL imaqMax(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqMaxConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqMin(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqMinConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqModulo(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqModuloConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqMulDiv(Image* dest, const Image* sourceA, const Image* sourceB, float value); -IMAQ_FUNC int IMAQ_STDCALL imaqMultiply(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqMultiplyConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqSubtract(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC int IMAQ_STDCALL imaqSubtractConstant(Image* dest, const Image* source, PixelValue value); - -//============================================================================ -// Caliper functions -//============================================================================ -IMAQ_FUNC CaliperReport* IMAQ_STDCALL imaqCaliperTool(const Image* image, const Point* points, int numPoints, const EdgeOptions* edgeOptions, const CaliperOptions* caliperOptions, int* numEdgePairs); -IMAQ_FUNC ConcentricRakeReport2* IMAQ_STDCALL imaqConcentricRake2(Image* image, ROI* roi, ConcentricRakeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions); -IMAQ_FUNC ExtremeReport* IMAQ_STDCALL imaqDetectExtremes(const double* pixels, int numPixels, DetectionMode mode, const DetectExtremesOptions* options, int* numExtremes); -IMAQ_FUNC int IMAQ_STDCALL imaqDetectRotation(const Image* referenceImage, const Image* testImage, PointFloat referenceCenter, PointFloat testCenter, int radius, float precision, double* angle); -IMAQ_FUNC EdgeReport2* IMAQ_STDCALL imaqEdgeTool4(Image* image, ROI* roi, EdgeProcess processType, EdgeOptions2* edgeOptions, const unsigned int reverseDirection); -IMAQ_FUNC FindEdgeReport* IMAQ_STDCALL imaqFindEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindEdgeOptions2* findEdgeOptions, const StraightEdgeOptions* straightEdgeOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqFindTransformRect2(Image* image, const ROI* roi, FindTransformMode mode, CoordinateSystem* baseSystem, CoordinateSystem* newSystem, const FindTransformRectOptions2* findTransformOptions, const StraightEdgeOptions* straightEdgeOptions, AxisReport* axisReport); -IMAQ_FUNC int IMAQ_STDCALL imaqFindTransformRects2(Image* image, const ROI* primaryROI, const ROI* secondaryROI, FindTransformMode mode, CoordinateSystem* baseSystem, CoordinateSystem* newSystem, const FindTransformRectsOptions2* findTransformOptions, const StraightEdgeOptions* primaryStraightEdgeOptions, const StraightEdgeOptions* secondaryStraightEdgeOptions, AxisReport* axisReport); -IMAQ_FUNC int IMAQ_STDCALL imaqLineGaugeTool2(const Image* image, Point start, Point end, LineGaugeMethod method, const EdgeOptions* edgeOptions, const CoordinateTransform2* transform, float* distance); -IMAQ_FUNC RakeReport2* IMAQ_STDCALL imaqRake2(Image* image, ROI* roi, RakeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions); -IMAQ_FUNC PointFloat* IMAQ_STDCALL imaqSimpleEdge(const Image* image, const Point* points, int numPoints, const SimpleEdgeOptions* options, int* numEdges); -IMAQ_FUNC SpokeReport2* IMAQ_STDCALL imaqSpoke2(Image* image, ROI* roi, SpokeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions); -IMAQ_FUNC StraightEdgeReport2* IMAQ_STDCALL imaqStraightEdge(const Image* image, const ROI* roi, SearchDirection searchDirection, const EdgeOptions2* edgeOptions, const StraightEdgeOptions* straightEdgeOptions); -IMAQ_FUNC StraightEdgeReport2* IMAQ_STDCALL imaqStraightEdge2(const Image* image, const ROI* roi, SearchDirection searchDirection, const EdgeOptions2* edgeOptions, const StraightEdgeOptions* straightEdgeOptions, unsigned int optimizedMode); - -//============================================================================ -// Spatial Filters functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCannyEdgeFilter(Image* dest, const Image* source, const CannyOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqConvolve2(Image* dest, Image* source, float* kernel, int matrixRows, int matrixCols, float normalize, Image* mask, RoundingMode roundingMode); -IMAQ_FUNC int IMAQ_STDCALL imaqCorrelate(Image* dest, Image* source, const Image* templateImage, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqEdgeFilter(Image* dest, Image* source, OutlineMethod method, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqLowPass(Image* dest, Image* source, int width, int height, float tolerance, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqMedianFilter(Image* dest, Image* source, int width, int height, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqNthOrderFilter(Image* dest, Image* source, int width, int height, int n, const Image* mask); - -//============================================================================ -// Drawing functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqDrawLineOnImage(Image* dest, const Image* source, DrawMode mode, Point start, Point end, float newPixelValue); -IMAQ_FUNC int IMAQ_STDCALL imaqDrawShapeOnImage(Image* dest, const Image* source, Rect rect, DrawMode mode, ShapeMode shape, float newPixelValue); -IMAQ_FUNC int IMAQ_STDCALL imaqDrawTextOnImage(Image* dest, const Image* source, Point coord, const char* text, const DrawTextOptions* options, int* fontNameUsed); - -//============================================================================ -// Interlacing functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqInterlaceCombine(Image* frame, const Image* odd, const Image* even); -IMAQ_FUNC int IMAQ_STDCALL imaqInterlaceSeparate(const Image* frame, Image* odd, Image* even); - -//============================================================================ -// Image Information functions -//============================================================================ -IMAQ_FUNC char** IMAQ_STDCALL imaqEnumerateCustomKeys(const Image* image, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL imaqGetBitDepth(const Image* image, unsigned int* bitDepth); -IMAQ_FUNC int IMAQ_STDCALL imaqGetBytesPerPixel(const Image* image, int* byteCount); -IMAQ_FUNC int IMAQ_STDCALL imaqGetImageInfo(const Image* image, ImageInfo* info); -IMAQ_FUNC int IMAQ_STDCALL imaqGetImageSize(const Image* image, int* width, int* height); -IMAQ_FUNC int IMAQ_STDCALL imaqGetImageType(const Image* image, ImageType* type); -IMAQ_FUNC int IMAQ_STDCALL imaqGetMaskOffset(const Image* image, Point* offset); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetPixelAddress(const Image* image, Point pixel); -IMAQ_FUNC int IMAQ_STDCALL imaqGetVisionInfoTypes(const Image* image, unsigned int* present); -IMAQ_FUNC int IMAQ_STDCALL imaqIsImageEmpty(const Image* image, int* empty); -IMAQ_FUNC void* IMAQ_STDCALL imaqReadCustomData(const Image* image, const char* key, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL imaqRemoveCustomData(Image* image, const char* key); -IMAQ_FUNC int IMAQ_STDCALL imaqRemoveVisionInfo2(const Image* image, unsigned int info); -IMAQ_FUNC int IMAQ_STDCALL imaqSetBitDepth(Image* image, unsigned int bitDepth); -IMAQ_FUNC int IMAQ_STDCALL imaqSetImageSize(Image* image, int width, int height); -IMAQ_FUNC int IMAQ_STDCALL imaqSetMaskOffset(Image* image, Point offset); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteCustomData(Image* image, const char* key, const void* data, unsigned int size); - -//============================================================================ -// Display functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAreToolsContextSensitive(int* sensitive); -IMAQ_FUNC int IMAQ_STDCALL imaqCloseWindow(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqDisplayImage(const Image* image, int windowNumber, int resize); -IMAQ_FUNC int IMAQ_STDCALL imaqGetLastKey(char* keyPressed, int* windowNumber, int* modifiers); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetSystemWindowHandle(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowCenterPos(int windowNumber, Point* centerPosition); -IMAQ_FUNC int IMAQ_STDCALL imaqSetToolContextSensitivity(int sensitive); -IMAQ_FUNC int IMAQ_STDCALL imaqShowWindow(int windowNumber, int visible); - -//============================================================================ -// Image Manipulation functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCast(Image* dest, const Image* source, ImageType type, const float* lookup, int shift); -IMAQ_FUNC int IMAQ_STDCALL imaqCopyRect(Image* dest, const Image* source, Rect rect, Point destLoc); -IMAQ_FUNC int IMAQ_STDCALL imaqDuplicate(Image* dest, const Image* source); -IMAQ_FUNC void* IMAQ_STDCALL imaqFlatten(const Image* image, FlattenType type, CompressionType compression, int quality, unsigned int* size); -IMAQ_FUNC int IMAQ_STDCALL imaqFlip(Image* dest, const Image* source, FlipAxis axis); -IMAQ_FUNC int IMAQ_STDCALL imaqMask(Image* dest, const Image* source, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqResample(Image* dest, const Image* source, int newWidth, int newHeight, InterpolationMethod method, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqRotate2(Image* dest, const Image* source, float angle, PixelValue fill, InterpolationMethod method, int maintainSize); -IMAQ_FUNC int IMAQ_STDCALL imaqScale(Image* dest, const Image* source, int xScale, int yScale, ScalingMode scaleMode, Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqShift(Image* dest, const Image* source, int shiftX, int shiftY, PixelValue fill); -IMAQ_FUNC int IMAQ_STDCALL imaqTranspose(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqUnflatten(Image* image, const void* data, unsigned int size); -IMAQ_FUNC int IMAQ_STDCALL imaqUnwrapImage(Image* dest, const Image* source, Annulus annulus, RectOrientation orientation, InterpolationMethod method); -IMAQ_FUNC int IMAQ_STDCALL imaqView3D(Image* dest, Image* source, const View3DOptions* options); - -//============================================================================ -// File I/O functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCloseAVI(AVISession session); -IMAQ_FUNC AVISession IMAQ_STDCALL imaqCreateAVI(const char* fileName, const char* compressionFilter, int quality, unsigned int framesPerSecond, unsigned int maxDataSize); -IMAQ_FUNC int IMAQ_STDCALL imaqGetAVIInfo(AVISession session, AVIInfo* info); -IMAQ_FUNC int IMAQ_STDCALL imaqGetFileInfo(const char* fileName, CalibrationUnit* calibrationUnit, float* calibrationX, float* calibrationY, int* width, int* height, ImageType* imageType); -IMAQ_FUNC FilterName* IMAQ_STDCALL imaqGetFilterNames(int* numFilters); -IMAQ_FUNC char** IMAQ_STDCALL imaqLoadImagePopup(const char* defaultDirectory, const char* defaultFileSpec, const char* fileTypeList, const char* title, int allowMultiplePaths, ButtonLabel buttonLabel, int restrictDirectory, int restrictExtension, int allowCancel, int allowMakeDirectory, int* cancelled, int* numPaths); -IMAQ_FUNC AVISession IMAQ_STDCALL imaqOpenAVI(const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL imaqReadAVIFrame(Image* image, AVISession session, unsigned int frameNum, void* data, unsigned int* dataSize); -IMAQ_FUNC int IMAQ_STDCALL imaqReadFile(Image* image, const char* fileName, RGBValue* colorTable, int* numColors); -IMAQ_FUNC int IMAQ_STDCALL imaqReadVisionFile(Image* image, const char* fileName, RGBValue* colorTable, int* numColors); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteAVIFrame(Image* image, AVISession session, const void* data, unsigned int dataLength); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteBMPFile(const Image* image, const char* fileName, int compress, const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteFile(const Image* image, const char* fileName, const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteJPEGFile(const Image* image, const char* fileName, unsigned int quality, void* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteJPEG2000File(const Image* image, const char* fileName, int lossless, float compressionRatio, const JPEG2000FileAdvancedOptions* advancedOptions, const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWritePNGFile2(const Image* image, const char* fileName, unsigned int compressionSpeed, const RGBValue* colorTable, int useBitDepth); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteTIFFFile(const Image* image, const char* fileName, const TIFFFileOptions* options, const RGBValue* colorTable); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteVisionFile(const Image* image, const char* fileName, const RGBValue* colorTable); - - -//============================================================================ -// Analytic Geometry functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqBuildCoordinateSystem(const Point* points, ReferenceMode mode, AxisOrientation orientation, CoordinateSystem* system); -IMAQ_FUNC BestCircle2* IMAQ_STDCALL imaqFitCircle2(const PointFloat* points, int numPoints, const FitCircleOptions* options); -IMAQ_FUNC BestEllipse2* IMAQ_STDCALL imaqFitEllipse2(const PointFloat* points, int numPoints, const FitEllipseOptions* options); -IMAQ_FUNC BestLine* IMAQ_STDCALL imaqFitLine(const PointFloat* points, int numPoints, const FitLineOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqGetAngle(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, float* angle); -IMAQ_FUNC int IMAQ_STDCALL imaqGetBisectingLine(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, PointFloat* bisectStart, PointFloat* bisectEnd); -IMAQ_FUNC int IMAQ_STDCALL imaqGetDistance(PointFloat point1, PointFloat point2, float* distance); -IMAQ_FUNC int IMAQ_STDCALL imaqGetIntersection(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, PointFloat* intersection); -IMAQ_FUNC int IMAQ_STDCALL imaqGetMidLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point, PointFloat* midLineStart, PointFloat* midLineEnd); -IMAQ_FUNC int IMAQ_STDCALL imaqGetPerpendicularLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point, PointFloat* perpLineStart, PointFloat* perpLineEnd, double* distance); -IMAQ_FUNC SegmentInfo* IMAQ_STDCALL imaqGetPointsOnContour(const Image* image, int* numSegments); -IMAQ_FUNC Point* IMAQ_STDCALL imaqGetPointsOnLine(Point start, Point end, int* numPoints); -IMAQ_FUNC int IMAQ_STDCALL imaqGetPolygonArea(const PointFloat* points, int numPoints, float* area); -IMAQ_FUNC float* IMAQ_STDCALL imaqInterpolatePoints(const Image* image, const Point* points, int numPoints, InterpolationMethod method, int subpixel, int* interpCount); - -//============================================================================ -// Clipboard functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClipboardToImage(Image* dest, RGBValue* palette); -IMAQ_FUNC int IMAQ_STDCALL imaqImageToClipboard(const Image* image, const RGBValue* palette); - -//============================================================================ -// Border functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqFillBorder(Image* image, BorderMethod method); -IMAQ_FUNC int IMAQ_STDCALL imaqGetBorderSize(const Image* image, int* borderSize); -IMAQ_FUNC int IMAQ_STDCALL imaqSetBorderSize(Image* image, int size); - -//============================================================================ -// Image Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqArrayToImage(Image* image, const void* array, int numCols, int numRows); -IMAQ_FUNC Image* IMAQ_STDCALL imaqCreateImage(ImageType type, int borderSize); -IMAQ_FUNC void* IMAQ_STDCALL imaqImageToArray(const Image* image, Rect rect, int* columns, int* rows); - -//============================================================================ -// Color Processing functions -//============================================================================ -IMAQ_FUNC Color2 IMAQ_STDCALL imaqChangeColorSpace2(const Color2* sourceColor, ColorMode sourceSpace, ColorMode destSpace, double offset, const CIEXYZValue* whiteReference); -IMAQ_FUNC int IMAQ_STDCALL imaqColorBCGTransform(Image* dest, const Image* source, const BCGOptions* redOptions, const BCGOptions* greenOptions, const BCGOptions* blueOptions, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqColorEqualize(Image* dest, const Image* source, int colorEqualization); -IMAQ_FUNC ColorHistogramReport* IMAQ_STDCALL imaqColorHistogram2(Image* image, int numClasses, ColorMode mode, const CIEXYZValue* whiteReference, Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqColorLookup(Image* dest, const Image* source, ColorMode mode, const Image* mask, const short* plane1, const short* plane2, const short* plane3); -IMAQ_FUNC int IMAQ_STDCALL imaqColorThreshold(Image* dest, const Image* source, int replaceValue, ColorMode mode, const Range* plane1Range, const Range* plane2Range, const Range* plane3Range); -IMAQ_FUNC SupervisedColorSegmentationReport* IMAQ_STDCALL imaqSupervisedColorSegmentation(ClassifierSession* session, Image* labelImage, const Image* srcImage, const ROI* roi, const ROILabel* labelIn, unsigned int numLabelIn, int maxDistance, int minIdentificationScore, const ColorSegmenationOptions* segmentOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqGetColorSegmentationMaxDistance(ClassifierSession* session, const ColorSegmenationOptions* segmentOptions, SegmentationDistanceLevel distLevel, int* maxDistance); - -//============================================================================ -// Transform functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqBCGTransform(Image* dest, const Image* source, const BCGOptions* options, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqEqualize(Image* dest, const Image* source, float min, float max, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqInverse(Image* dest, const Image* source, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqMathTransform(Image* dest, const Image* source, MathTransformMethod method, float rangeMin, float rangeMax, float power, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqWatershedTransform(Image* dest, const Image* source, int connectivity8, int* zoneCount); -IMAQ_FUNC int IMAQ_STDCALL imaqLookup2(Image* dest, const Image* source, const int* table, const Image* mask); - - -//============================================================================ -// Window Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAreScrollbarsVisible(int windowNumber, int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqBringWindowToTop(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqGetMousePos(Point* position, int* windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowBackground(int windowNumber, WindowBackgroundFillStyle* fillStyle, WindowBackgroundHatchStyle* hatchStyle, RGBValue* fillColor, RGBValue* backgroundColor); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowDisplayMapping(int windowNum, DisplayMapping* mapping); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowGrid(int windowNumber, int* xResolution, int* yResolution); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowHandle(int* handle); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowPos(int windowNumber, Point* position); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowSize(int windowNumber, int* width, int* height); -IMAQ_FUNC char* IMAQ_STDCALL imaqGetWindowTitle(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowZoom2(int windowNumber, float* xZoom, float* yZoom); -IMAQ_FUNC int IMAQ_STDCALL imaqIsWindowNonTearing(int windowNumber, int* nonTearing); -IMAQ_FUNC int IMAQ_STDCALL imaqIsWindowVisible(int windowNumber, int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqMoveWindow(int windowNumber, Point position); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupWindow(int windowNumber, int configuration); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowBackground(int windowNumber, WindowBackgroundFillStyle fillStyle, WindowBackgroundHatchStyle hatchStyle, const RGBValue* fillColor, const RGBValue* backgroundColor); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowDisplayMapping(int windowNumber, const DisplayMapping* mapping); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowGrid(int windowNumber, int xResolution, int yResolution); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowMaxContourCount(int windowNumber, unsigned int maxContourCount); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowNonTearing(int windowNumber, int nonTearing); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowPalette(int windowNumber, PaletteType type, const RGBValue* palette, int numColors); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowSize(int windowNumber, int width, int height); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowThreadPolicy(WindowThreadPolicy policy); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowTitle(int windowNumber, const char* title); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowZoomToFit(int windowNumber, int zoomToFit); -IMAQ_FUNC int IMAQ_STDCALL imaqShowScrollbars(int windowNumber, int visible); -IMAQ_FUNC int IMAQ_STDCALL imaqZoomWindow2(int windowNumber, float xZoom, float yZoom, Point center); - -//============================================================================ -// Utilities functions -//============================================================================ -IMAQ_FUNC const float* IMAQ_STDCALL imaqGetKernel(KernelFamily family, int size, int number); -IMAQ_FUNC Annulus IMAQ_STDCALL imaqMakeAnnulus(Point center, int innerRadius, int outerRadius, double startAngle, double endAngle); -IMAQ_FUNC Point IMAQ_STDCALL imaqMakePoint(int xCoordinate, int yCoordinate); -IMAQ_FUNC PointFloat IMAQ_STDCALL imaqMakePointFloat(float xCoordinate, float yCoordinate); -IMAQ_FUNC Rect IMAQ_STDCALL imaqMakeRect(int top, int left, int height, int width); -IMAQ_FUNC Rect IMAQ_STDCALL imaqMakeRectFromRotatedRect(RotatedRect rotatedRect); -IMAQ_FUNC RotatedRect IMAQ_STDCALL imaqMakeRotatedRect(int top, int left, int height, int width, double angle); -IMAQ_FUNC RotatedRect IMAQ_STDCALL imaqMakeRotatedRectFromRect(Rect rect); -IMAQ_FUNC int IMAQ_STDCALL imaqMulticoreOptions(MulticoreOperation operation, unsigned int* customNumCores); - -//============================================================================ -// Tool Window functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCloseToolWindow(void); -IMAQ_FUNC int IMAQ_STDCALL imaqGetCurrentTool(Tool* currentTool); -IMAQ_FUNC int IMAQ_STDCALL imaqGetLastEvent(WindowEventType* type, int* windowNumber, Tool* tool, Rect* rect); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetToolWindowHandle(void); -IMAQ_FUNC int IMAQ_STDCALL imaqGetToolWindowPos(Point* position); -IMAQ_FUNC int IMAQ_STDCALL imaqIsToolWindowVisible(int* visible); -IMAQ_FUNC int IMAQ_STDCALL imaqMoveToolWindow(Point position); -IMAQ_FUNC int IMAQ_STDCALL imaqSetCurrentTool(Tool currentTool); -#ifndef __GNUC__ -IMAQ_FUNC int IMAQ_STDCALL imaqSetEventCallback(EventCallback callback, int synchronous); -#endif -IMAQ_FUNC int IMAQ_STDCALL imaqSetToolColor(const RGBValue* color); -IMAQ_FUNC int IMAQ_STDCALL imaqSetupToolWindow(int showCoordinates, int maxIconsPerLine, const ToolWindowOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqShowToolWindow(int visible); - -//============================================================================ -// Meter functions -//============================================================================ -IMAQ_FUNC MeterArc* IMAQ_STDCALL imaqGetMeterArc(int lightNeedle, MeterArcMode mode, const ROI* roi, PointFloat base, PointFloat start, PointFloat end); -IMAQ_FUNC int IMAQ_STDCALL imaqReadMeter(const Image* image, const MeterArc* arcInfo, double* percentage, PointFloat* endOfNeedle); - -//============================================================================ -// Calibration functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCopyCalibrationInfo2(Image* dest, Image* source, Point offset); -IMAQ_FUNC int IMAQ_STDCALL imaqCorrectCalibratedImage(Image* dest, const Image* source, PixelValue fill, InterpolationMethod method, const ROI* roi); -IMAQ_FUNC CalibrationInfo* IMAQ_STDCALL imaqGetCalibrationInfo2(const Image* image); -IMAQ_FUNC CalibrationInfo* IMAQ_STDCALL imaqGetCalibrationInfo3(Image* image, unsigned int isGetErrorMap); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnCalibrationGrid(Image* image, const ROI* roi, const LearnCalibrationOptions* options, const GridDescriptor* grid, const CoordinateSystem* system, const RangeFloat* range, float* quality); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnCalibrationPoints(Image* image, const CalibrationPoints* points, const ROI* roi, const LearnCalibrationOptions* options, const GridDescriptor* grid, const CoordinateSystem* system, float* quality); -IMAQ_FUNC int IMAQ_STDCALL imaqSetCoordinateSystem(Image* image, const CoordinateSystem* system); -IMAQ_FUNC int IMAQ_STDCALL imaqSetSimpleCalibration(Image* image, ScalingMethod method, int learnTable, const GridDescriptor* grid, const CoordinateSystem* system); -IMAQ_FUNC TransformReport* IMAQ_STDCALL imaqTransformPixelToRealWorld(const Image* image, const PointFloat* pixelCoordinates, int numCoordinates); -IMAQ_FUNC TransformReport* IMAQ_STDCALL imaqTransformRealWorldToPixel(const Image* image, const PointFloat* realWorldCoordinates, int numCoordinates); -IMAQ_FUNC int IMAQ_STDCALL imaqSetSimpleCalibration2(Image* image, const GridDescriptor* gridDescriptor); -IMAQ_FUNC int IMAQ_STDCALL imaqCalibrationSetAxisInfo(Image* image, CoordinateSystem* axisInfo); -IMAQ_FUNC int IMAQ_STDCALL imaqCalibrationGetThumbnailImage(Image* templateImage, Image* image, CalibrationThumbnailType type, unsigned int index); -IMAQ_FUNC GetCalibrationInfoReport* IMAQ_STDCALL imaqCalibrationGetCalibrationInfo(Image* image, unsigned int isGetErrorMap); -IMAQ_FUNC GetCameraParametersReport* IMAQ_STDCALL imaqCalibrationGetCameraParameters(Image* templateImage); -IMAQ_FUNC int IMAQ_STDCALL imaqCalibrationCompactInformation(Image* image); - -//============================================================================ -// Pixel Manipulation functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqArrayToComplexPlane(Image* dest, const Image* source, const float* newPixels, ComplexPlane plane); -IMAQ_FUNC float* IMAQ_STDCALL imaqComplexPlaneToArray(const Image* image, ComplexPlane plane, Rect rect, int* rows, int* columns); -IMAQ_FUNC int IMAQ_STDCALL imaqExtractColorPlanes(const Image* image, ColorMode mode, Image* plane1, Image* plane2, Image* plane3); -IMAQ_FUNC int IMAQ_STDCALL imaqExtractComplexPlane(Image* dest, const Image* source, ComplexPlane plane); -IMAQ_FUNC int IMAQ_STDCALL imaqFillImage(Image* image, PixelValue value, const Image* mask); -IMAQ_FUNC void* IMAQ_STDCALL imaqGetLine(const Image* image, Point start, Point end, int* numPoints); -IMAQ_FUNC int IMAQ_STDCALL imaqGetPixel(const Image* image, Point pixel, PixelValue* value); -IMAQ_FUNC int IMAQ_STDCALL imaqReplaceColorPlanes(Image* dest, const Image* source, ColorMode mode, const Image* plane1, const Image* plane2, const Image* plane3); -IMAQ_FUNC int IMAQ_STDCALL imaqReplaceComplexPlane(Image* dest, const Image* source, const Image* newValues, ComplexPlane plane); -IMAQ_FUNC int IMAQ_STDCALL imaqSetLine(Image* image, const void* array, int arraySize, Point start, Point end); -IMAQ_FUNC int IMAQ_STDCALL imaqSetPixel(Image* image, Point coord, PixelValue value); - -//============================================================================ -// Color Matching functions -//============================================================================ -IMAQ_FUNC ColorInformation* IMAQ_STDCALL imaqLearnColor(const Image* image, const ROI* roi, ColorSensitivity sensitivity, int saturation); -IMAQ_FUNC int* IMAQ_STDCALL imaqMatchColor(const Image* image, const ColorInformation* info, const ROI* roi, int* numScores); - -//============================================================================ -// Frequency Domain Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAttenuate(Image* dest, const Image* source, AttenuateMode highlow); -IMAQ_FUNC int IMAQ_STDCALL imaqConjugate(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqFFT(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqFlipFrequencies(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqInverseFFT(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqTruncate(Image* dest, const Image* source, TruncateMode highlow, float ratioToKeep); - -//============================================================================ -// Barcode I/O functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqGradeDataMatrixBarcodeAIM(const Image* image, AIMGradeReport* report); -IMAQ_FUNC BarcodeInfo* IMAQ_STDCALL imaqReadBarcode(const Image* image, BarcodeType type, const ROI* roi, int validate); -IMAQ_FUNC DataMatrixReport* IMAQ_STDCALL imaqReadDataMatrixBarcode2(Image* image, const ROI* roi, DataMatrixGradingMode prepareForGrading, const DataMatrixDescriptionOptions* descriptionOptions, const DataMatrixSizeOptions* sizeOptions, const DataMatrixSearchOptions* searchOptions); -IMAQ_FUNC Barcode2DInfo* IMAQ_STDCALL imaqReadPDF417Barcode(const Image* image, const ROI* roi, Barcode2DSearchMode searchMode, unsigned int* numBarcodes); -IMAQ_FUNC QRCodeReport* IMAQ_STDCALL imaqReadQRCode(Image* image, const ROI* roi, QRGradingMode reserved, const QRCodeDescriptionOptions* descriptionOptions, const QRCodeSizeOptions* sizeOptions, const QRCodeSearchOptions* searchOptions); - -//============================================================================ -// LCD functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqFindLCDSegments(ROI* roi, const Image* image, const LCDOptions* options); -IMAQ_FUNC LCDReport* IMAQ_STDCALL imaqReadLCD(const Image* image, const ROI* roi, const LCDOptions* options); - -//============================================================================ -// Shape Matching functions -//============================================================================ -IMAQ_FUNC ShapeReport* IMAQ_STDCALL imaqMatchShape(Image* dest, Image* source, const Image* templateImage, int scaleInvariant, int connectivity8, double tolerance, int* numMatches); - -//============================================================================ -// Contours functions -//============================================================================ -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddAnnulusContour(ROI* roi, Annulus annulus); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddClosedContour(ROI* roi, const Point* points, int numPoints); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddLineContour(ROI* roi, Point start, Point end); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddOpenContour(ROI* roi, const Point* points, int numPoints); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddOvalContour(ROI* roi, Rect boundingBox); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddPointContour(ROI* roi, Point point); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddRectContour(ROI* roi, Rect rect); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddRotatedRectContour2(ROI* roi, RotatedRect rect); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqCopyContour(ROI* destRoi, const ROI* sourceRoi, ContourID id); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqGetContour(const ROI* roi, unsigned int index); -IMAQ_FUNC int IMAQ_STDCALL imaqGetContourColor(const ROI* roi, ContourID id, RGBValue* contourColor); -IMAQ_FUNC int IMAQ_STDCALL imaqGetContourCount(const ROI* roi); -IMAQ_FUNC ContourInfo2* IMAQ_STDCALL imaqGetContourInfo2(const ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL imaqMoveContour(ROI* roi, ContourID id, int deltaX, int deltaY); -IMAQ_FUNC int IMAQ_STDCALL imaqRemoveContour(ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL imaqSetContourColor(ROI* roi, ContourID id, const RGBValue* color); - -//============================================================================ -// Regions of Interest functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqConstructROI2(const Image* image, ROI* roi, Tool initialTool, const ToolWindowOptions* tools, const ConstructROIOptions2* options, int* okay); -IMAQ_FUNC ROI* IMAQ_STDCALL imaqCreateROI(void); -IMAQ_FUNC int IMAQ_STDCALL imaqGetROIBoundingBox(const ROI* roi, Rect* boundingBox); -IMAQ_FUNC int IMAQ_STDCALL imaqGetROIColor(const ROI* roi, RGBValue* roiColor); -IMAQ_FUNC ROI* IMAQ_STDCALL imaqGetWindowROI(int windowNumber); -IMAQ_FUNC int IMAQ_STDCALL imaqSetROIColor(ROI* roi, const RGBValue* color); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowROI(int windowNumber, const ROI* roi); - -//============================================================================ -// Image Analysis functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCentroid(const Image* image, PointFloat* centroid, const Image* mask); -IMAQ_FUNC Curve* IMAQ_STDCALL imaqExtractCurves(const Image* image, const ROI* roi, const CurveOptions* curveOptions, unsigned int* numCurves); -IMAQ_FUNC HistogramReport* IMAQ_STDCALL imaqHistogram(const Image* image, int numClasses, float min, float max, const Image* mask); -IMAQ_FUNC LinearAverages* IMAQ_STDCALL imaqLinearAverages2(Image* image, LinearAveragesMode mode, Rect rect); -IMAQ_FUNC LineProfile* IMAQ_STDCALL imaqLineProfile(const Image* image, Point start, Point end); -IMAQ_FUNC QuantifyReport* IMAQ_STDCALL imaqQuantify(const Image* image, const Image* mask); - -//============================================================================ -// Error Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClearError(void); -IMAQ_FUNC char* IMAQ_STDCALL imaqGetErrorText(int errorCode); -IMAQ_FUNC int IMAQ_STDCALL imaqGetLastError(void); -IMAQ_FUNC const char* IMAQ_STDCALL imaqGetLastErrorFunc(void); -IMAQ_FUNC int IMAQ_STDCALL imaqSetError(int errorCode, const char* function); - -//============================================================================ -// Threshold functions -//============================================================================ -IMAQ_FUNC ThresholdData* IMAQ_STDCALL imaqAutoThreshold2(Image* dest, const Image* source, int numClasses, ThresholdMethod method, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqLocalThreshold(Image* dest, const Image* source, unsigned int windowWidth, unsigned int windowHeight, LocalThresholdMethod method, double deviationWeight, ObjectType type, float replaceValue); -IMAQ_FUNC int IMAQ_STDCALL imaqMagicWand(Image* dest, const Image* source, Point coord, float tolerance, int connectivity8, float replaceValue); -IMAQ_FUNC int IMAQ_STDCALL imaqMultithreshold(Image* dest, const Image* source, const ThresholdData* ranges, int numRanges); -IMAQ_FUNC int IMAQ_STDCALL imaqThreshold(Image* dest, const Image* source, float rangeMin, float rangeMax, int useNewValue, float newValue); - -//============================================================================ -// Memory Management functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqDispose(void* object); - -//============================================================================ -// Pattern Matching functions -//============================================================================ -IMAQ_FUNC CircleMatch* IMAQ_STDCALL imaqDetectCircles(const Image* image, const CircleDescriptor* circleDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC EllipseMatch* IMAQ_STDCALL imaqDetectEllipses(const Image* image, const EllipseDescriptor* ellipseDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC LineMatch* IMAQ_STDCALL imaqDetectLines(const Image* image, const LineDescriptor* lineDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC RectangleMatch* IMAQ_STDCALL imaqDetectRectangles(const Image* image, const RectangleDescriptor* rectangleDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned); -IMAQ_FUNC FeatureData* IMAQ_STDCALL imaqGetGeometricFeaturesFromCurves(const Curve* curves, unsigned int numCurves, const FeatureType* featureTypes, unsigned int numFeatureTypes, unsigned int* numFeatures); -IMAQ_FUNC FeatureData* IMAQ_STDCALL imaqGetGeometricTemplateFeatureInfo(const Image* pattern, unsigned int* numFeatures); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnColorPattern(Image* image, const LearnColorPatternOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGeometricPattern(Image* image, PointFloat originOffset, const CurveOptions* curveOptions, const LearnGeometricPatternAdvancedOptions* advancedLearnOptions, const Image* mask); -IMAQ_FUNC MultipleGeometricPattern* IMAQ_STDCALL imaqLearnMultipleGeometricPatterns(const Image** patterns, unsigned int numberOfPatterns, const String255* labels); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnPattern3(Image* image, LearningMode learningMode, LearnPatternAdvancedOptions* advancedOptions, const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL imaqMatchColorPattern(const Image* image, Image* pattern, const MatchColorPatternOptions* options, Rect searchRect, int* numMatches); -IMAQ_FUNC GeometricPatternMatch2* IMAQ_STDCALL imaqMatchGeometricPattern2(const Image* image, const Image* pattern, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions, const ROI* roi, int* numMatches); -IMAQ_FUNC GeometricPatternMatch2* IMAQ_STDCALL imaqMatchMultipleGeometricPatterns(const Image* image, const MultipleGeometricPattern* multiplePattern, const ROI* roi, int* numMatches); -IMAQ_FUNC MultipleGeometricPattern* IMAQ_STDCALL imaqReadMultipleGeometricPatternFile(const char* fileName, String255 description); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL imaqRefineMatches(const Image* image, const Image* pattern, const PatternMatch* candidatesIn, int numCandidatesIn, MatchPatternOptions* options, MatchPatternAdvancedOptions* advancedOptions, int* numCandidatesOut); -IMAQ_FUNC int IMAQ_STDCALL imaqSetMultipleGeometricPatternsOptions(MultipleGeometricPattern* multiplePattern, const char* label, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteMultipleGeometricPatternFile(const MultipleGeometricPattern* multiplePattern, const char* fileName, const char* description); -IMAQ_FUNC GeometricPatternMatch3* IMAQ_STDCALL imaqMatchGeometricPattern3(const Image* image, const Image* pattern, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions3* advancedMatchOptions, const ROI* roi, size_t* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGeometricPattern2(Image* image, PointFloat originOffset, double angleOffset, const CurveOptions* curveOptions, const LearnGeometricPatternAdvancedOptions2* advancedLearnOptions, const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL imaqMatchPattern3(const Image* image, const Image* pattern, const MatchPatternOptions* options, const MatchPatternAdvancedOptions* advancedOptions, const ROI* roi, int* numMatches); - -//============================================================================ -// Overlay functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqClearOverlay(Image* image, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqCopyOverlay(Image* dest, const Image* source, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqGetOverlayProperties(const Image* image, const char* group, TransformBehaviors* transformBehaviors); -IMAQ_FUNC int IMAQ_STDCALL imaqMergeOverlay(Image* dest, const Image* source, const RGBValue* palette, unsigned int numColors, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayArc(Image* image, const ArcInfo* arc, const RGBValue* color, DrawMode drawMode, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayBitmap(Image* image, Point destLoc, const RGBValue* bitmap, unsigned int numCols, unsigned int numRows, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayClosedContour(Image* image, const Point* points, int numPoints, const RGBValue* color, DrawMode drawMode, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayLine(Image* image, Point start, Point end, const RGBValue* color, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayMetafile(Image* image, const void* metafile, Rect rect, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayOpenContour(Image* image, const Point* points, int numPoints, const RGBValue* color, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayOval(Image* image, Rect boundingBox, const RGBValue* color, DrawMode drawMode, char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayPoints(Image* image, const Point* points, int numPoints, const RGBValue* colors, int numColors, PointSymbol symbol, const UserPointSymbol* userSymbol, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayRect(Image* image, Rect rect, const RGBValue* color, DrawMode drawMode, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayROI(Image* image, const ROI* roi, PointSymbol symbol, const UserPointSymbol* userSymbol, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqOverlayText(Image* image, Point origin, const char* text, const RGBValue* color, const OverlayTextOptions* options, const char* group); -IMAQ_FUNC int IMAQ_STDCALL imaqSetOverlayProperties(Image* image, const char* group, TransformBehaviors* transformBehaviors); - -//============================================================================ -// OCR functions -//============================================================================ -IMAQ_FUNC CharSet* IMAQ_STDCALL imaqCreateCharSet(void); -IMAQ_FUNC int IMAQ_STDCALL imaqDeleteChar(CharSet* set, int index); -IMAQ_FUNC int IMAQ_STDCALL imaqGetCharCount(const CharSet* set); -IMAQ_FUNC CharInfo2* IMAQ_STDCALL imaqGetCharInfo2(const CharSet* set, int index); -IMAQ_FUNC int IMAQ_STDCALL imaqReadOCRFile(const char* fileName, CharSet* set, String255 setDescription, ReadTextOptions* readOptions, OCRProcessingOptions* processingOptions, OCRSpacingOptions* spacingOptions); -IMAQ_FUNC ReadTextReport3* IMAQ_STDCALL imaqReadText3(const Image* image, const CharSet* set, const ROI* roi, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqRenameChar(CharSet* set, int index, const char* newCharValue); -IMAQ_FUNC int IMAQ_STDCALL imaqSetReferenceChar(const CharSet* set, int index, int isReferenceChar); -IMAQ_FUNC int IMAQ_STDCALL imaqTrainChars(const Image* image, CharSet* set, int index, const char* charValue, const ROI* roi, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int* IMAQ_STDCALL imaqVerifyPatterns(const Image* image, const CharSet* set, const String255* expectedPatterns, int patternCount, const ROI* roi, int* numScores); -IMAQ_FUNC int* IMAQ_STDCALL imaqVerifyText(const Image* image, const CharSet* set, const char* expectedString, const ROI* roi, int* numScores); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteOCRFile(const char* fileName, const CharSet* set, const char* setDescription, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions); - -//============================================================================ -// Geometric Matching functions -//============================================================================ -IMAQ_FUNC ExtractContourReport* IMAQ_STDCALL imaqExtractContour(Image* image, const ROI* roi, ExtractContourDirection direction, CurveParameters* curveParams, const ConnectionConstraint* connectionConstraintParams, unsigned int numOfConstraints, ExtractContourSelection selection, Image* contourImage); -IMAQ_FUNC int IMAQ_STDCALL imaqContourOverlay(Image* image, const Image* contourImage, const ContourOverlaySettings* pointsSettings, const ContourOverlaySettings* eqnSettings, const char* groupName); -IMAQ_FUNC ContourComputeCurvatureReport* IMAQ_STDCALL imaqContourComputeCurvature(const Image* contourImage, unsigned int kernel); -IMAQ_FUNC CurvatureAnalysisReport* IMAQ_STDCALL imaqContourClassifyCurvature(const Image* contourImage, unsigned int kernel, RangeLabel* curvatureClasses, unsigned int numCurvatureClasses); -IMAQ_FUNC ComputeDistancesReport* IMAQ_STDCALL imaqContourComputeDistances(const Image* targetImage, const Image* templateImage, const SetupMatchPatternData* matchSetupData, unsigned int smoothingKernel); -IMAQ_FUNC ClassifyDistancesReport* IMAQ_STDCALL imaqContourClassifyDistances(const Image* targetImage, const Image* templateImage, const SetupMatchPatternData* matchSetupData, unsigned int smoothingKernel, const RangeLabel* distanceRanges, unsigned int numDistanceRanges); -IMAQ_FUNC ContourInfoReport* IMAQ_STDCALL imaqContourInfo(const Image* contourImage); -IMAQ_FUNC SetupMatchPatternData* IMAQ_STDCALL imaqContourSetupMatchPattern(MatchMode* matchMode, unsigned int enableSubPixelAccuracy, CurveParameters* curveParams, unsigned int useLearnCurveParameters, const RangeSettingDouble* rangeSettings, unsigned int numRangeSettings); -IMAQ_FUNC int IMAQ_STDCALL imaqContourAdvancedSetupMatchPattern(SetupMatchPatternData* matchSetupData, GeometricAdvancedSetupDataOption* geometricOptions, unsigned int numGeometricOptions); -IMAQ_FUNC ContourFitLineReport* IMAQ_STDCALL imaqContourFitLine(Image* image, double pixelRadius); -IMAQ_FUNC PartialCircle* IMAQ_STDCALL imaqContourFitCircle(Image* image, double pixelRadius, int rejectOutliers); -IMAQ_FUNC PartialEllipse* IMAQ_STDCALL imaqContourFitEllipse(Image* image, double pixelRadius, int rejectOutliers); -IMAQ_FUNC ContourFitSplineReport* IMAQ_STDCALL imaqContourFitSpline(Image* image, int degree, int numberOfControlPoints); -IMAQ_FUNC ContourFitPolynomialReport* IMAQ_STDCALL imaqContourFitPolynomial(Image* image, int order); - -//============================================================================ -// Edge Detection functions -//============================================================================ -IMAQ_FUNC FindCircularEdgeReport* IMAQ_STDCALL imaqFindCircularEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindCircularEdgeOptions* edgeOptions, const CircleFitOptions* circleFitOptions); -IMAQ_FUNC FindConcentricEdgeReport* IMAQ_STDCALL imaqFindConcentricEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindConcentricEdgeOptions* edgeOptions, const ConcentricEdgeFitOptions* concentricEdgeFitOptions); - -//============================================================================ -// Morphology Reconstruction functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqGrayMorphologyReconstruct(Image* dstImage, Image* srcImage, const Image* markerImage, PointFloat* points, int numOfPoints, MorphologyReconstructOperation operation, const StructuringElement* structuringElement, const ROI* roi); -IMAQ_FUNC int IMAQ_STDCALL imaqMorphologyReconstruct(Image* dstImage, Image* srcImage, const Image* markerImage, PointFloat* points, int numOfPoints, MorphologyReconstructOperation operation, Connectivity connectivity, const ROI* roi); - -//============================================================================ -// Texture functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqDetectTextureDefect(ClassifierSession* session, Image* destImage, const Image* srcImage, const ROI* roi, int initialStepSize, int finalStepSize, unsigned char defectPixelValue, double minClassificationScore); -IMAQ_FUNC int IMAQ_STDCALL imaqClassificationTextureDefectOptions(ClassifierSession* session, WindowSize* windowOptions, WaveletOptions* waveletOptions, void** bandsUsed, int* numBandsUsed, CooccurrenceOptions* cooccurrenceOptions, unsigned char setOperation); -IMAQ_FUNC int IMAQ_STDCALL imaqCooccurrenceMatrix(const Image* srcImage, const ROI* roi, int levelPixel, const DisplacementVector* displacementVec, void* featureOptionArray, unsigned int featureOptionArraySize, void** cooccurrenceMatrixArray, int* coocurrenceMatrixRows, int* coocurrenceMatrixCols, void** featureVectorArray, int* featureVectorArraySize); -IMAQ_FUNC ExtractTextureFeaturesReport* IMAQ_STDCALL imaqExtractTextureFeatures(const Image* srcImage, const ROI* roi, const WindowSize* windowOptions, const WaveletOptions* waveletOptions, void* waveletBands, unsigned int numWaveletBands, const CooccurrenceOptions* cooccurrenceOptions, unsigned char useWindow); -IMAQ_FUNC WaveletBandsReport* IMAQ_STDCALL imaqExtractWaveletBands(const Image* srcImage, const WaveletOptions* waveletOptions, void* waveletBands, unsigned int numWaveletBands); - -//============================================================================ -// Regions of Interest Manipulation functions -//============================================================================ -IMAQ_FUNC ROI* IMAQ_STDCALL imaqMaskToROI(const Image* mask, int* withinLimit); -IMAQ_FUNC ROIProfile* IMAQ_STDCALL imaqROIProfile(const Image* image, const ROI* roi); -IMAQ_FUNC int IMAQ_STDCALL imaqROIToMask(Image* mask, const ROI* roi, int fillValue, const Image* imageModel, int* inSpace); -IMAQ_FUNC int IMAQ_STDCALL imaqTransformROI2(ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem); -IMAQ_FUNC LabelToROIReport* IMAQ_STDCALL imaqLabelToROI(const Image* image, const unsigned int* labelsIn, unsigned int numLabelsIn, int maxNumVectors, int isExternelEdges); - -//============================================================================ -// Morphology functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqGrayMorphology(Image* dest, Image* source, MorphologyMethod method, const StructuringElement* structuringElement); - -//============================================================================ -// Classification functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqAddClassifierSample(Image* image, ClassifierSession* session, const ROI* roi, const char* sampleClass, double* featureVector, unsigned int vectorSize); -IMAQ_FUNC ClassifierReportAdvanced* IMAQ_STDCALL imaqAdvanceClassify(Image* image, const ClassifierSession* session, const ROI* roi, double* featureVector, unsigned int vectorSize); -IMAQ_FUNC ClassifierReport* IMAQ_STDCALL imaqClassify(Image* image, const ClassifierSession* session, const ROI* roi, double* featureVector, unsigned int vectorSize); -IMAQ_FUNC ClassifierSession* IMAQ_STDCALL imaqCreateClassifier(ClassifierType type); -IMAQ_FUNC int IMAQ_STDCALL imaqDeleteClassifierSample(ClassifierSession* session, int index); -IMAQ_FUNC ClassifierAccuracyReport* IMAQ_STDCALL imaqGetClassifierAccuracy(const ClassifierSession* session); -IMAQ_FUNC ClassifierSampleInfo* IMAQ_STDCALL imaqGetClassifierSampleInfo(const ClassifierSession* session, int index, int* numSamples); -IMAQ_FUNC int IMAQ_STDCALL imaqGetColorClassifierOptions(const ClassifierSession* session, ColorOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqGetNearestNeighborOptions(const ClassifierSession* session, NearestNeighborOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqGetParticleClassifierOptions2(const ClassifierSession* session, ParticleClassifierPreprocessingOptions2* preprocessingOptions, ParticleClassifierOptions* options); -IMAQ_FUNC ClassifierSession* IMAQ_STDCALL imaqReadClassifierFile(ClassifierSession* session, const char* fileName, ReadClassifierFileMode mode, ClassifierType* type, ClassifierEngineType* engine, String255 description); -IMAQ_FUNC int IMAQ_STDCALL imaqRelabelClassifierSample(ClassifierSession* session, int index, const char* newClass); -IMAQ_FUNC int IMAQ_STDCALL imaqSetParticleClassifierOptions2(ClassifierSession* session, const ParticleClassifierPreprocessingOptions2* preprocessingOptions, const ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqSetColorClassifierOptions(ClassifierSession* session, const ColorOptions* options); -IMAQ_FUNC NearestNeighborTrainingReport* IMAQ_STDCALL imaqTrainNearestNeighborClassifier(ClassifierSession* session, const NearestNeighborOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqWriteClassifierFile(const ClassifierSession* session, const char* fileName, WriteClassifierFileMode mode, const String255 description); - -//============================================================================ -// Measure Distances functions -//============================================================================ -IMAQ_FUNC ClampMax2Report* IMAQ_STDCALL imaqClampMax2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const CurveOptions* curveSettings, const ClampSettings* clampSettings, const ClampOverlaySettings* clampOverlaySettings); - -//============================================================================ -// Inspection functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqCompareGoldenTemplate(const Image* image, const Image* goldenTemplate, Image* brightDefects, Image* darkDefects, const InspectionAlignment* alignment, const InspectionOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnGoldenTemplate(Image* goldenTemplate, PointFloat originOffset, const Image* mask); -//============================================================================ -// Obsolete functions -//============================================================================ -IMAQ_FUNC int IMAQ_STDCALL imaqRotate(Image* dest, const Image* source, float angle, PixelValue fill, InterpolationMethod method); -IMAQ_FUNC int IMAQ_STDCALL imaqWritePNGFile(const Image* image, const char* fileName, unsigned int compressionSpeed, const RGBValue* colorTable); -IMAQ_FUNC ParticleReport* IMAQ_STDCALL imaqSelectParticles(const Image* image, const ParticleReport* reports, int reportCount, int rejectBorder, const SelectParticleCriteria* criteria, int criteriaCount, int* selectedCount); -IMAQ_FUNC int IMAQ_STDCALL imaqParticleFilter(Image* dest, Image* source, const ParticleFilterCriteria* criteria, int criteriaCount, int rejectMatches, int connectivity8); -IMAQ_FUNC ParticleReport* IMAQ_STDCALL imaqGetParticleInfo(Image* image, int connectivity8, ParticleInfoMode mode, int* reportCount); -IMAQ_FUNC int IMAQ_STDCALL imaqCalcCoeff(const Image* image, const ParticleReport* report, MeasurementValue parameter, float* coefficient); -IMAQ_FUNC EdgeReport* IMAQ_STDCALL imaqEdgeTool(const Image* image, const Point* points, int numPoints, const EdgeOptions* options, int* numEdges); -IMAQ_FUNC CircleReport* IMAQ_STDCALL imaqCircles(Image* dest, const Image* source, float minRadius, float maxRadius, int* numCircles); -IMAQ_FUNC int IMAQ_STDCALL imaqLabel(Image* dest, Image* source, int connectivity8, int* particleCount); -IMAQ_FUNC int IMAQ_STDCALL imaqFitEllipse(const PointFloat* points, int numPoints, BestEllipse* ellipse); -IMAQ_FUNC int IMAQ_STDCALL imaqFitCircle(const PointFloat* points, int numPoints, BestCircle* circle); -IMAQ_FUNC Color IMAQ_STDCALL imaqChangeColorSpace(const Color* sourceColor, ColorMode sourceSpace, ColorMode destSpace); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL imaqMatchPattern(const Image* image, Image* pattern, const MatchPatternOptions* options, Rect searchRect, int* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqConvex(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqIsVisionInfoPresent(const Image* image, VisionInfoType type, int* present); -IMAQ_FUNC int IMAQ_STDCALL imaqLineGaugeTool(const Image* image, Point start, Point end, LineGaugeMethod method, const EdgeOptions* edgeOptions, const CoordinateTransform* reference, float* distance); -IMAQ_FUNC int IMAQ_STDCALL imaqBestCircle(const PointFloat* points, int numPoints, PointFloat* center, double* radius); -IMAQ_FUNC int IMAQ_STDCALL imaqSavePattern(const Image* pattern, const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL imaqLoadPattern(Image* pattern, const char* fileName); -IMAQ_FUNC int IMAQ_STDCALL imaqTransformROI(ROI* roi, Point originStart, float angleStart, Point originFinal, float angleFinal); -IMAQ_FUNC int IMAQ_STDCALL imaqCoordinateReference(const Point* points, ReferenceMode mode, Point* origin, float* angle); -IMAQ_FUNC ContourInfo* IMAQ_STDCALL imaqGetContourInfo(const ROI* roi, ContourID id); -IMAQ_FUNC int IMAQ_STDCALL imaqSetWindowOverlay(int windowNumber, const Overlay* overlay); -IMAQ_FUNC Overlay* IMAQ_STDCALL imaqCreateOverlayFromROI(const ROI* roi); -IMAQ_FUNC Overlay* IMAQ_STDCALL imaqCreateOverlayFromMetafile(const void* metafile); -IMAQ_FUNC int IMAQ_STDCALL imaqSetCalibrationInfo(Image* image, CalibrationUnit unit, float xDistance, float yDistance); -IMAQ_FUNC int IMAQ_STDCALL imaqGetCalibrationInfo(const Image* image, CalibrationUnit* unit, float* xDistance, float* yDistance); -IMAQ_FUNC int IMAQ_STDCALL imaqConstructROI(const Image* image, ROI* roi, Tool initialTool, const ToolWindowOptions* tools, const ConstructROIOptions* options, int* okay); -IMAQ_FUNC int IMAQ_STDCALL imaqGetParticleClassifierOptions(const ClassifierSession* session, ParticleClassifierPreprocessingOptions* preprocessingOptions, ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqZoomWindow(int windowNumber, int xZoom, int yZoom, Point center); -IMAQ_FUNC int IMAQ_STDCALL imaqGetWindowZoom(int windowNumber, int* xZoom, int* yZoom); -IMAQ_FUNC int IMAQ_STDCALL imaqParticleFilter3(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, const ParticleFilterOptions* options, const ROI* roi, int* numParticles); -IMAQ_FUNC ReadTextReport2* IMAQ_STDCALL imaqReadText2(const Image* image, const CharSet* set, const ROI* roi, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnPattern2(Image* image, LearningMode learningMode, LearnPatternAdvancedOptions* advancedOptions); -IMAQ_FUNC int IMAQ_STDCALL imaqConvolve(Image* dest, Image* source, const float* kernel, int matrixRows, int matrixCols, float normalize, const Image* mask); -IMAQ_FUNC int IMAQ_STDCALL imaqDivideConstant(Image* dest, const Image* source, PixelValue value); -IMAQ_FUNC int IMAQ_STDCALL imaqDivide(Image* dest, const Image* sourceA, const Image* sourceB); -IMAQ_FUNC EdgeReport2* IMAQ_STDCALL imaqEdgeTool3(const Image* image, const ROI* roi, EdgeProcess processType, const EdgeOptions2* edgeOptions); -IMAQ_FUNC ConcentricRakeReport* IMAQ_STDCALL imaqConcentricRake(const Image* image, const ROI* roi, ConcentricRakeDirection direction, EdgeProcess process, const RakeOptions* options); -IMAQ_FUNC SpokeReport* IMAQ_STDCALL imaqSpoke(const Image* image, const ROI* roi, SpokeDirection direction, EdgeProcess process, const SpokeOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqLearnPattern(Image* image, LearningMode learningMode); -IMAQ_FUNC int IMAQ_STDCALL imaqLookup(Image* dest, const Image* source, const short* table, const Image* mask); -IMAQ_FUNC PatternMatch* IMAQ_STDCALL imaqMatchPattern2(const Image* image, const Image* pattern, const MatchPatternOptions* options, const MatchPatternAdvancedOptions* advancedOptions, Rect searchRect, int* numMatches); -IMAQ_FUNC int IMAQ_STDCALL imaqSetParticleClassifierOptions(ClassifierSession* session, const ParticleClassifierPreprocessingOptions* preprocessingOptions, const ParticleClassifierOptions* options); -IMAQ_FUNC int IMAQ_STDCALL imaqCopyCalibrationInfo(Image* dest, const Image* source); -IMAQ_FUNC int IMAQ_STDCALL imaqParticleFilter2(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, int rejectMatches, int connectivity8, int* numParticles); -IMAQ_FUNC EdgeReport* IMAQ_STDCALL imaqEdgeTool2(const Image* image, const Point* points, int numPoints, EdgeProcess process, const EdgeOptions* options, int* numEdges); -IMAQ_FUNC ContourID IMAQ_STDCALL imaqAddRotatedRectContour(ROI* roi, RotatedRect rect); -IMAQ_FUNC Barcode2DInfo* IMAQ_STDCALL imaqReadDataMatrixBarcode(const Image* image, const ROI* roi, const DataMatrixOptions* options, unsigned int* numBarcodes); -IMAQ_FUNC LinearAverages* IMAQ_STDCALL imaqLinearAverages(const Image* image, Rect rect); -IMAQ_FUNC GeometricPatternMatch* IMAQ_STDCALL imaqMatchGeometricPattern(const Image* image, const Image* pattern, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions* advancedMatchOptions, const ROI* roi, int* numMatches); -IMAQ_FUNC CharInfo* IMAQ_STDCALL imaqGetCharInfo(const CharSet* set, int index); -IMAQ_FUNC ReadTextReport* IMAQ_STDCALL imaqReadText(const Image* image, const CharSet* set, const ROI* roi, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions); -IMAQ_FUNC ThresholdData* IMAQ_STDCALL imaqAutoThreshold(Image* dest, Image* source, int numClasses, ThresholdMethod method); -IMAQ_FUNC ColorHistogramReport* IMAQ_STDCALL imaqColorHistogram(Image* image, int numClasses, ColorMode mode, const Image* mask); -IMAQ_FUNC RakeReport* IMAQ_STDCALL imaqRake(const Image* image, const ROI* roi, RakeDirection direction, EdgeProcess process, const RakeOptions* options); - -IMAQ_FUNC int IMAQ_STDCALL Priv_ReadJPEGString_C(Image* image, const unsigned char* string, unsigned int stringLength); -#endif - diff --git a/wpilibj/src/athena/cpp/lib/NIVisionJNI.cpp b/wpilibj/src/athena/cpp/lib/NIVisionJNI.cpp deleted file mode 100644 index 68e7747c30..0000000000 --- a/wpilibj/src/athena/cpp/lib/NIVisionJNI.cpp +++ /dev/null @@ -1,5016 +0,0 @@ -// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -#include -#include -#include -#include -#include -#include - -static const char* getErrorText(int err); - -// throw java exception -static void throwJavaException(JNIEnv *env) { - jclass je = env->FindClass("com/ni/vision/VisionException"); - int err = imaqGetLastError(); - const char* err_text = getErrorText(err); - char* full_err_msg = static_cast(malloc(30+strlen(err_text))); - sprintf(full_err_msg, "imaqError: %d: %s", err, err_text); - env->ThrowNew(je, full_err_msg); - free(full_err_msg); -} - -// throw IMAQdx java exception -static void dxthrowJavaException(JNIEnv *env, IMAQdxError err) { - jclass je = env->FindClass("com/ni/vision/VisionException"); - const char* err_text = getErrorText(err); - char* full_err_msg = static_cast(malloc(30+strlen(err_text))); - sprintf(full_err_msg, "IMAQdxError: %d: %s", err, err_text); - env->ThrowNew(je, full_err_msg); - free(full_err_msg); -} - -extern "C" { - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision_imaqDispose(JNIEnv* , jclass , jlong addr) -{ - imaqDispose((void*)addr); -} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeU32(IMAQdxSession id, const char* name, uInt32* value) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeU32, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeI64(IMAQdxSession id, const char* name, Int64* value) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeI64, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeF64(IMAQdxSession id, const char* name, float64* value) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeF64, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeString(IMAQdxSession id, const char* name, char value[IMAQDX_MAX_API_STRING_LENGTH]) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeString, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeEnum(IMAQdxSession id, const char* name, IMAQdxEnumItem* value) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeEnumItem, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeBool(IMAQdxSession id, const char* name, bool32* value) -{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeBool, (void*)value); -} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumU32(IMAQdxSession id, const char* name, uInt32* value) -{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeU32, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumI64(IMAQdxSession id, const char* name, Int64* value) -{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeI64, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumF64(IMAQdxSession id, const char* name, float64* value) -{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeF64, (void*)value); -} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumU32(IMAQdxSession id, const char* name, uInt32* value) -{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeU32, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumI64(IMAQdxSession id, const char* name, Int64* value) -{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeI64, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumF64(IMAQdxSession id, const char* name, float64* value) -{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeF64, (void*)value); -} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementU32(IMAQdxSession id, const char* name, uInt32* value) -{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeU32, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementI64(IMAQdxSession id, const char* name, Int64* value) -{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeI64, (void*)value); -} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementF64(IMAQdxSession id, const char* name, float64* value) -{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeF64, (void*)value); -} - -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeU32(IMAQdxSession id, const char* name, uInt32 value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeU32, value); -} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeI64(IMAQdxSession id, const char* name, Int64 value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeI64, value); -} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeF64(IMAQdxSession id, const char* name, float64 value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeF64, value); -} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeString(IMAQdxSession id, const char* name, const char* value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeString, value); -} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeEnum(IMAQdxSession id, const char* name, const IMAQdxEnumItem* value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeU32, value->Value); -} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeBool(IMAQdxSession id, const char* name, bool32 value) -{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeBool, value); -} - - -/* - * Opaque Structures - */ - -/* - * Manifest Constants - */ - -/* - * Predefined Valid Characters - */ - -/* - * Enumerated Types - */ - -/* - * Forward Declare Data Structures - */ - -/* - * Data Structures - */ - -/* - * Globals - */ - -/* - * Logical functions - */ - -/* J: void imaqAnd(Image dest, Image sourceA, Image sourceB) - * JN: void imaqAnd(long dest, long sourceA, long sourceB) - * C: int imaqAnd(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAnd(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqAnd((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqCompare(Image dest, Image source, Image compareImage, ComparisonFunction compare) - * JN: void imaqCompare(long dest, long source, long compareImage, int compare) - * C: int imaqCompare(Image* dest, const Image* source, const Image* compareImage, ComparisonFunction compare) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCompare(JNIEnv* env, jclass , jlong dest, jlong source, jlong compareImage, jint compare) -{ - int rv = imaqCompare((Image*)dest, (const Image*)source, (const Image*)compareImage, (ComparisonFunction)compare); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLogicalDifference(Image dest, Image sourceA, Image sourceB) - * JN: void imaqLogicalDifference(long dest, long sourceA, long sourceB) - * C: int imaqLogicalDifference(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLogicalDifference(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqLogicalDifference((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqNand(Image dest, Image sourceA, Image sourceB) - * JN: void imaqNand(long dest, long sourceA, long sourceB) - * C: int imaqNand(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqNand(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqNand((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqNor(Image dest, Image sourceA, Image sourceB) - * JN: void imaqNor(long dest, long sourceA, long sourceB) - * C: int imaqNor(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqNor(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqNor((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOr(Image dest, Image sourceA, Image sourceB) - * JN: void imaqOr(long dest, long sourceA, long sourceB) - * C: int imaqOr(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOr(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqOr((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqXnor(Image dest, Image sourceA, Image sourceB) - * JN: void imaqXnor(long dest, long sourceA, long sourceB) - * C: int imaqXnor(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqXnor(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqXnor((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqXor(Image dest, Image sourceA, Image sourceB) - * JN: void imaqXor(long dest, long sourceA, long sourceB) - * C: int imaqXor(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqXor(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqXor((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* - * Particle Analysis functions - */ - -/* J: void imaqCountParticles(Image image, int connectivity8) - * JN: void imaqCountParticles(long image, int connectivity8, long numParticles) - * C: int imaqCountParticles(Image* image, int connectivity8, int* numParticles) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCountParticles(JNIEnv* env, jclass , jlong image, jint connectivity8, jlong numParticles) -{ - int rv = imaqCountParticles((Image*)image, (int)connectivity8, (int*)numParticles); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMeasureParticle(Image image, int particleNumber, int calibrated, MeasurementType measurement) - * JN: void imaqMeasureParticle(long image, int particleNumber, int calibrated, int measurement, long value) - * C: int imaqMeasureParticle(Image* image, int particleNumber, int calibrated, MeasurementType measurement, double* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMeasureParticle(JNIEnv* env, jclass , jlong image, jint particleNumber, jint calibrated, jint measurement, jlong value) -{ - int rv = imaqMeasureParticle((Image*)image, (int)particleNumber, (int)calibrated, (MeasurementType)measurement, (double*)value); - if (rv == 0) throwJavaException(env); -} - -/* J: MeasureParticlesReport imaqMeasureParticles(Image image, MeasureParticlesCalibrationMode calibrationMode, MeasurementType[] measurements) - * JN: long imaqMeasureParticles(long image, int calibrationMode, long measurements, int numMeasurements) - * C: MeasureParticlesReport* imaqMeasureParticles(Image* image, MeasureParticlesCalibrationMode calibrationMode, const MeasurementType* measurements, size_t numMeasurements) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMeasureParticles(JNIEnv* env, jclass , jlong image, jint calibrationMode, jlong measurements, jint numMeasurements) -{ - MeasureParticlesReport* rv = imaqMeasureParticles((Image*)image, (MeasureParticlesCalibrationMode)calibrationMode, (const MeasurementType*)measurements, (size_t)numMeasurements); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqParticleFilter4(Image dest, Image source, ParticleFilterCriteria2[] criteria, ParticleFilterOptions2 options, ROI roi) - * JN: void imaqParticleFilter4(long dest, long source, long criteria, int criteriaCount, long options, long roi, long numParticles) - * C: int imaqParticleFilter4(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, const ParticleFilterOptions2* options, const ROI* roi, int* numParticles) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqParticleFilter4(JNIEnv* env, jclass , jlong dest, jlong source, jlong criteria, jint criteriaCount, jlong options, jlong roi, jlong numParticles) -{ - int rv = imaqParticleFilter4((Image*)dest, (Image*)source, (const ParticleFilterCriteria2*)criteria, (int)criteriaCount, (const ParticleFilterOptions2*)options, (const ROI*)roi, (int*)numParticles); - if (rv == 0) throwJavaException(env); -} - -/* - * Morphology functions - */ - -/* J: void imaqConvexHull(Image dest, Image source, int connectivity8) - * JN: void imaqConvexHull(long dest, long source, int connectivity8) - * C: int imaqConvexHull(Image* dest, Image* source, int connectivity8) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqConvexHull(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8) -{ - int rv = imaqConvexHull((Image*)dest, (Image*)source, (int)connectivity8); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqDanielssonDistance(Image dest, Image source) - * JN: void imaqDanielssonDistance(long dest, long source) - * C: int imaqDanielssonDistance(Image* dest, Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDanielssonDistance(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqDanielssonDistance((Image*)dest, (Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqFillHoles(Image dest, Image source, int connectivity8) - * JN: void imaqFillHoles(long dest, long source, int connectivity8) - * C: int imaqFillHoles(Image* dest, const Image* source, int connectivity8) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFillHoles(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8) -{ - int rv = imaqFillHoles((Image*)dest, (const Image*)source, (int)connectivity8); - if (rv == 0) throwJavaException(env); -} - -/* J: FindCirclesResult imaqFindCircles(Image dest, Image source, float minRadius, float maxRadius) - * JN: long imaqFindCircles(long dest, long source, float minRadius, float maxRadius, long numCircles) - * C: CircleReport* imaqFindCircles(Image* dest, Image* source, float minRadius, float maxRadius, int* numCircles) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFindCircles(JNIEnv* env, jclass , jlong dest, jlong source, jfloat minRadius, jfloat maxRadius, jlong numCircles) -{ - CircleReport* rv = imaqFindCircles((Image*)dest, (Image*)source, (float)minRadius, (float)maxRadius, (int*)numCircles); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqLabel2(Image dest, Image source, int connectivity8) - * JN: void imaqLabel2(long dest, long source, int connectivity8, long particleCount) - * C: int imaqLabel2(Image* dest, Image* source, int connectivity8, int* particleCount) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLabel2(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8, jlong particleCount) -{ - int rv = imaqLabel2((Image*)dest, (Image*)source, (int)connectivity8, (int*)particleCount); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMorphology(Image dest, Image source, MorphologyMethod method, StructuringElement structuringElement) - * JN: void imaqMorphology(long dest, long source, int method, long structuringElement) - * C: int imaqMorphology(Image* dest, Image* source, MorphologyMethod method, const StructuringElement* structuringElement) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMorphology(JNIEnv* env, jclass , jlong dest, jlong source, jint method, jlong structuringElement) -{ - int rv = imaqMorphology((Image*)dest, (Image*)source, (MorphologyMethod)method, (const StructuringElement*)structuringElement); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqRejectBorder(Image dest, Image source, int connectivity8) - * JN: void imaqRejectBorder(long dest, long source, int connectivity8) - * C: int imaqRejectBorder(Image* dest, Image* source, int connectivity8) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRejectBorder(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8) -{ - int rv = imaqRejectBorder((Image*)dest, (Image*)source, (int)connectivity8); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSegmentation(Image dest, Image source) - * JN: void imaqSegmentation(long dest, long source) - * C: int imaqSegmentation(Image* dest, Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSegmentation(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqSegmentation((Image*)dest, (Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSeparation(Image dest, Image source, int erosions, StructuringElement structuringElement) - * JN: void imaqSeparation(long dest, long source, int erosions, long structuringElement) - * C: int imaqSeparation(Image* dest, Image* source, int erosions, const StructuringElement* structuringElement) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSeparation(JNIEnv* env, jclass , jlong dest, jlong source, jint erosions, jlong structuringElement) -{ - int rv = imaqSeparation((Image*)dest, (Image*)source, (int)erosions, (const StructuringElement*)structuringElement); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSimpleDistance(Image dest, Image source, StructuringElement structuringElement) - * JN: void imaqSimpleDistance(long dest, long source, long structuringElement) - * C: int imaqSimpleDistance(Image* dest, Image* source, const StructuringElement* structuringElement) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSimpleDistance(JNIEnv* env, jclass , jlong dest, jlong source, jlong structuringElement) -{ - int rv = imaqSimpleDistance((Image*)dest, (Image*)source, (const StructuringElement*)structuringElement); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSizeFilter(Image dest, Image source, int connectivity8, int erosions, SizeType keepSize, StructuringElement structuringElement) - * JN: void imaqSizeFilter(long dest, long source, int connectivity8, int erosions, int keepSize, long structuringElement) - * C: int imaqSizeFilter(Image* dest, Image* source, int connectivity8, int erosions, SizeType keepSize, const StructuringElement* structuringElement) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSizeFilter(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8, jint erosions, jint keepSize, jlong structuringElement) -{ - int rv = imaqSizeFilter((Image*)dest, (Image*)source, (int)connectivity8, (int)erosions, (SizeType)keepSize, (const StructuringElement*)structuringElement); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSkeleton(Image dest, Image source, SkeletonMethod method) - * JN: void imaqSkeleton(long dest, long source, int method) - * C: int imaqSkeleton(Image* dest, Image* source, SkeletonMethod method) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSkeleton(JNIEnv* env, jclass , jlong dest, jlong source, jint method) -{ - int rv = imaqSkeleton((Image*)dest, (Image*)source, (SkeletonMethod)method); - if (rv == 0) throwJavaException(env); -} - -/* - * Acquisition functions - */ - -/* - * Arithmetic functions - */ - -/* J: void imaqAbsoluteDifference(Image dest, Image sourceA, Image sourceB) - * JN: void imaqAbsoluteDifference(long dest, long sourceA, long sourceB) - * C: int imaqAbsoluteDifference(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAbsoluteDifference(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqAbsoluteDifference((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqAdd(Image dest, Image sourceA, Image sourceB) - * JN: void imaqAdd(long dest, long sourceA, long sourceB) - * C: int imaqAdd(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAdd(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqAdd((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqAverage(Image dest, Image sourceA, Image sourceB) - * JN: void imaqAverage(long dest, long sourceA, long sourceB) - * C: int imaqAverage(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAverage(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqAverage((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqDivide2(Image dest, Image sourceA, Image sourceB, RoundingMode roundingMode) - * JN: void imaqDivide2(long dest, long sourceA, long sourceB, int roundingMode) - * C: int imaqDivide2(Image* dest, const Image* sourceA, const Image* sourceB, RoundingMode roundingMode) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDivide2(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB, jint roundingMode) -{ - int rv = imaqDivide2((Image*)dest, (const Image*)sourceA, (const Image*)sourceB, (RoundingMode)roundingMode); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMax(Image dest, Image sourceA, Image sourceB) - * JN: void imaqMax(long dest, long sourceA, long sourceB) - * C: int imaqMax(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMax(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqMax((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMin(Image dest, Image sourceA, Image sourceB) - * JN: void imaqMin(long dest, long sourceA, long sourceB) - * C: int imaqMin(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMin(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqMin((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqModulo(Image dest, Image sourceA, Image sourceB) - * JN: void imaqModulo(long dest, long sourceA, long sourceB) - * C: int imaqModulo(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqModulo(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqModulo((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMulDiv(Image dest, Image sourceA, Image sourceB, float value) - * JN: void imaqMulDiv(long dest, long sourceA, long sourceB, float value) - * C: int imaqMulDiv(Image* dest, const Image* sourceA, const Image* sourceB, float value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMulDiv(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB, jfloat value) -{ - int rv = imaqMulDiv((Image*)dest, (const Image*)sourceA, (const Image*)sourceB, (float)value); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMultiply(Image dest, Image sourceA, Image sourceB) - * JN: void imaqMultiply(long dest, long sourceA, long sourceB) - * C: int imaqMultiply(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMultiply(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqMultiply((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSubtract(Image dest, Image sourceA, Image sourceB) - * JN: void imaqSubtract(long dest, long sourceA, long sourceB) - * C: int imaqSubtract(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSubtract(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqSubtract((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* - * Caliper functions - */ - -/* J: CaliperToolResult imaqCaliperTool(Image image, Point[] points, EdgeOptions edgeOptions, CaliperOptions caliperOptions) - * JN: long imaqCaliperTool(long image, long points, int numPoints, long edgeOptions, long caliperOptions, long numEdgePairs) - * C: CaliperReport* imaqCaliperTool(const Image* image, const Point* points, int numPoints, const EdgeOptions* edgeOptions, const CaliperOptions* caliperOptions, int* numEdgePairs) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCaliperTool(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jlong edgeOptions, jlong caliperOptions, jlong numEdgePairs) -{ - CaliperReport* rv = imaqCaliperTool((const Image*)image, (const Point*)points, (int)numPoints, (const EdgeOptions*)edgeOptions, (const CaliperOptions*)caliperOptions, (int*)numEdgePairs); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ConcentricRakeReport2 imaqConcentricRake2(Image image, ROI roi, ConcentricRakeDirection direction, EdgeProcess process, int stepSize) - * JN: long imaqConcentricRake2(long image, long roi, int direction, int process, int stepSize, long edgeOptions) - * C: ConcentricRakeReport2* imaqConcentricRake2(Image* image, ROI* roi, ConcentricRakeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqConcentricRake2(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jint stepSize, jlong edgeOptions) -{ - ConcentricRakeReport2* rv = imaqConcentricRake2((Image*)image, (ROI*)roi, (ConcentricRakeDirection)direction, (EdgeProcess)process, (int)stepSize, (EdgeOptions2*)edgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: DetectExtremesResult imaqDetectExtremes(double[] pixels, DetectionMode mode, DetectExtremesOptions options) - * JN: long imaqDetectExtremes(long pixels, int numPixels, int mode, long options, long numExtremes) - * C: ExtremeReport* imaqDetectExtremes(const double* pixels, int numPixels, DetectionMode mode, const DetectExtremesOptions* options, int* numExtremes) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqDetectExtremes(JNIEnv* env, jclass , jlong pixels, jint numPixels, jint mode, jlong options, jlong numExtremes) -{ - ExtremeReport* rv = imaqDetectExtremes((const double*)pixels, (int)numPixels, (DetectionMode)mode, (const DetectExtremesOptions*)options, (int*)numExtremes); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqDetectRotation(Image referenceImage, Image testImage, PointFloat referenceCenter, PointFloat testCenter, int radius, float precision) - * JN: void imaqDetectRotation(long referenceImage, long testImage, long referenceCenter, long testCenter, int radius, float precision, long angle) - * C: int imaqDetectRotation(const Image* referenceImage, const Image* testImage, PointFloat referenceCenter, PointFloat testCenter, int radius, float precision, double* angle) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDetectRotation(JNIEnv* env, jclass , jlong referenceImage, jlong testImage, jlong referenceCenter, jlong testCenter, jint radius, jfloat precision, jlong angle) -{ - int rv = imaqDetectRotation((const Image*)referenceImage, (const Image*)testImage, *((PointFloat*)referenceCenter), *((PointFloat*)testCenter), (int)radius, (float)precision, (double*)angle); - if (rv == 0) throwJavaException(env); -} - -/* J: EdgeReport2 imaqEdgeTool4(Image image, ROI roi, EdgeProcess processType, int reverseDirection) - * JN: long imaqEdgeTool4(long image, long roi, int processType, long edgeOptions, int reverseDirection) - * C: EdgeReport2* imaqEdgeTool4(Image* image, ROI* roi, EdgeProcess processType, EdgeOptions2* edgeOptions, const unsigned int reverseDirection) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqEdgeTool4(JNIEnv* env, jclass , jlong image, jlong roi, jint processType, jlong edgeOptions, jint reverseDirection) -{ - EdgeReport2* rv = imaqEdgeTool4((Image*)image, (ROI*)roi, (EdgeProcess)processType, (EdgeOptions2*)edgeOptions, (const unsigned int)reverseDirection); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: FindEdgeReport imaqFindEdge2(Image image, ROI roi, CoordinateSystem baseSystem, CoordinateSystem newSystem, FindEdgeOptions2 findEdgeOptions, StraightEdgeOptions straightEdgeOptions) - * JN: long imaqFindEdge2(long image, long roi, long baseSystem, long newSystem, long findEdgeOptions, long straightEdgeOptions) - * C: FindEdgeReport* imaqFindEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindEdgeOptions2* findEdgeOptions, const StraightEdgeOptions* straightEdgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFindEdge2(JNIEnv* env, jclass , jlong image, jlong roi, jlong baseSystem, jlong newSystem, jlong findEdgeOptions, jlong straightEdgeOptions) -{ - FindEdgeReport* rv = imaqFindEdge2((Image*)image, (const ROI*)roi, (const CoordinateSystem*)baseSystem, (const CoordinateSystem*)newSystem, (const FindEdgeOptions2*)findEdgeOptions, (const StraightEdgeOptions*)straightEdgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqFindTransformRect2(Image image, ROI roi, FindTransformMode mode, FindTransformRectOptions2 findTransformOptions, StraightEdgeOptions straightEdgeOptions) - * JN: void imaqFindTransformRect2(long image, long roi, int mode, long baseSystem, long newSystem, long findTransformOptions, long straightEdgeOptions, long axisReport) - * C: int imaqFindTransformRect2(Image* image, const ROI* roi, FindTransformMode mode, CoordinateSystem* baseSystem, CoordinateSystem* newSystem, const FindTransformRectOptions2* findTransformOptions, const StraightEdgeOptions* straightEdgeOptions, AxisReport* axisReport) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFindTransformRect2(JNIEnv* env, jclass , jlong image, jlong roi, jint mode, jlong baseSystem, jlong newSystem, jlong findTransformOptions, jlong straightEdgeOptions, jlong axisReport) -{ - int rv = imaqFindTransformRect2((Image*)image, (const ROI*)roi, (FindTransformMode)mode, (CoordinateSystem*)baseSystem, (CoordinateSystem*)newSystem, (const FindTransformRectOptions2*)findTransformOptions, (const StraightEdgeOptions*)straightEdgeOptions, (AxisReport*)axisReport); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqFindTransformRects2(Image image, ROI primaryROI, ROI secondaryROI, FindTransformMode mode, FindTransformRectsOptions2 findTransformOptions, StraightEdgeOptions primaryStraightEdgeOptions, StraightEdgeOptions secondaryStraightEdgeOptions) - * JN: void imaqFindTransformRects2(long image, long primaryROI, long secondaryROI, int mode, long baseSystem, long newSystem, long findTransformOptions, long primaryStraightEdgeOptions, long secondaryStraightEdgeOptions, long axisReport) - * C: int imaqFindTransformRects2(Image* image, const ROI* primaryROI, const ROI* secondaryROI, FindTransformMode mode, CoordinateSystem* baseSystem, CoordinateSystem* newSystem, const FindTransformRectsOptions2* findTransformOptions, const StraightEdgeOptions* primaryStraightEdgeOptions, const StraightEdgeOptions* secondaryStraightEdgeOptions, AxisReport* axisReport) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFindTransformRects2(JNIEnv* env, jclass , jlong image, jlong primaryROI, jlong secondaryROI, jint mode, jlong baseSystem, jlong newSystem, jlong findTransformOptions, jlong primaryStraightEdgeOptions, jlong secondaryStraightEdgeOptions, jlong axisReport) -{ - int rv = imaqFindTransformRects2((Image*)image, (const ROI*)primaryROI, (const ROI*)secondaryROI, (FindTransformMode)mode, (CoordinateSystem*)baseSystem, (CoordinateSystem*)newSystem, (const FindTransformRectsOptions2*)findTransformOptions, (const StraightEdgeOptions*)primaryStraightEdgeOptions, (const StraightEdgeOptions*)secondaryStraightEdgeOptions, (AxisReport*)axisReport); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLineGaugeTool2(Image image, Point start, Point end, LineGaugeMethod method, EdgeOptions edgeOptions, CoordinateTransform2 transform) - * JN: void imaqLineGaugeTool2(long image, long start, long end, int method, long edgeOptions, long transform, long distance) - * C: int imaqLineGaugeTool2(const Image* image, Point start, Point end, LineGaugeMethod method, const EdgeOptions* edgeOptions, const CoordinateTransform2* transform, float* distance) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLineGaugeTool2(JNIEnv* env, jclass , jlong image, jlong start, jlong end, jint method, jlong edgeOptions, jlong transform, jlong distance) -{ - int rv = imaqLineGaugeTool2((const Image*)image, *((Point*)start), *((Point*)end), (LineGaugeMethod)method, (const EdgeOptions*)edgeOptions, (const CoordinateTransform2*)transform, (float*)distance); - if (rv == 0) throwJavaException(env); -} - -/* J: RakeReport2 imaqRake2(Image image, ROI roi, RakeDirection direction, EdgeProcess process, int stepSize) - * JN: long imaqRake2(long image, long roi, int direction, int process, int stepSize, long edgeOptions) - * C: RakeReport2* imaqRake2(Image* image, ROI* roi, RakeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqRake2(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jint stepSize, jlong edgeOptions) -{ - RakeReport2* rv = imaqRake2((Image*)image, (ROI*)roi, (RakeDirection)direction, (EdgeProcess)process, (int)stepSize, (EdgeOptions2*)edgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: SimpleEdgeResult imaqSimpleEdge(Image image, Point[] points, SimpleEdgeOptions options) - * JN: long imaqSimpleEdge(long image, long points, int numPoints, long options, long numEdges) - * C: PointFloat* imaqSimpleEdge(const Image* image, const Point* points, int numPoints, const SimpleEdgeOptions* options, int* numEdges) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqSimpleEdge(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jlong options, jlong numEdges) -{ - PointFloat* rv = imaqSimpleEdge((const Image*)image, (const Point*)points, (int)numPoints, (const SimpleEdgeOptions*)options, (int*)numEdges); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: SpokeReport2 imaqSpoke2(Image image, ROI roi, SpokeDirection direction, EdgeProcess process, int stepSize) - * JN: long imaqSpoke2(long image, long roi, int direction, int process, int stepSize, long edgeOptions) - * C: SpokeReport2* imaqSpoke2(Image* image, ROI* roi, SpokeDirection direction, EdgeProcess process, int stepSize, EdgeOptions2* edgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqSpoke2(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jint stepSize, jlong edgeOptions) -{ - SpokeReport2* rv = imaqSpoke2((Image*)image, (ROI*)roi, (SpokeDirection)direction, (EdgeProcess)process, (int)stepSize, (EdgeOptions2*)edgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: StraightEdgeReport2 imaqStraightEdge(Image image, ROI roi, SearchDirection searchDirection, EdgeOptions2 edgeOptions, StraightEdgeOptions straightEdgeOptions) - * JN: long imaqStraightEdge(long image, long roi, int searchDirection, long edgeOptions, long straightEdgeOptions) - * C: StraightEdgeReport2* imaqStraightEdge(const Image* image, const ROI* roi, SearchDirection searchDirection, const EdgeOptions2* edgeOptions, const StraightEdgeOptions* straightEdgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqStraightEdge(JNIEnv* env, jclass , jlong image, jlong roi, jint searchDirection, jlong edgeOptions, jlong straightEdgeOptions) -{ - StraightEdgeReport2* rv = imaqStraightEdge((const Image*)image, (const ROI*)roi, (SearchDirection)searchDirection, (const EdgeOptions2*)edgeOptions, (const StraightEdgeOptions*)straightEdgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: StraightEdgeReport2 imaqStraightEdge2(Image image, ROI roi, SearchDirection searchDirection, EdgeOptions2 edgeOptions, StraightEdgeOptions straightEdgeOptions, int optimizedMode) - * JN: long imaqStraightEdge2(long image, long roi, int searchDirection, long edgeOptions, long straightEdgeOptions, int optimizedMode) - * C: StraightEdgeReport2* imaqStraightEdge2(const Image* image, const ROI* roi, SearchDirection searchDirection, const EdgeOptions2* edgeOptions, const StraightEdgeOptions* straightEdgeOptions, unsigned int optimizedMode) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqStraightEdge2(JNIEnv* env, jclass , jlong image, jlong roi, jint searchDirection, jlong edgeOptions, jlong straightEdgeOptions, jint optimizedMode) -{ - StraightEdgeReport2* rv = imaqStraightEdge2((const Image*)image, (const ROI*)roi, (SearchDirection)searchDirection, (const EdgeOptions2*)edgeOptions, (const StraightEdgeOptions*)straightEdgeOptions, (unsigned int)optimizedMode); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Spatial Filters functions - */ - -/* J: void imaqCannyEdgeFilter(Image dest, Image source, CannyOptions options) - * JN: void imaqCannyEdgeFilter(long dest, long source, long options) - * C: int imaqCannyEdgeFilter(Image* dest, const Image* source, const CannyOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCannyEdgeFilter(JNIEnv* env, jclass , jlong dest, jlong source, jlong options) -{ - int rv = imaqCannyEdgeFilter((Image*)dest, (const Image*)source, (const CannyOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqCorrelate(Image dest, Image source, Image templateImage, Rect rect) - * JN: void imaqCorrelate(long dest, long source, long templateImage, long rect) - * C: int imaqCorrelate(Image* dest, Image* source, const Image* templateImage, Rect rect) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCorrelate(JNIEnv* env, jclass , jlong dest, jlong source, jlong templateImage, jlong rect) -{ - int rv = imaqCorrelate((Image*)dest, (Image*)source, (const Image*)templateImage, *((Rect*)rect)); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqEdgeFilter(Image dest, Image source, OutlineMethod method, Image mask) - * JN: void imaqEdgeFilter(long dest, long source, int method, long mask) - * C: int imaqEdgeFilter(Image* dest, Image* source, OutlineMethod method, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqEdgeFilter(JNIEnv* env, jclass , jlong dest, jlong source, jint method, jlong mask) -{ - int rv = imaqEdgeFilter((Image*)dest, (Image*)source, (OutlineMethod)method, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLowPass(Image dest, Image source, int width, int height, float tolerance, Image mask) - * JN: void imaqLowPass(long dest, long source, int width, int height, float tolerance, long mask) - * C: int imaqLowPass(Image* dest, Image* source, int width, int height, float tolerance, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLowPass(JNIEnv* env, jclass , jlong dest, jlong source, jint width, jint height, jfloat tolerance, jlong mask) -{ - int rv = imaqLowPass((Image*)dest, (Image*)source, (int)width, (int)height, (float)tolerance, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMedianFilter(Image dest, Image source, int width, int height, Image mask) - * JN: void imaqMedianFilter(long dest, long source, int width, int height, long mask) - * C: int imaqMedianFilter(Image* dest, Image* source, int width, int height, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMedianFilter(JNIEnv* env, jclass , jlong dest, jlong source, jint width, jint height, jlong mask) -{ - int rv = imaqMedianFilter((Image*)dest, (Image*)source, (int)width, (int)height, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqNthOrderFilter(Image dest, Image source, int width, int height, int n, Image mask) - * JN: void imaqNthOrderFilter(long dest, long source, int width, int height, int n, long mask) - * C: int imaqNthOrderFilter(Image* dest, Image* source, int width, int height, int n, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqNthOrderFilter(JNIEnv* env, jclass , jlong dest, jlong source, jint width, jint height, jint n, jlong mask) -{ - int rv = imaqNthOrderFilter((Image*)dest, (Image*)source, (int)width, (int)height, (int)n, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* - * Drawing functions - */ - -/* J: void imaqDrawLineOnImage(Image dest, Image source, DrawMode mode, Point start, Point end, float newPixelValue) - * JN: void imaqDrawLineOnImage(long dest, long source, int mode, long start, long end, float newPixelValue) - * C: int imaqDrawLineOnImage(Image* dest, const Image* source, DrawMode mode, Point start, Point end, float newPixelValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDrawLineOnImage(JNIEnv* env, jclass , jlong dest, jlong source, jint mode, jlong start, jlong end, jfloat newPixelValue) -{ - int rv = imaqDrawLineOnImage((Image*)dest, (const Image*)source, (DrawMode)mode, *((Point*)start), *((Point*)end), (float)newPixelValue); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqDrawShapeOnImage(Image dest, Image source, Rect rect, DrawMode mode, ShapeMode shape, float newPixelValue) - * JN: void imaqDrawShapeOnImage(long dest, long source, long rect, int mode, int shape, float newPixelValue) - * C: int imaqDrawShapeOnImage(Image* dest, const Image* source, Rect rect, DrawMode mode, ShapeMode shape, float newPixelValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDrawShapeOnImage(JNIEnv* env, jclass , jlong dest, jlong source, jlong rect, jint mode, jint shape, jfloat newPixelValue) -{ - int rv = imaqDrawShapeOnImage((Image*)dest, (const Image*)source, *((Rect*)rect), (DrawMode)mode, (ShapeMode)shape, (float)newPixelValue); - if (rv == 0) throwJavaException(env); -} - -/* - * Interlacing functions - */ - -/* J: void imaqInterlaceCombine(Image frame, Image odd, Image even) - * JN: void imaqInterlaceCombine(long frame, long odd, long even) - * C: int imaqInterlaceCombine(Image* frame, const Image* odd, const Image* even) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqInterlaceCombine(JNIEnv* env, jclass , jlong frame, jlong odd, jlong even) -{ - int rv = imaqInterlaceCombine((Image*)frame, (const Image*)odd, (const Image*)even); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqInterlaceSeparate(Image frame, Image odd, Image even) - * JN: void imaqInterlaceSeparate(long frame, long odd, long even) - * C: int imaqInterlaceSeparate(const Image* frame, Image* odd, Image* even) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqInterlaceSeparate(JNIEnv* env, jclass , jlong frame, jlong odd, jlong even) -{ - int rv = imaqInterlaceSeparate((const Image*)frame, (Image*)odd, (Image*)even); - if (rv == 0) throwJavaException(env); -} - -/* - * Image Information functions - */ - -/* J: EnumerateCustomKeysResult imaqEnumerateCustomKeys(Image image) - * JN: long imaqEnumerateCustomKeys(long image, long size) - * C: char** imaqEnumerateCustomKeys(const Image* image, unsigned int* size) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqEnumerateCustomKeys(JNIEnv* env, jclass , jlong image, jlong size) -{ - char** rv = imaqEnumerateCustomKeys((const Image*)image, (unsigned int*)size); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetBitDepth(Image image) - * JN: void imaqGetBitDepth(long image, long bitDepth) - * C: int imaqGetBitDepth(const Image* image, unsigned int* bitDepth) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetBitDepth(JNIEnv* env, jclass , jlong image, jlong bitDepth) -{ - int rv = imaqGetBitDepth((const Image*)image, (unsigned int*)bitDepth); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetBytesPerPixel(Image image) - * JN: void imaqGetBytesPerPixel(long image, long byteCount) - * C: int imaqGetBytesPerPixel(const Image* image, int* byteCount) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetBytesPerPixel(JNIEnv* env, jclass , jlong image, jlong byteCount) -{ - int rv = imaqGetBytesPerPixel((const Image*)image, (int*)byteCount); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetImageInfo(Image image) - * JN: void imaqGetImageInfo(long image, long info) - * C: int imaqGetImageInfo(const Image* image, ImageInfo* info) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetImageInfo(JNIEnv* env, jclass , jlong image, jlong info) -{ - int rv = imaqGetImageInfo((const Image*)image, (ImageInfo*)info); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetImageSize(Image image) - * JN: void imaqGetImageSize(long image, long width, long height) - * C: int imaqGetImageSize(const Image* image, int* width, int* height) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetImageSize(JNIEnv* env, jclass , jlong image, jlong width, jlong height) -{ - int rv = imaqGetImageSize((const Image*)image, (int*)width, (int*)height); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetImageType(Image image) - * JN: void imaqGetImageType(long image, long type) - * C: int imaqGetImageType(const Image* image, ImageType* type) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetImageType(JNIEnv* env, jclass , jlong image, jlong type) -{ - int rv = imaqGetImageType((const Image*)image, (ImageType*)type); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetMaskOffset(Image image) - * JN: void imaqGetMaskOffset(long image, long offset) - * C: int imaqGetMaskOffset(const Image* image, Point* offset) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetMaskOffset(JNIEnv* env, jclass , jlong image, jlong offset) -{ - int rv = imaqGetMaskOffset((const Image*)image, (Point*)offset); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetVisionInfoTypes(Image image) - * JN: void imaqGetVisionInfoTypes(long image, long present) - * C: int imaqGetVisionInfoTypes(const Image* image, unsigned int* present) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetVisionInfoTypes(JNIEnv* env, jclass , jlong image, jlong present) -{ - int rv = imaqGetVisionInfoTypes((const Image*)image, (unsigned int*)present); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqIsImageEmpty(Image image) - * JN: void imaqIsImageEmpty(long image, long empty) - * C: int imaqIsImageEmpty(const Image* image, int* empty) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqIsImageEmpty(JNIEnv* env, jclass , jlong image, jlong empty) -{ - int rv = imaqIsImageEmpty((const Image*)image, (int*)empty); - if (rv == 0) throwJavaException(env); -} - -/* J: RawData imaqReadCustomData(Image image, String key) - * JN: long imaqReadCustomData(long image, long key, long size) - * C: void* imaqReadCustomData(const Image* image, const char* key, unsigned int* size) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadCustomData(JNIEnv* env, jclass , jlong image, jlong key, jlong size) -{ - void* rv = imaqReadCustomData((const Image*)image, (const char*)key, (unsigned int*)size); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqRemoveCustomData(Image image, String key) - * JN: void imaqRemoveCustomData(long image, long key) - * C: int imaqRemoveCustomData(Image* image, const char* key) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRemoveCustomData(JNIEnv* env, jclass , jlong image, jlong key) -{ - int rv = imaqRemoveCustomData((Image*)image, (const char*)key); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqRemoveVisionInfo2(Image image, int info) - * JN: void imaqRemoveVisionInfo2(long image, int info) - * C: int imaqRemoveVisionInfo2(const Image* image, unsigned int info) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRemoveVisionInfo2(JNIEnv* env, jclass , jlong image, jint info) -{ - int rv = imaqRemoveVisionInfo2((const Image*)image, (unsigned int)info); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetBitDepth(Image image, int bitDepth) - * JN: void imaqSetBitDepth(long image, int bitDepth) - * C: int imaqSetBitDepth(Image* image, unsigned int bitDepth) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetBitDepth(JNIEnv* env, jclass , jlong image, jint bitDepth) -{ - int rv = imaqSetBitDepth((Image*)image, (unsigned int)bitDepth); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetImageSize(Image image, int width, int height) - * JN: void imaqSetImageSize(long image, int width, int height) - * C: int imaqSetImageSize(Image* image, int width, int height) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetImageSize(JNIEnv* env, jclass , jlong image, jint width, jint height) -{ - int rv = imaqSetImageSize((Image*)image, (int)width, (int)height); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetMaskOffset(Image image, Point offset) - * JN: void imaqSetMaskOffset(long image, long offset) - * C: int imaqSetMaskOffset(Image* image, Point offset) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetMaskOffset(JNIEnv* env, jclass , jlong image, jlong offset) -{ - int rv = imaqSetMaskOffset((Image*)image, *((Point*)offset)); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteCustomData(Image image, String key, RawData data, int size) - * JN: void imaqWriteCustomData(long image, long key, long data, int size) - * C: int imaqWriteCustomData(Image* image, const char* key, const void* data, unsigned int size) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteCustomData(JNIEnv* env, jclass , jlong image, jlong key, jlong data, jint size) -{ - int rv = imaqWriteCustomData((Image*)image, (const char*)key, (const void*)data, (unsigned int)size); - if (rv == 0) throwJavaException(env); -} - -/* - * Display functions - */ - -/* - * Image Manipulation functions - */ - -/* J: void imaqCopyRect(Image dest, Image source, Rect rect, Point destLoc) - * JN: void imaqCopyRect(long dest, long source, long rect, long destLoc) - * C: int imaqCopyRect(Image* dest, const Image* source, Rect rect, Point destLoc) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCopyRect(JNIEnv* env, jclass , jlong dest, jlong source, jlong rect, jlong destLoc) -{ - int rv = imaqCopyRect((Image*)dest, (const Image*)source, *((Rect*)rect), *((Point*)destLoc)); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqDuplicate(Image dest, Image source) - * JN: void imaqDuplicate(long dest, long source) - * C: int imaqDuplicate(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDuplicate(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqDuplicate((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: RawData imaqFlatten(Image image, FlattenType type, CompressionType compression, int quality) - * JN: long imaqFlatten(long image, int type, int compression, int quality, long size) - * C: void* imaqFlatten(const Image* image, FlattenType type, CompressionType compression, int quality, unsigned int* size) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFlatten(JNIEnv* env, jclass , jlong image, jint type, jint compression, jint quality, jlong size) -{ - void* rv = imaqFlatten((const Image*)image, (FlattenType)type, (CompressionType)compression, (int)quality, (unsigned int*)size); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqFlip(Image dest, Image source, FlipAxis axis) - * JN: void imaqFlip(long dest, long source, int axis) - * C: int imaqFlip(Image* dest, const Image* source, FlipAxis axis) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFlip(JNIEnv* env, jclass , jlong dest, jlong source, jint axis) -{ - int rv = imaqFlip((Image*)dest, (const Image*)source, (FlipAxis)axis); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMask(Image dest, Image source, Image mask) - * JN: void imaqMask(long dest, long source, long mask) - * C: int imaqMask(Image* dest, const Image* source, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMask(JNIEnv* env, jclass , jlong dest, jlong source, jlong mask) -{ - int rv = imaqMask((Image*)dest, (const Image*)source, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqResample(Image dest, Image source, int newWidth, int newHeight, InterpolationMethod method, Rect rect) - * JN: void imaqResample(long dest, long source, int newWidth, int newHeight, int method, long rect) - * C: int imaqResample(Image* dest, const Image* source, int newWidth, int newHeight, InterpolationMethod method, Rect rect) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqResample(JNIEnv* env, jclass , jlong dest, jlong source, jint newWidth, jint newHeight, jint method, jlong rect) -{ - int rv = imaqResample((Image*)dest, (const Image*)source, (int)newWidth, (int)newHeight, (InterpolationMethod)method, *((Rect*)rect)); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqScale(Image dest, Image source, int xScale, int yScale, ScalingMode scaleMode, Rect rect) - * JN: void imaqScale(long dest, long source, int xScale, int yScale, int scaleMode, long rect) - * C: int imaqScale(Image* dest, const Image* source, int xScale, int yScale, ScalingMode scaleMode, Rect rect) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqScale(JNIEnv* env, jclass , jlong dest, jlong source, jint xScale, jint yScale, jint scaleMode, jlong rect) -{ - int rv = imaqScale((Image*)dest, (const Image*)source, (int)xScale, (int)yScale, (ScalingMode)scaleMode, *((Rect*)rect)); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqTranspose(Image dest, Image source) - * JN: void imaqTranspose(long dest, long source) - * C: int imaqTranspose(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqTranspose(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqTranspose((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqUnflatten(Image image, RawData data, int size) - * JN: void imaqUnflatten(long image, long data, int size) - * C: int imaqUnflatten(Image* image, const void* data, unsigned int size) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqUnflatten(JNIEnv* env, jclass , jlong image, jlong data, jint size) -{ - int rv = imaqUnflatten((Image*)image, (const void*)data, (unsigned int)size); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqUnwrapImage(Image dest, Image source, Annulus annulus, RectOrientation orientation, InterpolationMethod method) - * JN: void imaqUnwrapImage(long dest, long source, long annulus, int orientation, int method) - * C: int imaqUnwrapImage(Image* dest, const Image* source, Annulus annulus, RectOrientation orientation, InterpolationMethod method) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqUnwrapImage(JNIEnv* env, jclass , jlong dest, jlong source, jlong annulus, jint orientation, jint method) -{ - int rv = imaqUnwrapImage((Image*)dest, (const Image*)source, *((Annulus*)annulus), (RectOrientation)orientation, (InterpolationMethod)method); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqView3D(Image dest, Image source, View3DOptions options) - * JN: void imaqView3D(long dest, long source, long options) - * C: int imaqView3D(Image* dest, Image* source, const View3DOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqView3D(JNIEnv* env, jclass , jlong dest, jlong source, jlong options) -{ - int rv = imaqView3D((Image*)dest, (Image*)source, (const View3DOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* - * File I/O functions - */ - -/* J: void imaqGetFileInfo(String fileName) - * JN: void imaqGetFileInfo(long fileName, long calibrationUnit, long calibrationX, long calibrationY, long width, long height, long imageType) - * C: int imaqGetFileInfo(const char* fileName, CalibrationUnit* calibrationUnit, float* calibrationX, float* calibrationY, int* width, int* height, ImageType* imageType) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetFileInfo(JNIEnv* env, jclass , jlong fileName, jlong calibrationUnit, jlong calibrationX, jlong calibrationY, jlong width, jlong height, jlong imageType) -{ - int rv = imaqGetFileInfo((const char*)fileName, (CalibrationUnit*)calibrationUnit, (float*)calibrationX, (float*)calibrationY, (int*)width, (int*)height, (ImageType*)imageType); - if (rv == 0) throwJavaException(env); -} - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReadFile(JNIEnv* env, jclass , jlong image, jlong fileName, jlong colorTable, jlong numColors) -{ - int rv = imaqReadFile((Image*)image, (const char*)fileName, (RGBValue*)colorTable, (int*)numColors); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqReadVisionFile(Image image, String fileName) - * JN: void imaqReadVisionFile(long image, long fileName, long colorTable, long numColors) - * C: int imaqReadVisionFile(Image* image, const char* fileName, RGBValue* colorTable, int* numColors) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReadVisionFile(JNIEnv* env, jclass , jlong image, jlong fileName, jlong colorTable, jlong numColors) -{ - int rv = imaqReadVisionFile((Image*)image, (const char*)fileName, (RGBValue*)colorTable, (int*)numColors); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteBMPFile(Image image, String fileName, int compress, RGBValue colorTable) - * JN: void imaqWriteBMPFile(long image, long fileName, int compress, long colorTable) - * C: int imaqWriteBMPFile(const Image* image, const char* fileName, int compress, const RGBValue* colorTable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteBMPFile(JNIEnv* env, jclass , jlong image, jlong fileName, jint compress, jlong colorTable) -{ - int rv = imaqWriteBMPFile((const Image*)image, (const char*)fileName, (int)compress, (const RGBValue*)colorTable); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteFile(Image image, String fileName, RGBValue colorTable) - * JN: void imaqWriteFile(long image, long fileName, long colorTable) - * C: int imaqWriteFile(const Image* image, const char* fileName, const RGBValue* colorTable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteFile(JNIEnv* env, jclass , jlong image, jlong fileName, jlong colorTable) -{ - int rv = imaqWriteFile((const Image*)image, (const char*)fileName, (const RGBValue*)colorTable); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteJPEGFile(Image image, String fileName, int quality, RawData colorTable) - * JN: void imaqWriteJPEGFile(long image, long fileName, int quality, long colorTable) - * C: int imaqWriteJPEGFile(const Image* image, const char* fileName, unsigned int quality, void* colorTable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteJPEGFile(JNIEnv* env, jclass , jlong image, jlong fileName, jint quality, jlong colorTable) -{ - int rv = imaqWriteJPEGFile((const Image*)image, (const char*)fileName, (unsigned int)quality, (void*)colorTable); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWritePNGFile2(Image image, String fileName, int compressionSpeed, RGBValue colorTable, int useBitDepth) - * JN: void imaqWritePNGFile2(long image, long fileName, int compressionSpeed, long colorTable, int useBitDepth) - * C: int imaqWritePNGFile2(const Image* image, const char* fileName, unsigned int compressionSpeed, const RGBValue* colorTable, int useBitDepth) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWritePNGFile2(JNIEnv* env, jclass , jlong image, jlong fileName, jint compressionSpeed, jlong colorTable, jint useBitDepth) -{ - int rv = imaqWritePNGFile2((const Image*)image, (const char*)fileName, (unsigned int)compressionSpeed, (const RGBValue*)colorTable, (int)useBitDepth); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteTIFFFile(Image image, String fileName, TIFFFileOptions options, RGBValue colorTable) - * JN: void imaqWriteTIFFFile(long image, long fileName, long options, long colorTable) - * C: int imaqWriteTIFFFile(const Image* image, const char* fileName, const TIFFFileOptions* options, const RGBValue* colorTable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteTIFFFile(JNIEnv* env, jclass , jlong image, jlong fileName, jlong options, jlong colorTable) -{ - int rv = imaqWriteTIFFFile((const Image*)image, (const char*)fileName, (const TIFFFileOptions*)options, (const RGBValue*)colorTable); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteVisionFile(Image image, String fileName, RGBValue colorTable) - * JN: void imaqWriteVisionFile(long image, long fileName, long colorTable) - * C: int imaqWriteVisionFile(const Image* image, const char* fileName, const RGBValue* colorTable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteVisionFile(JNIEnv* env, jclass , jlong image, jlong fileName, jlong colorTable) -{ - int rv = imaqWriteVisionFile((const Image*)image, (const char*)fileName, (const RGBValue*)colorTable); - if (rv == 0) throwJavaException(env); -} - -/* - * Analytic Geometry functions - */ - -/* J: void imaqBuildCoordinateSystem(Point points, ReferenceMode mode, AxisOrientation orientation) - * JN: void imaqBuildCoordinateSystem(long points, int mode, int orientation, long system) - * C: int imaqBuildCoordinateSystem(const Point* points, ReferenceMode mode, AxisOrientation orientation, CoordinateSystem* system) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqBuildCoordinateSystem(JNIEnv* env, jclass , jlong points, jint mode, jint orientation, jlong system) -{ - int rv = imaqBuildCoordinateSystem((const Point*)points, (ReferenceMode)mode, (AxisOrientation)orientation, (CoordinateSystem*)system); - if (rv == 0) throwJavaException(env); -} - -/* J: BestCircle2 imaqFitCircle2(PointFloat[] points, FitCircleOptions options) - * JN: long imaqFitCircle2(long points, int numPoints, long options) - * C: BestCircle2* imaqFitCircle2(const PointFloat* points, int numPoints, const FitCircleOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFitCircle2(JNIEnv* env, jclass , jlong points, jint numPoints, jlong options) -{ - BestCircle2* rv = imaqFitCircle2((const PointFloat*)points, (int)numPoints, (const FitCircleOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: BestEllipse2 imaqFitEllipse2(PointFloat[] points, FitEllipseOptions options) - * JN: long imaqFitEllipse2(long points, int numPoints, long options) - * C: BestEllipse2* imaqFitEllipse2(const PointFloat* points, int numPoints, const FitEllipseOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFitEllipse2(JNIEnv* env, jclass , jlong points, jint numPoints, jlong options) -{ - BestEllipse2* rv = imaqFitEllipse2((const PointFloat*)points, (int)numPoints, (const FitEllipseOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: BestLine imaqFitLine(PointFloat[] points, FitLineOptions options) - * JN: long imaqFitLine(long points, int numPoints, long options) - * C: BestLine* imaqFitLine(const PointFloat* points, int numPoints, const FitLineOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFitLine(JNIEnv* env, jclass , jlong points, jint numPoints, jlong options) -{ - BestLine* rv = imaqFitLine((const PointFloat*)points, (int)numPoints, (const FitLineOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetAngle(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2) - * JN: void imaqGetAngle(long start1, long end1, long start2, long end2, long angle) - * C: int imaqGetAngle(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, float* angle) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetAngle(JNIEnv* env, jclass , jlong start1, jlong end1, jlong start2, jlong end2, jlong angle) -{ - int rv = imaqGetAngle(*((PointFloat*)start1), *((PointFloat*)end1), *((PointFloat*)start2), *((PointFloat*)end2), (float*)angle); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetBisectingLine(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2) - * JN: void imaqGetBisectingLine(long start1, long end1, long start2, long end2, long bisectStart, long bisectEnd) - * C: int imaqGetBisectingLine(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, PointFloat* bisectStart, PointFloat* bisectEnd) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetBisectingLine(JNIEnv* env, jclass , jlong start1, jlong end1, jlong start2, jlong end2, jlong bisectStart, jlong bisectEnd) -{ - int rv = imaqGetBisectingLine(*((PointFloat*)start1), *((PointFloat*)end1), *((PointFloat*)start2), *((PointFloat*)end2), (PointFloat*)bisectStart, (PointFloat*)bisectEnd); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetDistance(PointFloat point1, PointFloat point2) - * JN: void imaqGetDistance(long point1, long point2, long distance) - * C: int imaqGetDistance(PointFloat point1, PointFloat point2, float* distance) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetDistance(JNIEnv* env, jclass , jlong point1, jlong point2, jlong distance) -{ - int rv = imaqGetDistance(*((PointFloat*)point1), *((PointFloat*)point2), (float*)distance); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetIntersection(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2) - * JN: void imaqGetIntersection(long start1, long end1, long start2, long end2, long intersection) - * C: int imaqGetIntersection(PointFloat start1, PointFloat end1, PointFloat start2, PointFloat end2, PointFloat* intersection) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetIntersection(JNIEnv* env, jclass , jlong start1, jlong end1, jlong start2, jlong end2, jlong intersection) -{ - int rv = imaqGetIntersection(*((PointFloat*)start1), *((PointFloat*)end1), *((PointFloat*)start2), *((PointFloat*)end2), (PointFloat*)intersection); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetMidLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point) - * JN: void imaqGetMidLine(long refLineStart, long refLineEnd, long point, long midLineStart, long midLineEnd) - * C: int imaqGetMidLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point, PointFloat* midLineStart, PointFloat* midLineEnd) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetMidLine(JNIEnv* env, jclass , jlong refLineStart, jlong refLineEnd, jlong point, jlong midLineStart, jlong midLineEnd) -{ - int rv = imaqGetMidLine(*((PointFloat*)refLineStart), *((PointFloat*)refLineEnd), *((PointFloat*)point), (PointFloat*)midLineStart, (PointFloat*)midLineEnd); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetPerpendicularLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point) - * JN: void imaqGetPerpendicularLine(long refLineStart, long refLineEnd, long point, long perpLineStart, long perpLineEnd, long distance) - * C: int imaqGetPerpendicularLine(PointFloat refLineStart, PointFloat refLineEnd, PointFloat point, PointFloat* perpLineStart, PointFloat* perpLineEnd, double* distance) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetPerpendicularLine(JNIEnv* env, jclass , jlong refLineStart, jlong refLineEnd, jlong point, jlong perpLineStart, jlong perpLineEnd, jlong distance) -{ - int rv = imaqGetPerpendicularLine(*((PointFloat*)refLineStart), *((PointFloat*)refLineEnd), *((PointFloat*)point), (PointFloat*)perpLineStart, (PointFloat*)perpLineEnd, (double*)distance); - if (rv == 0) throwJavaException(env); -} - -/* J: GetPointsOnContourResult imaqGetPointsOnContour(Image image) - * JN: long imaqGetPointsOnContour(long image, long numSegments) - * C: SegmentInfo* imaqGetPointsOnContour(const Image* image, int* numSegments) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetPointsOnContour(JNIEnv* env, jclass , jlong image, jlong numSegments) -{ - SegmentInfo* rv = imaqGetPointsOnContour((const Image*)image, (int*)numSegments); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: GetPointsOnLineResult imaqGetPointsOnLine(Point start, Point end) - * JN: long imaqGetPointsOnLine(long start, long end, long numPoints) - * C: Point* imaqGetPointsOnLine(Point start, Point end, int* numPoints) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetPointsOnLine(JNIEnv* env, jclass , jlong start, jlong end, jlong numPoints) -{ - Point* rv = imaqGetPointsOnLine(*((Point*)start), *((Point*)end), (int*)numPoints); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetPolygonArea(PointFloat points, int numPoints) - * JN: void imaqGetPolygonArea(long points, int numPoints, long area) - * C: int imaqGetPolygonArea(const PointFloat* points, int numPoints, float* area) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetPolygonArea(JNIEnv* env, jclass , jlong points, jint numPoints, jlong area) -{ - int rv = imaqGetPolygonArea((const PointFloat*)points, (int)numPoints, (float*)area); - if (rv == 0) throwJavaException(env); -} - -/* J: InterpolatePointsResult imaqInterpolatePoints(Image image, Point[] points, InterpolationMethod method, int subpixel) - * JN: long imaqInterpolatePoints(long image, long points, int numPoints, int method, int subpixel, long interpCount) - * C: float* imaqInterpolatePoints(const Image* image, const Point* points, int numPoints, InterpolationMethod method, int subpixel, int* interpCount) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqInterpolatePoints(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jint method, jint subpixel, jlong interpCount) -{ - float* rv = imaqInterpolatePoints((const Image*)image, (const Point*)points, (int)numPoints, (InterpolationMethod)method, (int)subpixel, (int*)interpCount); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Clipboard functions - */ - -/* - * Border functions - */ - -/* J: void imaqFillBorder(Image image, BorderMethod method) - * JN: void imaqFillBorder(long image, int method) - * C: int imaqFillBorder(Image* image, BorderMethod method) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFillBorder(JNIEnv* env, jclass , jlong image, jint method) -{ - int rv = imaqFillBorder((Image*)image, (BorderMethod)method); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetBorderSize(Image image) - * JN: void imaqGetBorderSize(long image, long borderSize) - * C: int imaqGetBorderSize(const Image* image, int* borderSize) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetBorderSize(JNIEnv* env, jclass , jlong image, jlong borderSize) -{ - int rv = imaqGetBorderSize((const Image*)image, (int*)borderSize); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetBorderSize(Image image, int size) - * JN: void imaqSetBorderSize(long image, int size) - * C: int imaqSetBorderSize(Image* image, int size) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetBorderSize(JNIEnv* env, jclass , jlong image, jint size) -{ - int rv = imaqSetBorderSize((Image*)image, (int)size); - if (rv == 0) throwJavaException(env); -} - -/* - * Image Management functions - */ - -/* J: void imaqArrayToImage(Image image, RawData array, int numCols, int numRows) - * JN: void imaqArrayToImage(long image, long array, int numCols, int numRows) - * C: int imaqArrayToImage(Image* image, const void* array, int numCols, int numRows) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqArrayToImage(JNIEnv* env, jclass , jlong image, jlong array, jint numCols, jint numRows) -{ - int rv = imaqArrayToImage((Image*)image, (const void*)array, (int)numCols, (int)numRows); - if (rv == 0) throwJavaException(env); -} - -/* J: Image imaqCreateImage(ImageType type, int borderSize) - * JN: long imaqCreateImage(int type, int borderSize) - * C: Image* imaqCreateImage(ImageType type, int borderSize) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCreateImage(JNIEnv* env, jclass , jint type, jint borderSize) -{ - Image* rv = imaqCreateImage((ImageType)type, (int)borderSize); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Color Processing functions - */ - -/* J: void imaqColorBCGTransform(Image dest, Image source, BCGOptions redOptions, BCGOptions greenOptions, BCGOptions blueOptions, Image mask) - * JN: void imaqColorBCGTransform(long dest, long source, long redOptions, long greenOptions, long blueOptions, long mask) - * C: int imaqColorBCGTransform(Image* dest, const Image* source, const BCGOptions* redOptions, const BCGOptions* greenOptions, const BCGOptions* blueOptions, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqColorBCGTransform(JNIEnv* env, jclass , jlong dest, jlong source, jlong redOptions, jlong greenOptions, jlong blueOptions, jlong mask) -{ - int rv = imaqColorBCGTransform((Image*)dest, (const Image*)source, (const BCGOptions*)redOptions, (const BCGOptions*)greenOptions, (const BCGOptions*)blueOptions, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqColorEqualize(Image dest, Image source, int colorEqualization) - * JN: void imaqColorEqualize(long dest, long source, int colorEqualization) - * C: int imaqColorEqualize(Image* dest, const Image* source, int colorEqualization) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqColorEqualize(JNIEnv* env, jclass , jlong dest, jlong source, jint colorEqualization) -{ - int rv = imaqColorEqualize((Image*)dest, (const Image*)source, (int)colorEqualization); - if (rv == 0) throwJavaException(env); -} - -/* J: ColorHistogramReport imaqColorHistogram2(Image image, int numClasses, ColorMode mode, CIEXYZValue whiteReference, Image mask) - * JN: long imaqColorHistogram2(long image, int numClasses, int mode, long whiteReference, long mask) - * C: ColorHistogramReport* imaqColorHistogram2(Image* image, int numClasses, ColorMode mode, const CIEXYZValue* whiteReference, Image* mask) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqColorHistogram2(JNIEnv* env, jclass , jlong image, jint numClasses, jint mode, jlong whiteReference, jlong mask) -{ - ColorHistogramReport* rv = imaqColorHistogram2((Image*)image, (int)numClasses, (ColorMode)mode, (const CIEXYZValue*)whiteReference, (Image*)mask); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqColorThreshold(Image dest, Image source, int replaceValue, ColorMode mode, Range plane1Range, Range plane2Range, Range plane3Range) - * JN: void imaqColorThreshold(long dest, long source, int replaceValue, int mode, long plane1Range, long plane2Range, long plane3Range) - * C: int imaqColorThreshold(Image* dest, const Image* source, int replaceValue, ColorMode mode, const Range* plane1Range, const Range* plane2Range, const Range* plane3Range) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqColorThreshold(JNIEnv* env, jclass , jlong dest, jlong source, jint replaceValue, jint mode, jlong plane1Range, jlong plane2Range, jlong plane3Range) -{ - int rv = imaqColorThreshold((Image*)dest, (const Image*)source, (int)replaceValue, (ColorMode)mode, (const Range*)plane1Range, (const Range*)plane2Range, (const Range*)plane3Range); - if (rv == 0) throwJavaException(env); -} - -/* J: SupervisedColorSegmentationReport imaqSupervisedColorSegmentation(ClassifierSession session, Image labelImage, Image srcImage, ROI roi, ROILabel labelIn, int numLabelIn, int maxDistance, int minIdentificationScore, ColorSegmenationOptions segmentOptions) - * JN: long imaqSupervisedColorSegmentation(long session, long labelImage, long srcImage, long roi, long labelIn, int numLabelIn, int maxDistance, int minIdentificationScore, long segmentOptions) - * C: SupervisedColorSegmentationReport* imaqSupervisedColorSegmentation(ClassifierSession* session, Image* labelImage, const Image* srcImage, const ROI* roi, const ROILabel* labelIn, unsigned int numLabelIn, int maxDistance, int minIdentificationScore, const ColorSegmenationOptions* segmentOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqSupervisedColorSegmentation(JNIEnv* env, jclass , jlong session, jlong labelImage, jlong srcImage, jlong roi, jlong labelIn, jint numLabelIn, jint maxDistance, jint minIdentificationScore, jlong segmentOptions) -{ - SupervisedColorSegmentationReport* rv = imaqSupervisedColorSegmentation((ClassifierSession*)session, (Image*)labelImage, (const Image*)srcImage, (const ROI*)roi, (const ROILabel*)labelIn, (unsigned int)numLabelIn, (int)maxDistance, (int)minIdentificationScore, (const ColorSegmenationOptions*)segmentOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetColorSegmentationMaxDistance(ClassifierSession session, ColorSegmenationOptions segmentOptions, SegmentationDistanceLevel distLevel) - * JN: void imaqGetColorSegmentationMaxDistance(long session, long segmentOptions, int distLevel, long maxDistance) - * C: int imaqGetColorSegmentationMaxDistance(ClassifierSession* session, const ColorSegmenationOptions* segmentOptions, SegmentationDistanceLevel distLevel, int* maxDistance) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetColorSegmentationMaxDistance(JNIEnv* env, jclass , jlong session, jlong segmentOptions, jint distLevel, jlong maxDistance) -{ - int rv = imaqGetColorSegmentationMaxDistance((ClassifierSession*)session, (const ColorSegmenationOptions*)segmentOptions, (SegmentationDistanceLevel)distLevel, (int*)maxDistance); - if (rv == 0) throwJavaException(env); -} - -/* - * Transform functions - */ - -/* J: void imaqBCGTransform(Image dest, Image source, BCGOptions options, Image mask) - * JN: void imaqBCGTransform(long dest, long source, long options, long mask) - * C: int imaqBCGTransform(Image* dest, const Image* source, const BCGOptions* options, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqBCGTransform(JNIEnv* env, jclass , jlong dest, jlong source, jlong options, jlong mask) -{ - int rv = imaqBCGTransform((Image*)dest, (const Image*)source, (const BCGOptions*)options, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqEqualize(Image dest, Image source, float min, float max, Image mask) - * JN: void imaqEqualize(long dest, long source, float min, float max, long mask) - * C: int imaqEqualize(Image* dest, const Image* source, float min, float max, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqEqualize(JNIEnv* env, jclass , jlong dest, jlong source, jfloat min, jfloat max, jlong mask) -{ - int rv = imaqEqualize((Image*)dest, (const Image*)source, (float)min, (float)max, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqInverse(Image dest, Image source, Image mask) - * JN: void imaqInverse(long dest, long source, long mask) - * C: int imaqInverse(Image* dest, const Image* source, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqInverse(JNIEnv* env, jclass , jlong dest, jlong source, jlong mask) -{ - int rv = imaqInverse((Image*)dest, (const Image*)source, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMathTransform(Image dest, Image source, MathTransformMethod method, float rangeMin, float rangeMax, float power, Image mask) - * JN: void imaqMathTransform(long dest, long source, int method, float rangeMin, float rangeMax, float power, long mask) - * C: int imaqMathTransform(Image* dest, const Image* source, MathTransformMethod method, float rangeMin, float rangeMax, float power, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMathTransform(JNIEnv* env, jclass , jlong dest, jlong source, jint method, jfloat rangeMin, jfloat rangeMax, jfloat power, jlong mask) -{ - int rv = imaqMathTransform((Image*)dest, (const Image*)source, (MathTransformMethod)method, (float)rangeMin, (float)rangeMax, (float)power, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWatershedTransform(Image dest, Image source, int connectivity8) - * JN: void imaqWatershedTransform(long dest, long source, int connectivity8, long zoneCount) - * C: int imaqWatershedTransform(Image* dest, const Image* source, int connectivity8, int* zoneCount) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWatershedTransform(JNIEnv* env, jclass , jlong dest, jlong source, jint connectivity8, jlong zoneCount) -{ - int rv = imaqWatershedTransform((Image*)dest, (const Image*)source, (int)connectivity8, (int*)zoneCount); - if (rv == 0) throwJavaException(env); -} - -/* - * Window Management functions - */ - -/* - * Utilities functions - */ - -/* J: void imaqMulticoreOptions(MulticoreOperation operation) - * JN: void imaqMulticoreOptions(int operation, long customNumCores) - * C: int imaqMulticoreOptions(MulticoreOperation operation, unsigned int* customNumCores) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMulticoreOptions(JNIEnv* env, jclass , jint operation, jlong customNumCores) -{ - int rv = imaqMulticoreOptions((MulticoreOperation)operation, (unsigned int*)customNumCores); - if (rv == 0) throwJavaException(env); -} - -/* - * Tool Window functions - */ - -/* - * Meter functions - */ - -/* J: MeterArc imaqGetMeterArc(int lightNeedle, MeterArcMode mode, ROI roi, PointFloat base, PointFloat start, PointFloat end) - * JN: long imaqGetMeterArc(int lightNeedle, int mode, long roi, long base, long start, long end) - * C: MeterArc* imaqGetMeterArc(int lightNeedle, MeterArcMode mode, const ROI* roi, PointFloat base, PointFloat start, PointFloat end) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetMeterArc(JNIEnv* env, jclass , jint lightNeedle, jint mode, jlong roi, jlong base, jlong start, jlong end) -{ - MeterArc* rv = imaqGetMeterArc((int)lightNeedle, (MeterArcMode)mode, (const ROI*)roi, *((PointFloat*)base), *((PointFloat*)start), *((PointFloat*)end)); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqReadMeter(Image image, MeterArc arcInfo) - * JN: void imaqReadMeter(long image, long arcInfo, long percentage, long endOfNeedle) - * C: int imaqReadMeter(const Image* image, const MeterArc* arcInfo, double* percentage, PointFloat* endOfNeedle) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReadMeter(JNIEnv* env, jclass , jlong image, jlong arcInfo, jlong percentage, jlong endOfNeedle) -{ - int rv = imaqReadMeter((const Image*)image, (const MeterArc*)arcInfo, (double*)percentage, (PointFloat*)endOfNeedle); - if (rv == 0) throwJavaException(env); -} - -/* - * Calibration functions - */ - -/* J: void imaqCopyCalibrationInfo2(Image dest, Image source, Point offset) - * JN: void imaqCopyCalibrationInfo2(long dest, long source, long offset) - * C: int imaqCopyCalibrationInfo2(Image* dest, Image* source, Point offset) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCopyCalibrationInfo2(JNIEnv* env, jclass , jlong dest, jlong source, jlong offset) -{ - int rv = imaqCopyCalibrationInfo2((Image*)dest, (Image*)source, *((Point*)offset)); - if (rv == 0) throwJavaException(env); -} - -/* J: CalibrationInfo imaqGetCalibrationInfo2(Image image) - * JN: long imaqGetCalibrationInfo2(long image) - * C: CalibrationInfo* imaqGetCalibrationInfo2(const Image* image) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetCalibrationInfo2(JNIEnv* env, jclass , jlong image) -{ - CalibrationInfo* rv = imaqGetCalibrationInfo2((const Image*)image); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: CalibrationInfo imaqGetCalibrationInfo3(Image image, int isGetErrorMap) - * JN: long imaqGetCalibrationInfo3(long image, int isGetErrorMap) - * C: CalibrationInfo* imaqGetCalibrationInfo3(Image* image, unsigned int isGetErrorMap) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetCalibrationInfo3(JNIEnv* env, jclass , jlong image, jint isGetErrorMap) -{ - CalibrationInfo* rv = imaqGetCalibrationInfo3((Image*)image, (unsigned int)isGetErrorMap); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqLearnCalibrationGrid(Image image, ROI roi, LearnCalibrationOptions options, GridDescriptor grid, CoordinateSystem system, RangeFloat range) - * JN: void imaqLearnCalibrationGrid(long image, long roi, long options, long grid, long system, long range, long quality) - * C: int imaqLearnCalibrationGrid(Image* image, const ROI* roi, const LearnCalibrationOptions* options, const GridDescriptor* grid, const CoordinateSystem* system, const RangeFloat* range, float* quality) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnCalibrationGrid(JNIEnv* env, jclass , jlong image, jlong roi, jlong options, jlong grid, jlong system, jlong range, jlong quality) -{ - int rv = imaqLearnCalibrationGrid((Image*)image, (const ROI*)roi, (const LearnCalibrationOptions*)options, (const GridDescriptor*)grid, (const CoordinateSystem*)system, (const RangeFloat*)range, (float*)quality); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLearnCalibrationPoints(Image image, CalibrationPoints points, ROI roi, LearnCalibrationOptions options, GridDescriptor grid, CoordinateSystem system) - * JN: void imaqLearnCalibrationPoints(long image, long points, long roi, long options, long grid, long system, long quality) - * C: int imaqLearnCalibrationPoints(Image* image, const CalibrationPoints* points, const ROI* roi, const LearnCalibrationOptions* options, const GridDescriptor* grid, const CoordinateSystem* system, float* quality) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnCalibrationPoints(JNIEnv* env, jclass , jlong image, jlong points, jlong roi, jlong options, jlong grid, jlong system, jlong quality) -{ - int rv = imaqLearnCalibrationPoints((Image*)image, (const CalibrationPoints*)points, (const ROI*)roi, (const LearnCalibrationOptions*)options, (const GridDescriptor*)grid, (const CoordinateSystem*)system, (float*)quality); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetCoordinateSystem(Image image, CoordinateSystem system) - * JN: void imaqSetCoordinateSystem(long image, long system) - * C: int imaqSetCoordinateSystem(Image* image, const CoordinateSystem* system) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetCoordinateSystem(JNIEnv* env, jclass , jlong image, jlong system) -{ - int rv = imaqSetCoordinateSystem((Image*)image, (const CoordinateSystem*)system); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetSimpleCalibration(Image image, ScalingMethod method, int learnTable, GridDescriptor grid, CoordinateSystem system) - * JN: void imaqSetSimpleCalibration(long image, int method, int learnTable, long grid, long system) - * C: int imaqSetSimpleCalibration(Image* image, ScalingMethod method, int learnTable, const GridDescriptor* grid, const CoordinateSystem* system) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetSimpleCalibration(JNIEnv* env, jclass , jlong image, jint method, jint learnTable, jlong grid, jlong system) -{ - int rv = imaqSetSimpleCalibration((Image*)image, (ScalingMethod)method, (int)learnTable, (const GridDescriptor*)grid, (const CoordinateSystem*)system); - if (rv == 0) throwJavaException(env); -} - -/* J: TransformReport imaqTransformPixelToRealWorld(Image image, PointFloat[] pixelCoordinates) - * JN: long imaqTransformPixelToRealWorld(long image, long pixelCoordinates, int numCoordinates) - * C: TransformReport* imaqTransformPixelToRealWorld(const Image* image, const PointFloat* pixelCoordinates, int numCoordinates) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqTransformPixelToRealWorld(JNIEnv* env, jclass , jlong image, jlong pixelCoordinates, jint numCoordinates) -{ - TransformReport* rv = imaqTransformPixelToRealWorld((const Image*)image, (const PointFloat*)pixelCoordinates, (int)numCoordinates); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: TransformReport imaqTransformRealWorldToPixel(Image image, PointFloat[] realWorldCoordinates) - * JN: long imaqTransformRealWorldToPixel(long image, long realWorldCoordinates, int numCoordinates) - * C: TransformReport* imaqTransformRealWorldToPixel(const Image* image, const PointFloat* realWorldCoordinates, int numCoordinates) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqTransformRealWorldToPixel(JNIEnv* env, jclass , jlong image, jlong realWorldCoordinates, jint numCoordinates) -{ - TransformReport* rv = imaqTransformRealWorldToPixel((const Image*)image, (const PointFloat*)realWorldCoordinates, (int)numCoordinates); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqSetSimpleCalibration2(Image image, GridDescriptor gridDescriptor) - * JN: void imaqSetSimpleCalibration2(long image, long gridDescriptor) - * C: int imaqSetSimpleCalibration2(Image* image, const GridDescriptor* gridDescriptor) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetSimpleCalibration2(JNIEnv* env, jclass , jlong image, jlong gridDescriptor) -{ - int rv = imaqSetSimpleCalibration2((Image*)image, (const GridDescriptor*)gridDescriptor); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqCalibrationSetAxisInfo(Image image) - * JN: void imaqCalibrationSetAxisInfo(long image, long axisInfo) - * C: int imaqCalibrationSetAxisInfo(Image* image, CoordinateSystem* axisInfo) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCalibrationSetAxisInfo(JNIEnv* env, jclass , jlong image, jlong axisInfo) -{ - int rv = imaqCalibrationSetAxisInfo((Image*)image, (CoordinateSystem*)axisInfo); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqCalibrationGetThumbnailImage(Image templateImage, Image image, CalibrationThumbnailType type, int index) - * JN: void imaqCalibrationGetThumbnailImage(long templateImage, long image, int type, int index) - * C: int imaqCalibrationGetThumbnailImage(Image* templateImage, Image* image, CalibrationThumbnailType type, unsigned int index) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCalibrationGetThumbnailImage(JNIEnv* env, jclass , jlong templateImage, jlong image, jint type, jint index) -{ - int rv = imaqCalibrationGetThumbnailImage((Image*)templateImage, (Image*)image, (CalibrationThumbnailType)type, (unsigned int)index); - if (rv == 0) throwJavaException(env); -} - -/* J: GetCalibrationInfoReport imaqCalibrationGetCalibrationInfo(Image image, int isGetErrorMap) - * JN: long imaqCalibrationGetCalibrationInfo(long image, int isGetErrorMap) - * C: GetCalibrationInfoReport* imaqCalibrationGetCalibrationInfo(Image* image, unsigned int isGetErrorMap) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCalibrationGetCalibrationInfo(JNIEnv* env, jclass , jlong image, jint isGetErrorMap) -{ - GetCalibrationInfoReport* rv = imaqCalibrationGetCalibrationInfo((Image*)image, (unsigned int)isGetErrorMap); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: GetCameraParametersReport imaqCalibrationGetCameraParameters(Image templateImage) - * JN: long imaqCalibrationGetCameraParameters(long templateImage) - * C: GetCameraParametersReport* imaqCalibrationGetCameraParameters(Image* templateImage) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCalibrationGetCameraParameters(JNIEnv* env, jclass , jlong templateImage) -{ - GetCameraParametersReport* rv = imaqCalibrationGetCameraParameters((Image*)templateImage); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqCalibrationCompactInformation(Image image) - * JN: void imaqCalibrationCompactInformation(long image) - * C: int imaqCalibrationCompactInformation(Image* image) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCalibrationCompactInformation(JNIEnv* env, jclass , jlong image) -{ - int rv = imaqCalibrationCompactInformation((Image*)image); - if (rv == 0) throwJavaException(env); -} - -/* - * Pixel Manipulation functions - */ - -/* J: void imaqExtractColorPlanes(Image image, ColorMode mode, Image plane1, Image plane2, Image plane3) - * JN: void imaqExtractColorPlanes(long image, int mode, long plane1, long plane2, long plane3) - * C: int imaqExtractColorPlanes(const Image* image, ColorMode mode, Image* plane1, Image* plane2, Image* plane3) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqExtractColorPlanes(JNIEnv* env, jclass , jlong image, jint mode, jlong plane1, jlong plane2, jlong plane3) -{ - int rv = imaqExtractColorPlanes((const Image*)image, (ColorMode)mode, (Image*)plane1, (Image*)plane2, (Image*)plane3); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqExtractComplexPlane(Image dest, Image source, ComplexPlane plane) - * JN: void imaqExtractComplexPlane(long dest, long source, int plane) - * C: int imaqExtractComplexPlane(Image* dest, const Image* source, ComplexPlane plane) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqExtractComplexPlane(JNIEnv* env, jclass , jlong dest, jlong source, jint plane) -{ - int rv = imaqExtractComplexPlane((Image*)dest, (const Image*)source, (ComplexPlane)plane); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqReplaceColorPlanes(Image dest, Image source, ColorMode mode, Image plane1, Image plane2, Image plane3) - * JN: void imaqReplaceColorPlanes(long dest, long source, int mode, long plane1, long plane2, long plane3) - * C: int imaqReplaceColorPlanes(Image* dest, const Image* source, ColorMode mode, const Image* plane1, const Image* plane2, const Image* plane3) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReplaceColorPlanes(JNIEnv* env, jclass , jlong dest, jlong source, jint mode, jlong plane1, jlong plane2, jlong plane3) -{ - int rv = imaqReplaceColorPlanes((Image*)dest, (const Image*)source, (ColorMode)mode, (const Image*)plane1, (const Image*)plane2, (const Image*)plane3); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqReplaceComplexPlane(Image dest, Image source, Image newValues, ComplexPlane plane) - * JN: void imaqReplaceComplexPlane(long dest, long source, long newValues, int plane) - * C: int imaqReplaceComplexPlane(Image* dest, const Image* source, const Image* newValues, ComplexPlane plane) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReplaceComplexPlane(JNIEnv* env, jclass , jlong dest, jlong source, jlong newValues, jint plane) -{ - int rv = imaqReplaceComplexPlane((Image*)dest, (const Image*)source, (const Image*)newValues, (ComplexPlane)plane); - if (rv == 0) throwJavaException(env); -} - -/* - * Color Matching functions - */ - -/* J: ColorInformation imaqLearnColor(Image image, ROI roi, ColorSensitivity sensitivity, int saturation) - * JN: long imaqLearnColor(long image, long roi, int sensitivity, int saturation) - * C: ColorInformation* imaqLearnColor(const Image* image, const ROI* roi, ColorSensitivity sensitivity, int saturation) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqLearnColor(JNIEnv* env, jclass , jlong image, jlong roi, jint sensitivity, jint saturation) -{ - ColorInformation* rv = imaqLearnColor((const Image*)image, (const ROI*)roi, (ColorSensitivity)sensitivity, (int)saturation); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: MatchColorResult imaqMatchColor(Image image, ColorInformation info, ROI roi) - * JN: long imaqMatchColor(long image, long info, long roi, long numScores) - * C: int* imaqMatchColor(const Image* image, const ColorInformation* info, const ROI* roi, int* numScores) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchColor(JNIEnv* env, jclass , jlong image, jlong info, jlong roi, jlong numScores) -{ - int* rv = imaqMatchColor((const Image*)image, (const ColorInformation*)info, (const ROI*)roi, (int*)numScores); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Frequency Domain Analysis functions - */ - -/* J: void imaqAttenuate(Image dest, Image source, AttenuateMode highlow) - * JN: void imaqAttenuate(long dest, long source, int highlow) - * C: int imaqAttenuate(Image* dest, const Image* source, AttenuateMode highlow) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAttenuate(JNIEnv* env, jclass , jlong dest, jlong source, jint highlow) -{ - int rv = imaqAttenuate((Image*)dest, (const Image*)source, (AttenuateMode)highlow); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqConjugate(Image dest, Image source) - * JN: void imaqConjugate(long dest, long source) - * C: int imaqConjugate(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqConjugate(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqConjugate((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqFFT(Image dest, Image source) - * JN: void imaqFFT(long dest, long source) - * C: int imaqFFT(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFFT(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqFFT((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqFlipFrequencies(Image dest, Image source) - * JN: void imaqFlipFrequencies(long dest, long source) - * C: int imaqFlipFrequencies(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFlipFrequencies(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqFlipFrequencies((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqInverseFFT(Image dest, Image source) - * JN: void imaqInverseFFT(long dest, long source) - * C: int imaqInverseFFT(Image* dest, const Image* source) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqInverseFFT(JNIEnv* env, jclass , jlong dest, jlong source) -{ - int rv = imaqInverseFFT((Image*)dest, (const Image*)source); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqTruncate(Image dest, Image source, TruncateMode highlow, float ratioToKeep) - * JN: void imaqTruncate(long dest, long source, int highlow, float ratioToKeep) - * C: int imaqTruncate(Image* dest, const Image* source, TruncateMode highlow, float ratioToKeep) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqTruncate(JNIEnv* env, jclass , jlong dest, jlong source, jint highlow, jfloat ratioToKeep) -{ - int rv = imaqTruncate((Image*)dest, (const Image*)source, (TruncateMode)highlow, (float)ratioToKeep); - if (rv == 0) throwJavaException(env); -} - -/* - * Barcode I/O functions - */ - -/* J: void imaqGradeDataMatrixBarcodeAIM(Image image) - * JN: void imaqGradeDataMatrixBarcodeAIM(long image, long report) - * C: int imaqGradeDataMatrixBarcodeAIM(const Image* image, AIMGradeReport* report) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGradeDataMatrixBarcodeAIM(JNIEnv* env, jclass , jlong image, jlong report) -{ - int rv = imaqGradeDataMatrixBarcodeAIM((const Image*)image, (AIMGradeReport*)report); - if (rv == 0) throwJavaException(env); -} - -/* J: BarcodeInfo imaqReadBarcode(Image image, BarcodeType type, ROI roi, int validate) - * JN: long imaqReadBarcode(long image, int type, long roi, int validate) - * C: BarcodeInfo* imaqReadBarcode(const Image* image, BarcodeType type, const ROI* roi, int validate) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadBarcode(JNIEnv* env, jclass , jlong image, jint type, jlong roi, jint validate) -{ - BarcodeInfo* rv = imaqReadBarcode((const Image*)image, (BarcodeType)type, (const ROI*)roi, (int)validate); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: DataMatrixReport imaqReadDataMatrixBarcode2(Image image, ROI roi, DataMatrixGradingMode prepareForGrading, DataMatrixDescriptionOptions descriptionOptions, DataMatrixSizeOptions sizeOptions, DataMatrixSearchOptions searchOptions) - * JN: long imaqReadDataMatrixBarcode2(long image, long roi, int prepareForGrading, long descriptionOptions, long sizeOptions, long searchOptions) - * C: DataMatrixReport* imaqReadDataMatrixBarcode2(Image* image, const ROI* roi, DataMatrixGradingMode prepareForGrading, const DataMatrixDescriptionOptions* descriptionOptions, const DataMatrixSizeOptions* sizeOptions, const DataMatrixSearchOptions* searchOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadDataMatrixBarcode2(JNIEnv* env, jclass , jlong image, jlong roi, jint prepareForGrading, jlong descriptionOptions, jlong sizeOptions, jlong searchOptions) -{ - DataMatrixReport* rv = imaqReadDataMatrixBarcode2((Image*)image, (const ROI*)roi, (DataMatrixGradingMode)prepareForGrading, (const DataMatrixDescriptionOptions*)descriptionOptions, (const DataMatrixSizeOptions*)sizeOptions, (const DataMatrixSearchOptions*)searchOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ReadPDF417BarcodeResult imaqReadPDF417Barcode(Image image, ROI roi, Barcode2DSearchMode searchMode) - * JN: long imaqReadPDF417Barcode(long image, long roi, int searchMode, long numBarcodes) - * C: Barcode2DInfo* imaqReadPDF417Barcode(const Image* image, const ROI* roi, Barcode2DSearchMode searchMode, unsigned int* numBarcodes) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadPDF417Barcode(JNIEnv* env, jclass , jlong image, jlong roi, jint searchMode, jlong numBarcodes) -{ - Barcode2DInfo* rv = imaqReadPDF417Barcode((const Image*)image, (const ROI*)roi, (Barcode2DSearchMode)searchMode, (unsigned int*)numBarcodes); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: QRCodeReport imaqReadQRCode(Image image, ROI roi, QRGradingMode reserved, QRCodeDescriptionOptions descriptionOptions, QRCodeSizeOptions sizeOptions, QRCodeSearchOptions searchOptions) - * JN: long imaqReadQRCode(long image, long roi, int reserved, long descriptionOptions, long sizeOptions, long searchOptions) - * C: QRCodeReport* imaqReadQRCode(Image* image, const ROI* roi, QRGradingMode reserved, const QRCodeDescriptionOptions* descriptionOptions, const QRCodeSizeOptions* sizeOptions, const QRCodeSearchOptions* searchOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadQRCode(JNIEnv* env, jclass , jlong image, jlong roi, jint reserved, jlong descriptionOptions, jlong sizeOptions, jlong searchOptions) -{ - QRCodeReport* rv = imaqReadQRCode((Image*)image, (const ROI*)roi, (QRGradingMode)reserved, (const QRCodeDescriptionOptions*)descriptionOptions, (const QRCodeSizeOptions*)sizeOptions, (const QRCodeSearchOptions*)searchOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * LCD functions - */ - -/* J: void imaqFindLCDSegments(ROI roi, Image image, LCDOptions options) - * JN: void imaqFindLCDSegments(long roi, long image, long options) - * C: int imaqFindLCDSegments(ROI* roi, const Image* image, const LCDOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqFindLCDSegments(JNIEnv* env, jclass , jlong roi, jlong image, jlong options) -{ - int rv = imaqFindLCDSegments((ROI*)roi, (const Image*)image, (const LCDOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: LCDReport imaqReadLCD(Image image, ROI roi, LCDOptions options) - * JN: long imaqReadLCD(long image, long roi, long options) - * C: LCDReport* imaqReadLCD(const Image* image, const ROI* roi, const LCDOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadLCD(JNIEnv* env, jclass , jlong image, jlong roi, jlong options) -{ - LCDReport* rv = imaqReadLCD((const Image*)image, (const ROI*)roi, (const LCDOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Shape Matching functions - */ - -/* J: MatchShapeResult imaqMatchShape(Image dest, Image source, Image templateImage, int scaleInvariant, int connectivity8, double tolerance) - * JN: long imaqMatchShape(long dest, long source, long templateImage, int scaleInvariant, int connectivity8, double tolerance, long numMatches) - * C: ShapeReport* imaqMatchShape(Image* dest, Image* source, const Image* templateImage, int scaleInvariant, int connectivity8, double tolerance, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchShape(JNIEnv* env, jclass , jlong dest, jlong source, jlong templateImage, jint scaleInvariant, jint connectivity8, jdouble tolerance, jlong numMatches) -{ - ShapeReport* rv = imaqMatchShape((Image*)dest, (Image*)source, (const Image*)templateImage, (int)scaleInvariant, (int)connectivity8, (double)tolerance, (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Contours functions - */ - -/* J: int imaqAddAnnulusContour(ROI roi, Annulus annulus) - * JN: int imaqAddAnnulusContour(long roi, long annulus) - * C: ContourID imaqAddAnnulusContour(ROI* roi, Annulus annulus) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddAnnulusContour(JNIEnv* env, jclass , jlong roi, jlong annulus) -{ - ContourID rv = imaqAddAnnulusContour((ROI*)roi, *((Annulus*)annulus)); - - return (jint)rv; -} - -/* J: int imaqAddClosedContour(ROI roi, Point[] points) - * JN: int imaqAddClosedContour(long roi, long points, int numPoints) - * C: ContourID imaqAddClosedContour(ROI* roi, const Point* points, int numPoints) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddClosedContour(JNIEnv* env, jclass , jlong roi, jlong points, jint numPoints) -{ - ContourID rv = imaqAddClosedContour((ROI*)roi, (const Point*)points, (int)numPoints); - - return (jint)rv; -} - -/* J: int imaqAddLineContour(ROI roi, Point start, Point end) - * JN: int imaqAddLineContour(long roi, long start, long end) - * C: ContourID imaqAddLineContour(ROI* roi, Point start, Point end) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddLineContour(JNIEnv* env, jclass , jlong roi, jlong start, jlong end) -{ - ContourID rv = imaqAddLineContour((ROI*)roi, *((Point*)start), *((Point*)end)); - - return (jint)rv; -} - -/* J: int imaqAddOpenContour(ROI roi, Point[] points) - * JN: int imaqAddOpenContour(long roi, long points, int numPoints) - * C: ContourID imaqAddOpenContour(ROI* roi, const Point* points, int numPoints) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddOpenContour(JNIEnv* env, jclass , jlong roi, jlong points, jint numPoints) -{ - ContourID rv = imaqAddOpenContour((ROI*)roi, (const Point*)points, (int)numPoints); - - return (jint)rv; -} - -/* J: int imaqAddOvalContour(ROI roi, Rect boundingBox) - * JN: int imaqAddOvalContour(long roi, long boundingBox) - * C: ContourID imaqAddOvalContour(ROI* roi, Rect boundingBox) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddOvalContour(JNIEnv* env, jclass , jlong roi, jlong boundingBox) -{ - ContourID rv = imaqAddOvalContour((ROI*)roi, *((Rect*)boundingBox)); - - return (jint)rv; -} - -/* J: int imaqAddPointContour(ROI roi, Point point) - * JN: int imaqAddPointContour(long roi, long point) - * C: ContourID imaqAddPointContour(ROI* roi, Point point) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddPointContour(JNIEnv* env, jclass , jlong roi, jlong point) -{ - ContourID rv = imaqAddPointContour((ROI*)roi, *((Point*)point)); - - return (jint)rv; -} - -/* J: int imaqAddRectContour(ROI roi, Rect rect) - * JN: int imaqAddRectContour(long roi, long rect) - * C: ContourID imaqAddRectContour(ROI* roi, Rect rect) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddRectContour(JNIEnv* env, jclass , jlong roi, jlong rect) -{ - ContourID rv = imaqAddRectContour((ROI*)roi, *((Rect*)rect)); - - return (jint)rv; -} - -/* J: int imaqAddRotatedRectContour2(ROI roi, RotatedRect rect) - * JN: int imaqAddRotatedRectContour2(long roi, long rect) - * C: ContourID imaqAddRotatedRectContour2(ROI* roi, RotatedRect rect) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqAddRotatedRectContour2(JNIEnv* env, jclass , jlong roi, jlong rect) -{ - ContourID rv = imaqAddRotatedRectContour2((ROI*)roi, *((RotatedRect*)rect)); - - return (jint)rv; -} - -/* J: int imaqCopyContour(ROI destRoi, ROI sourceRoi, int id) - * JN: int imaqCopyContour(long destRoi, long sourceRoi, int id) - * C: ContourID imaqCopyContour(ROI* destRoi, const ROI* sourceRoi, ContourID id) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqCopyContour(JNIEnv* env, jclass , jlong destRoi, jlong sourceRoi, jint id) -{ - ContourID rv = imaqCopyContour((ROI*)destRoi, (const ROI*)sourceRoi, (ContourID)id); - - return (jint)rv; -} - -/* J: int imaqGetContour(ROI roi, int index) - * JN: int imaqGetContour(long roi, int index) - * C: ContourID imaqGetContour(const ROI* roi, unsigned int index) - */ - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1imaqGetContour(JNIEnv* env, jclass , jlong roi, jint index) -{ - ContourID rv = imaqGetContour((const ROI*)roi, (unsigned int)index); - - return (jint)rv; -} - -/* J: void imaqGetContourColor(ROI roi, int id) - * JN: void imaqGetContourColor(long roi, int id, long contourColor) - * C: int imaqGetContourColor(const ROI* roi, ContourID id, RGBValue* contourColor) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetContourColor(JNIEnv* env, jclass , jlong roi, jint id, jlong contourColor) -{ - int rv = imaqGetContourColor((const ROI*)roi, (ContourID)id, (RGBValue*)contourColor); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetContourCount(ROI roi) - * JN: void imaqGetContourCount(long roi) - * C: int imaqGetContourCount(const ROI* roi) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetContourCount(JNIEnv* env, jclass , jlong roi) -{ - int rv = imaqGetContourCount((const ROI*)roi); - if (rv == 0) throwJavaException(env); -} - -/* J: ContourInfo2 imaqGetContourInfo2(ROI roi, int id) - * JN: long imaqGetContourInfo2(long roi, int id) - * C: ContourInfo2* imaqGetContourInfo2(const ROI* roi, ContourID id) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetContourInfo2(JNIEnv* env, jclass , jlong roi, jint id) -{ - ContourInfo2* rv = imaqGetContourInfo2((const ROI*)roi, (ContourID)id); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqMoveContour(ROI roi, int id, int deltaX, int deltaY) - * JN: void imaqMoveContour(long roi, int id, int deltaX, int deltaY) - * C: int imaqMoveContour(ROI* roi, ContourID id, int deltaX, int deltaY) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMoveContour(JNIEnv* env, jclass , jlong roi, jint id, jint deltaX, jint deltaY) -{ - int rv = imaqMoveContour((ROI*)roi, (ContourID)id, (int)deltaX, (int)deltaY); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqRemoveContour(ROI roi, int id) - * JN: void imaqRemoveContour(long roi, int id) - * C: int imaqRemoveContour(ROI* roi, ContourID id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRemoveContour(JNIEnv* env, jclass , jlong roi, jint id) -{ - int rv = imaqRemoveContour((ROI*)roi, (ContourID)id); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetContourColor(ROI roi, int id, RGBValue color) - * JN: void imaqSetContourColor(long roi, int id, long color) - * C: int imaqSetContourColor(ROI* roi, ContourID id, const RGBValue* color) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetContourColor(JNIEnv* env, jclass , jlong roi, jint id, jlong color) -{ - int rv = imaqSetContourColor((ROI*)roi, (ContourID)id, (const RGBValue*)color); - if (rv == 0) throwJavaException(env); -} - -/* - * Regions of Interest functions - */ - -/* J: ROI imaqCreateROI() - * JN: long imaqCreateROI() - * C: ROI* imaqCreateROI( void) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCreateROI(JNIEnv* env, jclass ) -{ - ROI* rv = imaqCreateROI(); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetROIBoundingBox(ROI roi) - * JN: void imaqGetROIBoundingBox(long roi, long boundingBox) - * C: int imaqGetROIBoundingBox(const ROI* roi, Rect* boundingBox) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetROIBoundingBox(JNIEnv* env, jclass , jlong roi, jlong boundingBox) -{ - int rv = imaqGetROIBoundingBox((const ROI*)roi, (Rect*)boundingBox); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetROIColor(ROI roi) - * JN: void imaqGetROIColor(long roi, long roiColor) - * C: int imaqGetROIColor(const ROI* roi, RGBValue* roiColor) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetROIColor(JNIEnv* env, jclass , jlong roi, jlong roiColor) -{ - int rv = imaqGetROIColor((const ROI*)roi, (RGBValue*)roiColor); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetROIColor(ROI roi, RGBValue color) - * JN: void imaqSetROIColor(long roi, long color) - * C: int imaqSetROIColor(ROI* roi, const RGBValue* color) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetROIColor(JNIEnv* env, jclass , jlong roi, jlong color) -{ - int rv = imaqSetROIColor((ROI*)roi, (const RGBValue*)color); - if (rv == 0) throwJavaException(env); -} - -/* - * Image Analysis functions - */ - -/* J: void imaqCentroid(Image image, Image mask) - * JN: void imaqCentroid(long image, long centroid, long mask) - * C: int imaqCentroid(const Image* image, PointFloat* centroid, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCentroid(JNIEnv* env, jclass , jlong image, jlong centroid, jlong mask) -{ - int rv = imaqCentroid((const Image*)image, (PointFloat*)centroid, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: ExtractCurvesResult imaqExtractCurves(Image image, ROI roi, CurveOptions curveOptions) - * JN: long imaqExtractCurves(long image, long roi, long curveOptions, long numCurves) - * C: Curve* imaqExtractCurves(const Image* image, const ROI* roi, const CurveOptions* curveOptions, unsigned int* numCurves) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqExtractCurves(JNIEnv* env, jclass , jlong image, jlong roi, jlong curveOptions, jlong numCurves) -{ - Curve* rv = imaqExtractCurves((const Image*)image, (const ROI*)roi, (const CurveOptions*)curveOptions, (unsigned int*)numCurves); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: HistogramReport imaqHistogram(Image image, int numClasses, float min, float max, Image mask) - * JN: long imaqHistogram(long image, int numClasses, float min, float max, long mask) - * C: HistogramReport* imaqHistogram(const Image* image, int numClasses, float min, float max, const Image* mask) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqHistogram(JNIEnv* env, jclass , jlong image, jint numClasses, jfloat min, jfloat max, jlong mask) -{ - HistogramReport* rv = imaqHistogram((const Image*)image, (int)numClasses, (float)min, (float)max, (const Image*)mask); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: LinearAverages imaqLinearAverages2(Image image, LinearAveragesMode mode, Rect rect) - * JN: long imaqLinearAverages2(long image, int mode, long rect) - * C: LinearAverages* imaqLinearAverages2(Image* image, LinearAveragesMode mode, Rect rect) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqLinearAverages2(JNIEnv* env, jclass , jlong image, jint mode, jlong rect) -{ - LinearAverages* rv = imaqLinearAverages2((Image*)image, (LinearAveragesMode)mode, *((Rect*)rect)); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: LineProfile imaqLineProfile(Image image, Point start, Point end) - * JN: long imaqLineProfile(long image, long start, long end) - * C: LineProfile* imaqLineProfile(const Image* image, Point start, Point end) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqLineProfile(JNIEnv* env, jclass , jlong image, jlong start, jlong end) -{ - LineProfile* rv = imaqLineProfile((const Image*)image, *((Point*)start), *((Point*)end)); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: QuantifyReport imaqQuantify(Image image, Image mask) - * JN: long imaqQuantify(long image, long mask) - * C: QuantifyReport* imaqQuantify(const Image* image, const Image* mask) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqQuantify(JNIEnv* env, jclass , jlong image, jlong mask) -{ - QuantifyReport* rv = imaqQuantify((const Image*)image, (const Image*)mask); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Threshold functions - */ - -/* J: ThresholdData imaqAutoThreshold2(Image dest, Image source, int numClasses, ThresholdMethod method, Image mask) - * JN: long imaqAutoThreshold2(long dest, long source, int numClasses, int method, long mask) - * C: ThresholdData* imaqAutoThreshold2(Image* dest, const Image* source, int numClasses, ThresholdMethod method, const Image* mask) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqAutoThreshold2(JNIEnv* env, jclass , jlong dest, jlong source, jint numClasses, jint method, jlong mask) -{ - ThresholdData* rv = imaqAutoThreshold2((Image*)dest, (const Image*)source, (int)numClasses, (ThresholdMethod)method, (const Image*)mask); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqLocalThreshold(Image dest, Image source, int windowWidth, int windowHeight, LocalThresholdMethod method, double deviationWeight, ObjectType type, float replaceValue) - * JN: void imaqLocalThreshold(long dest, long source, int windowWidth, int windowHeight, int method, double deviationWeight, int type, float replaceValue) - * C: int imaqLocalThreshold(Image* dest, const Image* source, unsigned int windowWidth, unsigned int windowHeight, LocalThresholdMethod method, double deviationWeight, ObjectType type, float replaceValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLocalThreshold(JNIEnv* env, jclass , jlong dest, jlong source, jint windowWidth, jint windowHeight, jint method, jdouble deviationWeight, jint type, jfloat replaceValue) -{ - int rv = imaqLocalThreshold((Image*)dest, (const Image*)source, (unsigned int)windowWidth, (unsigned int)windowHeight, (LocalThresholdMethod)method, (double)deviationWeight, (ObjectType)type, (float)replaceValue); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMagicWand(Image dest, Image source, Point coord, float tolerance, int connectivity8, float replaceValue) - * JN: void imaqMagicWand(long dest, long source, long coord, float tolerance, int connectivity8, float replaceValue) - * C: int imaqMagicWand(Image* dest, const Image* source, Point coord, float tolerance, int connectivity8, float replaceValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMagicWand(JNIEnv* env, jclass , jlong dest, jlong source, jlong coord, jfloat tolerance, jint connectivity8, jfloat replaceValue) -{ - int rv = imaqMagicWand((Image*)dest, (const Image*)source, *((Point*)coord), (float)tolerance, (int)connectivity8, (float)replaceValue); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMultithreshold(Image dest, Image source, ThresholdData[] ranges) - * JN: void imaqMultithreshold(long dest, long source, long ranges, int numRanges) - * C: int imaqMultithreshold(Image* dest, const Image* source, const ThresholdData* ranges, int numRanges) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMultithreshold(JNIEnv* env, jclass , jlong dest, jlong source, jlong ranges, jint numRanges) -{ - int rv = imaqMultithreshold((Image*)dest, (const Image*)source, (const ThresholdData*)ranges, (int)numRanges); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqThreshold(Image dest, Image source, float rangeMin, float rangeMax, int useNewValue, float newValue) - * JN: void imaqThreshold(long dest, long source, float rangeMin, float rangeMax, int useNewValue, float newValue) - * C: int imaqThreshold(Image* dest, const Image* source, float rangeMin, float rangeMax, int useNewValue, float newValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqThreshold(JNIEnv* env, jclass , jlong dest, jlong source, jfloat rangeMin, jfloat rangeMax, jint useNewValue, jfloat newValue) -{ - int rv = imaqThreshold((Image*)dest, (const Image*)source, (float)rangeMin, (float)rangeMax, (int)useNewValue, (float)newValue); - if (rv == 0) throwJavaException(env); -} - -/* - * Memory Management functions - */ - -/* - * Pattern Matching functions - */ - -/* J: DetectCirclesResult imaqDetectCircles(Image image, CircleDescriptor circleDescriptor, CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, ROI roi) - * JN: long imaqDetectCircles(long image, long circleDescriptor, long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned) - * C: CircleMatch* imaqDetectCircles(const Image* image, const CircleDescriptor* circleDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqDetectCircles(JNIEnv* env, jclass , jlong image, jlong circleDescriptor, jlong curveOptions, jlong shapeDetectionOptions, jlong roi, jlong numMatchesReturned) -{ - CircleMatch* rv = imaqDetectCircles((const Image*)image, (const CircleDescriptor*)circleDescriptor, (const CurveOptions*)curveOptions, (const ShapeDetectionOptions*)shapeDetectionOptions, (const ROI*)roi, (int*)numMatchesReturned); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: DetectEllipsesResult imaqDetectEllipses(Image image, EllipseDescriptor ellipseDescriptor, CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, ROI roi) - * JN: long imaqDetectEllipses(long image, long ellipseDescriptor, long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned) - * C: EllipseMatch* imaqDetectEllipses(const Image* image, const EllipseDescriptor* ellipseDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqDetectEllipses(JNIEnv* env, jclass , jlong image, jlong ellipseDescriptor, jlong curveOptions, jlong shapeDetectionOptions, jlong roi, jlong numMatchesReturned) -{ - EllipseMatch* rv = imaqDetectEllipses((const Image*)image, (const EllipseDescriptor*)ellipseDescriptor, (const CurveOptions*)curveOptions, (const ShapeDetectionOptions*)shapeDetectionOptions, (const ROI*)roi, (int*)numMatchesReturned); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: DetectLinesResult imaqDetectLines(Image image, LineDescriptor lineDescriptor, CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, ROI roi) - * JN: long imaqDetectLines(long image, long lineDescriptor, long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned) - * C: LineMatch* imaqDetectLines(const Image* image, const LineDescriptor* lineDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqDetectLines(JNIEnv* env, jclass , jlong image, jlong lineDescriptor, jlong curveOptions, jlong shapeDetectionOptions, jlong roi, jlong numMatchesReturned) -{ - LineMatch* rv = imaqDetectLines((const Image*)image, (const LineDescriptor*)lineDescriptor, (const CurveOptions*)curveOptions, (const ShapeDetectionOptions*)shapeDetectionOptions, (const ROI*)roi, (int*)numMatchesReturned); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: DetectRectanglesResult imaqDetectRectangles(Image image, RectangleDescriptor rectangleDescriptor, CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, ROI roi) - * JN: long imaqDetectRectangles(long image, long rectangleDescriptor, long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned) - * C: RectangleMatch* imaqDetectRectangles(const Image* image, const RectangleDescriptor* rectangleDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqDetectRectangles(JNIEnv* env, jclass , jlong image, jlong rectangleDescriptor, jlong curveOptions, jlong shapeDetectionOptions, jlong roi, jlong numMatchesReturned) -{ - RectangleMatch* rv = imaqDetectRectangles((const Image*)image, (const RectangleDescriptor*)rectangleDescriptor, (const CurveOptions*)curveOptions, (const ShapeDetectionOptions*)shapeDetectionOptions, (const ROI*)roi, (int*)numMatchesReturned); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: GetGeometricFeaturesFromCurvesResult imaqGetGeometricFeaturesFromCurves(Curve[] curves, FeatureType[] featureTypes) - * JN: long imaqGetGeometricFeaturesFromCurves(long curves, int numCurves, long featureTypes, int numFeatureTypes, long numFeatures) - * C: FeatureData* imaqGetGeometricFeaturesFromCurves(const Curve* curves, unsigned int numCurves, const FeatureType* featureTypes, unsigned int numFeatureTypes, unsigned int* numFeatures) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetGeometricFeaturesFromCurves(JNIEnv* env, jclass , jlong curves, jint numCurves, jlong featureTypes, jint numFeatureTypes, jlong numFeatures) -{ - FeatureData* rv = imaqGetGeometricFeaturesFromCurves((const Curve*)curves, (unsigned int)numCurves, (const FeatureType*)featureTypes, (unsigned int)numFeatureTypes, (unsigned int*)numFeatures); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: GetGeometricTemplateFeatureInfoResult imaqGetGeometricTemplateFeatureInfo(Image pattern) - * JN: long imaqGetGeometricTemplateFeatureInfo(long pattern, long numFeatures) - * C: FeatureData* imaqGetGeometricTemplateFeatureInfo(const Image* pattern, unsigned int* numFeatures) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetGeometricTemplateFeatureInfo(JNIEnv* env, jclass , jlong pattern, jlong numFeatures) -{ - FeatureData* rv = imaqGetGeometricTemplateFeatureInfo((const Image*)pattern, (unsigned int*)numFeatures); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqLearnColorPattern(Image image, LearnColorPatternOptions options) - * JN: void imaqLearnColorPattern(long image, long options) - * C: int imaqLearnColorPattern(Image* image, const LearnColorPatternOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnColorPattern(JNIEnv* env, jclass , jlong image, jlong options) -{ - int rv = imaqLearnColorPattern((Image*)image, (const LearnColorPatternOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLearnGeometricPattern(Image image, PointFloat originOffset, CurveOptions curveOptions, LearnGeometricPatternAdvancedOptions advancedLearnOptions, Image mask) - * JN: void imaqLearnGeometricPattern(long image, long originOffset, long curveOptions, long advancedLearnOptions, long mask) - * C: int imaqLearnGeometricPattern(Image* image, PointFloat originOffset, const CurveOptions* curveOptions, const LearnGeometricPatternAdvancedOptions* advancedLearnOptions, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnGeometricPattern(JNIEnv* env, jclass , jlong image, jlong originOffset, jlong curveOptions, jlong advancedLearnOptions, jlong mask) -{ - int rv = imaqLearnGeometricPattern((Image*)image, *((PointFloat*)originOffset), (const CurveOptions*)curveOptions, (const LearnGeometricPatternAdvancedOptions*)advancedLearnOptions, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLearnPattern3(Image image, LearningMode learningMode, Image mask) - * JN: void imaqLearnPattern3(long image, int learningMode, long advancedOptions, long mask) - * C: int imaqLearnPattern3(Image* image, LearningMode learningMode, LearnPatternAdvancedOptions* advancedOptions, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnPattern3(JNIEnv* env, jclass , jlong image, jint learningMode, jlong advancedOptions, jlong mask) -{ - int rv = imaqLearnPattern3((Image*)image, (LearningMode)learningMode, (LearnPatternAdvancedOptions*)advancedOptions, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: MatchColorPatternResult imaqMatchColorPattern(Image image, Image pattern, MatchColorPatternOptions options, Rect searchRect) - * JN: long imaqMatchColorPattern(long image, long pattern, long options, long searchRect, long numMatches) - * C: PatternMatch* imaqMatchColorPattern(const Image* image, Image* pattern, const MatchColorPatternOptions* options, Rect searchRect, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchColorPattern(JNIEnv* env, jclass , jlong image, jlong pattern, jlong options, jlong searchRect, jlong numMatches) -{ - PatternMatch* rv = imaqMatchColorPattern((const Image*)image, (Image*)pattern, (const MatchColorPatternOptions*)options, *((Rect*)searchRect), (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: MatchGeometricPattern2Result imaqMatchGeometricPattern2(Image image, Image pattern, CurveOptions curveOptions, MatchGeometricPatternOptions matchOptions, MatchGeometricPatternAdvancedOptions2 advancedMatchOptions, ROI roi) - * JN: long imaqMatchGeometricPattern2(long image, long pattern, long curveOptions, long matchOptions, long advancedMatchOptions, long roi, long numMatches) - * C: GeometricPatternMatch2* imaqMatchGeometricPattern2(const Image* image, const Image* pattern, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions, const ROI* roi, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchGeometricPattern2(JNIEnv* env, jclass , jlong image, jlong pattern, jlong curveOptions, jlong matchOptions, jlong advancedMatchOptions, jlong roi, jlong numMatches) -{ - GeometricPatternMatch2* rv = imaqMatchGeometricPattern2((const Image*)image, (const Image*)pattern, (const CurveOptions*)curveOptions, (const MatchGeometricPatternOptions*)matchOptions, (const MatchGeometricPatternAdvancedOptions2*)advancedMatchOptions, (const ROI*)roi, (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: MatchMultipleGeometricPatternsResult imaqMatchMultipleGeometricPatterns(Image image, MultipleGeometricPattern multiplePattern, ROI roi) - * JN: long imaqMatchMultipleGeometricPatterns(long image, long multiplePattern, long roi, long numMatches) - * C: GeometricPatternMatch2* imaqMatchMultipleGeometricPatterns(const Image* image, const MultipleGeometricPattern* multiplePattern, const ROI* roi, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchMultipleGeometricPatterns(JNIEnv* env, jclass , jlong image, jlong multiplePattern, jlong roi, jlong numMatches) -{ - GeometricPatternMatch2* rv = imaqMatchMultipleGeometricPatterns((const Image*)image, (const MultipleGeometricPattern*)multiplePattern, (const ROI*)roi, (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: MultipleGeometricPattern imaqReadMultipleGeometricPatternFile(String fileName, String description) - * JN: long imaqReadMultipleGeometricPatternFile(long fileName, long description) - * C: MultipleGeometricPattern* imaqReadMultipleGeometricPatternFile(const char* fileName, String255 description) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadMultipleGeometricPatternFile(JNIEnv* env, jclass , jlong fileName, jlong description) -{ - MultipleGeometricPattern* rv = imaqReadMultipleGeometricPatternFile((const char*)fileName, (char *)description); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: RefineMatchesResult imaqRefineMatches(Image image, Image pattern, PatternMatch[] candidatesIn) - * JN: long imaqRefineMatches(long image, long pattern, long candidatesIn, int numCandidatesIn, long options, long advancedOptions, long numCandidatesOut) - * C: PatternMatch* imaqRefineMatches(const Image* image, const Image* pattern, const PatternMatch* candidatesIn, int numCandidatesIn, MatchPatternOptions* options, MatchPatternAdvancedOptions* advancedOptions, int* numCandidatesOut) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqRefineMatches(JNIEnv* env, jclass , jlong image, jlong pattern, jlong candidatesIn, jint numCandidatesIn, jlong options, jlong advancedOptions, jlong numCandidatesOut) -{ - PatternMatch* rv = imaqRefineMatches((const Image*)image, (const Image*)pattern, (const PatternMatch*)candidatesIn, (int)numCandidatesIn, (MatchPatternOptions*)options, (MatchPatternAdvancedOptions*)advancedOptions, (int*)numCandidatesOut); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqSetMultipleGeometricPatternsOptions(MultipleGeometricPattern multiplePattern, String label, CurveOptions curveOptions, MatchGeometricPatternOptions matchOptions, MatchGeometricPatternAdvancedOptions2 advancedMatchOptions) - * JN: void imaqSetMultipleGeometricPatternsOptions(long multiplePattern, long label, long curveOptions, long matchOptions, long advancedMatchOptions) - * C: int imaqSetMultipleGeometricPatternsOptions(MultipleGeometricPattern* multiplePattern, const char* label, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions2* advancedMatchOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetMultipleGeometricPatternsOptions(JNIEnv* env, jclass , jlong multiplePattern, jlong label, jlong curveOptions, jlong matchOptions, jlong advancedMatchOptions) -{ - int rv = imaqSetMultipleGeometricPatternsOptions((MultipleGeometricPattern*)multiplePattern, (const char*)label, (const CurveOptions*)curveOptions, (const MatchGeometricPatternOptions*)matchOptions, (const MatchGeometricPatternAdvancedOptions2*)advancedMatchOptions); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqWriteMultipleGeometricPatternFile(MultipleGeometricPattern multiplePattern, String fileName, String description) - * JN: void imaqWriteMultipleGeometricPatternFile(long multiplePattern, long fileName, long description) - * C: int imaqWriteMultipleGeometricPatternFile(const MultipleGeometricPattern* multiplePattern, const char* fileName, const char* description) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteMultipleGeometricPatternFile(JNIEnv* env, jclass , jlong multiplePattern, jlong fileName, jlong description) -{ - int rv = imaqWriteMultipleGeometricPatternFile((const MultipleGeometricPattern*)multiplePattern, (const char*)fileName, (const char*)description); - if (rv == 0) throwJavaException(env); -} - -/* J: MatchGeometricPattern3Result imaqMatchGeometricPattern3(Image image, Image pattern, CurveOptions curveOptions, MatchGeometricPatternOptions matchOptions, MatchGeometricPatternAdvancedOptions3 advancedMatchOptions, ROI roi) - * JN: long imaqMatchGeometricPattern3(long image, long pattern, long curveOptions, long matchOptions, long advancedMatchOptions, long roi, long numMatches) - * C: GeometricPatternMatch3* imaqMatchGeometricPattern3(const Image* image, const Image* pattern, const CurveOptions* curveOptions, const MatchGeometricPatternOptions* matchOptions, const MatchGeometricPatternAdvancedOptions3* advancedMatchOptions, const ROI* roi, size_t* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchGeometricPattern3(JNIEnv* env, jclass , jlong image, jlong pattern, jlong curveOptions, jlong matchOptions, jlong advancedMatchOptions, jlong roi, jlong numMatches) -{ - GeometricPatternMatch3* rv = imaqMatchGeometricPattern3((const Image*)image, (const Image*)pattern, (const CurveOptions*)curveOptions, (const MatchGeometricPatternOptions*)matchOptions, (const MatchGeometricPatternAdvancedOptions3*)advancedMatchOptions, (const ROI*)roi, (size_t*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqLearnGeometricPattern2(Image image, PointFloat originOffset, double angleOffset, CurveOptions curveOptions, LearnGeometricPatternAdvancedOptions2 advancedLearnOptions, Image mask) - * JN: void imaqLearnGeometricPattern2(long image, long originOffset, double angleOffset, long curveOptions, long advancedLearnOptions, long mask) - * C: int imaqLearnGeometricPattern2(Image* image, PointFloat originOffset, double angleOffset, const CurveOptions* curveOptions, const LearnGeometricPatternAdvancedOptions2* advancedLearnOptions, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnGeometricPattern2(JNIEnv* env, jclass , jlong image, jlong originOffset, jdouble angleOffset, jlong curveOptions, jlong advancedLearnOptions, jlong mask) -{ - int rv = imaqLearnGeometricPattern2((Image*)image, *((PointFloat*)originOffset), (double)angleOffset, (const CurveOptions*)curveOptions, (const LearnGeometricPatternAdvancedOptions2*)advancedLearnOptions, (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* J: MatchPattern3Result imaqMatchPattern3(Image image, Image pattern, MatchPatternOptions options, MatchPatternAdvancedOptions advancedOptions, ROI roi) - * JN: long imaqMatchPattern3(long image, long pattern, long options, long advancedOptions, long roi, long numMatches) - * C: PatternMatch* imaqMatchPattern3(const Image* image, const Image* pattern, const MatchPatternOptions* options, const MatchPatternAdvancedOptions* advancedOptions, const ROI* roi, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchPattern3(JNIEnv* env, jclass , jlong image, jlong pattern, jlong options, jlong advancedOptions, jlong roi, jlong numMatches) -{ - PatternMatch* rv = imaqMatchPattern3((const Image*)image, (const Image*)pattern, (const MatchPatternOptions*)options, (const MatchPatternAdvancedOptions*)advancedOptions, (const ROI*)roi, (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Overlay functions - */ - -/* J: void imaqClearOverlay(Image image, String group) - * JN: void imaqClearOverlay(long image, long group) - * C: int imaqClearOverlay(Image* image, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqClearOverlay(JNIEnv* env, jclass , jlong image, jlong group) -{ - int rv = imaqClearOverlay((Image*)image, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqCopyOverlay(Image dest, Image source, String group) - * JN: void imaqCopyOverlay(long dest, long source, long group) - * C: int imaqCopyOverlay(Image* dest, const Image* source, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCopyOverlay(JNIEnv* env, jclass , jlong dest, jlong source, jlong group) -{ - int rv = imaqCopyOverlay((Image*)dest, (const Image*)source, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetOverlayProperties(Image image, String group) - * JN: void imaqGetOverlayProperties(long image, long group, long transformBehaviors) - * C: int imaqGetOverlayProperties(const Image* image, const char* group, TransformBehaviors* transformBehaviors) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetOverlayProperties(JNIEnv* env, jclass , jlong image, jlong group, jlong transformBehaviors) -{ - int rv = imaqGetOverlayProperties((const Image*)image, (const char*)group, (TransformBehaviors*)transformBehaviors); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMergeOverlay(Image dest, Image source, RGBValue[] palette, String group) - * JN: void imaqMergeOverlay(long dest, long source, long palette, int numColors, long group) - * C: int imaqMergeOverlay(Image* dest, const Image* source, const RGBValue* palette, unsigned int numColors, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMergeOverlay(JNIEnv* env, jclass , jlong dest, jlong source, jlong palette, jint numColors, jlong group) -{ - int rv = imaqMergeOverlay((Image*)dest, (const Image*)source, (const RGBValue*)palette, (unsigned int)numColors, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayArc(Image image, ArcInfo arc, RGBValue color, DrawMode drawMode, String group) - * JN: void imaqOverlayArc(long image, long arc, long color, int drawMode, long group) - * C: int imaqOverlayArc(Image* image, const ArcInfo* arc, const RGBValue* color, DrawMode drawMode, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayArc(JNIEnv* env, jclass , jlong image, jlong arc, jlong color, jint drawMode, jlong group) -{ - int rv = imaqOverlayArc((Image*)image, (const ArcInfo*)arc, (const RGBValue*)color, (DrawMode)drawMode, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayBitmap(Image image, Point destLoc, RGBValue bitmap, int numCols, int numRows, String group) - * JN: void imaqOverlayBitmap(long image, long destLoc, long bitmap, int numCols, int numRows, long group) - * C: int imaqOverlayBitmap(Image* image, Point destLoc, const RGBValue* bitmap, unsigned int numCols, unsigned int numRows, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayBitmap(JNIEnv* env, jclass , jlong image, jlong destLoc, jlong bitmap, jint numCols, jint numRows, jlong group) -{ - int rv = imaqOverlayBitmap((Image*)image, *((Point*)destLoc), (const RGBValue*)bitmap, (unsigned int)numCols, (unsigned int)numRows, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayClosedContour(Image image, Point[] points, RGBValue color, DrawMode drawMode, String group) - * JN: void imaqOverlayClosedContour(long image, long points, int numPoints, long color, int drawMode, long group) - * C: int imaqOverlayClosedContour(Image* image, const Point* points, int numPoints, const RGBValue* color, DrawMode drawMode, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayClosedContour(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jlong color, jint drawMode, jlong group) -{ - int rv = imaqOverlayClosedContour((Image*)image, (const Point*)points, (int)numPoints, (const RGBValue*)color, (DrawMode)drawMode, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayLine(Image image, Point start, Point end, RGBValue color, String group) - * JN: void imaqOverlayLine(long image, long start, long end, long color, long group) - * C: int imaqOverlayLine(Image* image, Point start, Point end, const RGBValue* color, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayLine(JNIEnv* env, jclass , jlong image, jlong start, jlong end, jlong color, jlong group) -{ - int rv = imaqOverlayLine((Image*)image, *((Point*)start), *((Point*)end), (const RGBValue*)color, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayOpenContour(Image image, Point[] points, RGBValue color, String group) - * JN: void imaqOverlayOpenContour(long image, long points, int numPoints, long color, long group) - * C: int imaqOverlayOpenContour(Image* image, const Point* points, int numPoints, const RGBValue* color, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayOpenContour(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jlong color, jlong group) -{ - int rv = imaqOverlayOpenContour((Image*)image, (const Point*)points, (int)numPoints, (const RGBValue*)color, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayOval(Image image, Rect boundingBox, RGBValue color, DrawMode drawMode) - * JN: void imaqOverlayOval(long image, long boundingBox, long color, int drawMode, long group) - * C: int imaqOverlayOval(Image* image, Rect boundingBox, const RGBValue* color, DrawMode drawMode, char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayOval(JNIEnv* env, jclass , jlong image, jlong boundingBox, jlong color, jint drawMode, jlong group) -{ - int rv = imaqOverlayOval((Image*)image, *((Rect*)boundingBox), (const RGBValue*)color, (DrawMode)drawMode, (char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayPoints(Image image, Point[] points, RGBValue[] colors, PointSymbol symbol, UserPointSymbol userSymbol, String group) - * JN: void imaqOverlayPoints(long image, long points, int numPoints, long colors, int numColors, int symbol, long userSymbol, long group) - * C: int imaqOverlayPoints(Image* image, const Point* points, int numPoints, const RGBValue* colors, int numColors, PointSymbol symbol, const UserPointSymbol* userSymbol, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayPoints(JNIEnv* env, jclass , jlong image, jlong points, jint numPoints, jlong colors, jint numColors, jint symbol, jlong userSymbol, jlong group) -{ - int rv = imaqOverlayPoints((Image*)image, (const Point*)points, (int)numPoints, (const RGBValue*)colors, (int)numColors, (PointSymbol)symbol, (const UserPointSymbol*)userSymbol, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayRect(Image image, Rect rect, RGBValue color, DrawMode drawMode, String group) - * JN: void imaqOverlayRect(long image, long rect, long color, int drawMode, long group) - * C: int imaqOverlayRect(Image* image, Rect rect, const RGBValue* color, DrawMode drawMode, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayRect(JNIEnv* env, jclass , jlong image, jlong rect, jlong color, jint drawMode, jlong group) -{ - int rv = imaqOverlayRect((Image*)image, *((Rect*)rect), (const RGBValue*)color, (DrawMode)drawMode, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayROI(Image image, ROI roi, PointSymbol symbol, UserPointSymbol userSymbol, String group) - * JN: void imaqOverlayROI(long image, long roi, int symbol, long userSymbol, long group) - * C: int imaqOverlayROI(Image* image, const ROI* roi, PointSymbol symbol, const UserPointSymbol* userSymbol, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayROI(JNIEnv* env, jclass , jlong image, jlong roi, jint symbol, jlong userSymbol, jlong group) -{ - int rv = imaqOverlayROI((Image*)image, (const ROI*)roi, (PointSymbol)symbol, (const UserPointSymbol*)userSymbol, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqOverlayText(Image image, Point origin, String text, RGBValue color, OverlayTextOptions options, String group) - * JN: void imaqOverlayText(long image, long origin, long text, long color, long options, long group) - * C: int imaqOverlayText(Image* image, Point origin, const char* text, const RGBValue* color, const OverlayTextOptions* options, const char* group) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqOverlayText(JNIEnv* env, jclass , jlong image, jlong origin, jlong text, jlong color, jlong options, jlong group) -{ - int rv = imaqOverlayText((Image*)image, *((Point*)origin), (const char*)text, (const RGBValue*)color, (const OverlayTextOptions*)options, (const char*)group); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetOverlayProperties(Image image, String group) - * JN: void imaqSetOverlayProperties(long image, long group, long transformBehaviors) - * C: int imaqSetOverlayProperties(Image* image, const char* group, TransformBehaviors* transformBehaviors) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetOverlayProperties(JNIEnv* env, jclass , jlong image, jlong group, jlong transformBehaviors) -{ - int rv = imaqSetOverlayProperties((Image*)image, (const char*)group, (TransformBehaviors*)transformBehaviors); - if (rv == 0) throwJavaException(env); -} - -/* - * OCR functions - */ - -/* J: CharSet imaqCreateCharSet() - * JN: long imaqCreateCharSet() - * C: CharSet* imaqCreateCharSet( void) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCreateCharSet(JNIEnv* env, jclass ) -{ - CharSet* rv = imaqCreateCharSet(); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqDeleteChar(CharSet set, int index) - * JN: void imaqDeleteChar(long set, int index) - * C: int imaqDeleteChar(CharSet* set, int index) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDeleteChar(JNIEnv* env, jclass , jlong set, jint index) -{ - int rv = imaqDeleteChar((CharSet*)set, (int)index); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetCharCount(CharSet set) - * JN: void imaqGetCharCount(long set) - * C: int imaqGetCharCount(const CharSet* set) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetCharCount(JNIEnv* env, jclass , jlong set) -{ - int rv = imaqGetCharCount((const CharSet*)set); - if (rv == 0) throwJavaException(env); -} - -/* J: CharInfo2 imaqGetCharInfo2(CharSet set, int index) - * JN: long imaqGetCharInfo2(long set, int index) - * C: CharInfo2* imaqGetCharInfo2(const CharSet* set, int index) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetCharInfo2(JNIEnv* env, jclass , jlong set, jint index) -{ - CharInfo2* rv = imaqGetCharInfo2((const CharSet*)set, (int)index); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqReadOCRFile(String fileName, CharSet set, String setDescription) - * JN: void imaqReadOCRFile(long fileName, long set, long setDescription, long readOptions, long processingOptions, long spacingOptions) - * C: int imaqReadOCRFile(const char* fileName, CharSet* set, String255 setDescription, ReadTextOptions* readOptions, OCRProcessingOptions* processingOptions, OCRSpacingOptions* spacingOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqReadOCRFile(JNIEnv* env, jclass , jlong fileName, jlong set, jlong setDescription, jlong readOptions, jlong processingOptions, jlong spacingOptions) -{ - int rv = imaqReadOCRFile((const char*)fileName, (CharSet*)set, (char *)setDescription, (ReadTextOptions*)readOptions, (OCRProcessingOptions*)processingOptions, (OCRSpacingOptions*)spacingOptions); - if (rv == 0) throwJavaException(env); -} - -/* J: ReadTextReport3 imaqReadText3(Image image, CharSet set, ROI roi, ReadTextOptions readOptions, OCRProcessingOptions processingOptions, OCRSpacingOptions spacingOptions) - * JN: long imaqReadText3(long image, long set, long roi, long readOptions, long processingOptions, long spacingOptions) - * C: ReadTextReport3* imaqReadText3(const Image* image, const CharSet* set, const ROI* roi, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadText3(JNIEnv* env, jclass , jlong image, jlong set, jlong roi, jlong readOptions, jlong processingOptions, jlong spacingOptions) -{ - ReadTextReport3* rv = imaqReadText3((const Image*)image, (const CharSet*)set, (const ROI*)roi, (const ReadTextOptions*)readOptions, (const OCRProcessingOptions*)processingOptions, (const OCRSpacingOptions*)spacingOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqRenameChar(CharSet set, int index, String newCharValue) - * JN: void imaqRenameChar(long set, int index, long newCharValue) - * C: int imaqRenameChar(CharSet* set, int index, const char* newCharValue) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRenameChar(JNIEnv* env, jclass , jlong set, jint index, jlong newCharValue) -{ - int rv = imaqRenameChar((CharSet*)set, (int)index, (const char*)newCharValue); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetReferenceChar(CharSet set, int index, int isReferenceChar) - * JN: void imaqSetReferenceChar(long set, int index, int isReferenceChar) - * C: int imaqSetReferenceChar(const CharSet* set, int index, int isReferenceChar) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetReferenceChar(JNIEnv* env, jclass , jlong set, jint index, jint isReferenceChar) -{ - int rv = imaqSetReferenceChar((const CharSet*)set, (int)index, (int)isReferenceChar); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqTrainChars(Image image, CharSet set, int index, String charValue, ROI roi, OCRProcessingOptions processingOptions, OCRSpacingOptions spacingOptions) - * JN: void imaqTrainChars(long image, long set, int index, long charValue, long roi, long processingOptions, long spacingOptions) - * C: int imaqTrainChars(const Image* image, CharSet* set, int index, const char* charValue, const ROI* roi, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqTrainChars(JNIEnv* env, jclass , jlong image, jlong set, jint index, jlong charValue, jlong roi, jlong processingOptions, jlong spacingOptions) -{ - int rv = imaqTrainChars((const Image*)image, (CharSet*)set, (int)index, (const char*)charValue, (const ROI*)roi, (const OCRProcessingOptions*)processingOptions, (const OCRSpacingOptions*)spacingOptions); - if (rv == 0) throwJavaException(env); -} - -/* J: VerifyTextResult imaqVerifyText(Image image, CharSet set, String expectedString, ROI roi) - * JN: long imaqVerifyText(long image, long set, long expectedString, long roi, long numScores) - * C: int* imaqVerifyText(const Image* image, const CharSet* set, const char* expectedString, const ROI* roi, int* numScores) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqVerifyText(JNIEnv* env, jclass , jlong image, jlong set, jlong expectedString, jlong roi, jlong numScores) -{ - int* rv = imaqVerifyText((const Image*)image, (const CharSet*)set, (const char*)expectedString, (const ROI*)roi, (int*)numScores); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqWriteOCRFile(String fileName, CharSet set, String setDescription, ReadTextOptions readOptions, OCRProcessingOptions processingOptions, OCRSpacingOptions spacingOptions) - * JN: void imaqWriteOCRFile(long fileName, long set, long setDescription, long readOptions, long processingOptions, long spacingOptions) - * C: int imaqWriteOCRFile(const char* fileName, const CharSet* set, const char* setDescription, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteOCRFile(JNIEnv* env, jclass , jlong fileName, jlong set, jlong setDescription, jlong readOptions, jlong processingOptions, jlong spacingOptions) -{ - int rv = imaqWriteOCRFile((const char*)fileName, (const CharSet*)set, (const char*)setDescription, (const ReadTextOptions*)readOptions, (const OCRProcessingOptions*)processingOptions, (const OCRSpacingOptions*)spacingOptions); - if (rv == 0) throwJavaException(env); -} - -/* - * Geometric Matching functions - */ - -/* J: ExtractContourReport imaqExtractContour(Image image, ROI roi, ExtractContourDirection direction, ConnectionConstraint connectionConstraintParams, int numOfConstraints, ExtractContourSelection selection, Image contourImage) - * JN: long imaqExtractContour(long image, long roi, int direction, long curveParams, long connectionConstraintParams, int numOfConstraints, int selection, long contourImage) - * C: ExtractContourReport* imaqExtractContour(Image* image, const ROI* roi, ExtractContourDirection direction, CurveParameters* curveParams, const ConnectionConstraint* connectionConstraintParams, unsigned int numOfConstraints, ExtractContourSelection selection, Image* contourImage) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqExtractContour(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jlong curveParams, jlong connectionConstraintParams, jint numOfConstraints, jint selection, jlong contourImage) -{ - ExtractContourReport* rv = imaqExtractContour((Image*)image, (const ROI*)roi, (ExtractContourDirection)direction, (CurveParameters*)curveParams, (const ConnectionConstraint*)connectionConstraintParams, (unsigned int)numOfConstraints, (ExtractContourSelection)selection, (Image*)contourImage); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqContourOverlay(Image image, Image contourImage, ContourOverlaySettings pointsSettings, ContourOverlaySettings eqnSettings, String groupName) - * JN: void imaqContourOverlay(long image, long contourImage, long pointsSettings, long eqnSettings, long groupName) - * C: int imaqContourOverlay(Image* image, const Image* contourImage, const ContourOverlaySettings* pointsSettings, const ContourOverlaySettings* eqnSettings, const char* groupName) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqContourOverlay(JNIEnv* env, jclass , jlong image, jlong contourImage, jlong pointsSettings, jlong eqnSettings, jlong groupName) -{ - int rv = imaqContourOverlay((Image*)image, (const Image*)contourImage, (const ContourOverlaySettings*)pointsSettings, (const ContourOverlaySettings*)eqnSettings, (const char*)groupName); - if (rv == 0) throwJavaException(env); -} - -/* J: ContourComputeCurvatureReport imaqContourComputeCurvature(Image contourImage, int kernel) - * JN: long imaqContourComputeCurvature(long contourImage, int kernel) - * C: ContourComputeCurvatureReport* imaqContourComputeCurvature(const Image* contourImage, unsigned int kernel) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourComputeCurvature(JNIEnv* env, jclass , jlong contourImage, jint kernel) -{ - ContourComputeCurvatureReport* rv = imaqContourComputeCurvature((const Image*)contourImage, (unsigned int)kernel); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: CurvatureAnalysisReport imaqContourClassifyCurvature(Image contourImage, int kernel, RangeLabel[] curvatureClasses) - * JN: long imaqContourClassifyCurvature(long contourImage, int kernel, long curvatureClasses, int numCurvatureClasses) - * C: CurvatureAnalysisReport* imaqContourClassifyCurvature(const Image* contourImage, unsigned int kernel, RangeLabel* curvatureClasses, unsigned int numCurvatureClasses) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourClassifyCurvature(JNIEnv* env, jclass , jlong contourImage, jint kernel, jlong curvatureClasses, jint numCurvatureClasses) -{ - CurvatureAnalysisReport* rv = imaqContourClassifyCurvature((const Image*)contourImage, (unsigned int)kernel, (RangeLabel*)curvatureClasses, (unsigned int)numCurvatureClasses); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ComputeDistancesReport imaqContourComputeDistances(Image targetImage, Image templateImage, SetupMatchPatternData matchSetupData, int smoothingKernel) - * JN: long imaqContourComputeDistances(long targetImage, long templateImage, long matchSetupData, int smoothingKernel) - * C: ComputeDistancesReport* imaqContourComputeDistances(const Image* targetImage, const Image* templateImage, const SetupMatchPatternData* matchSetupData, unsigned int smoothingKernel) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourComputeDistances(JNIEnv* env, jclass , jlong targetImage, jlong templateImage, jlong matchSetupData, jint smoothingKernel) -{ - ComputeDistancesReport* rv = imaqContourComputeDistances((const Image*)targetImage, (const Image*)templateImage, (const SetupMatchPatternData*)matchSetupData, (unsigned int)smoothingKernel); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ClassifyDistancesReport imaqContourClassifyDistances(Image targetImage, Image templateImage, SetupMatchPatternData matchSetupData, int smoothingKernel, RangeLabel[] distanceRanges) - * JN: long imaqContourClassifyDistances(long targetImage, long templateImage, long matchSetupData, int smoothingKernel, long distanceRanges, int numDistanceRanges) - * C: ClassifyDistancesReport* imaqContourClassifyDistances(const Image* targetImage, const Image* templateImage, const SetupMatchPatternData* matchSetupData, unsigned int smoothingKernel, const RangeLabel* distanceRanges, unsigned int numDistanceRanges) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourClassifyDistances(JNIEnv* env, jclass , jlong targetImage, jlong templateImage, jlong matchSetupData, jint smoothingKernel, jlong distanceRanges, jint numDistanceRanges) -{ - ClassifyDistancesReport* rv = imaqContourClassifyDistances((const Image*)targetImage, (const Image*)templateImage, (const SetupMatchPatternData*)matchSetupData, (unsigned int)smoothingKernel, (const RangeLabel*)distanceRanges, (unsigned int)numDistanceRanges); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ContourInfoReport imaqContourInfo(Image contourImage) - * JN: long imaqContourInfo(long contourImage) - * C: ContourInfoReport* imaqContourInfo(const Image* contourImage) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourInfo(JNIEnv* env, jclass , jlong contourImage) -{ - ContourInfoReport* rv = imaqContourInfo((const Image*)contourImage); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: SetupMatchPatternData imaqContourSetupMatchPattern(int enableSubPixelAccuracy, int useLearnCurveParameters, RangeSettingDouble[] rangeSettings) - * JN: long imaqContourSetupMatchPattern(long matchMode, int enableSubPixelAccuracy, long curveParams, int useLearnCurveParameters, long rangeSettings, int numRangeSettings) - * C: SetupMatchPatternData* imaqContourSetupMatchPattern(MatchMode* matchMode, unsigned int enableSubPixelAccuracy, CurveParameters* curveParams, unsigned int useLearnCurveParameters, const RangeSettingDouble* rangeSettings, unsigned int numRangeSettings) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourSetupMatchPattern(JNIEnv* env, jclass , jlong matchMode, jint enableSubPixelAccuracy, jlong curveParams, jint useLearnCurveParameters, jlong rangeSettings, jint numRangeSettings) -{ - SetupMatchPatternData* rv = imaqContourSetupMatchPattern((MatchMode*)matchMode, (unsigned int)enableSubPixelAccuracy, (CurveParameters*)curveParams, (unsigned int)useLearnCurveParameters, (const RangeSettingDouble*)rangeSettings, (unsigned int)numRangeSettings); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqContourAdvancedSetupMatchPattern(GeometricAdvancedSetupDataOption[] geometricOptions) - * JN: void imaqContourAdvancedSetupMatchPattern(long matchSetupData, long geometricOptions, int numGeometricOptions) - * C: int imaqContourAdvancedSetupMatchPattern(SetupMatchPatternData* matchSetupData, GeometricAdvancedSetupDataOption* geometricOptions, unsigned int numGeometricOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqContourAdvancedSetupMatchPattern(JNIEnv* env, jclass , jlong matchSetupData, jlong geometricOptions, jint numGeometricOptions) -{ - int rv = imaqContourAdvancedSetupMatchPattern((SetupMatchPatternData*)matchSetupData, (GeometricAdvancedSetupDataOption*)geometricOptions, (unsigned int)numGeometricOptions); - if (rv == 0) throwJavaException(env); -} - -/* J: ContourFitLineReport imaqContourFitLine(Image image, double pixelRadius) - * JN: long imaqContourFitLine(long image, double pixelRadius) - * C: ContourFitLineReport* imaqContourFitLine(Image* image, double pixelRadius) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourFitLine(JNIEnv* env, jclass , jlong image, jdouble pixelRadius) -{ - ContourFitLineReport* rv = imaqContourFitLine((Image*)image, (double)pixelRadius); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: PartialCircle imaqContourFitCircle(Image image, double pixelRadius, int rejectOutliers) - * JN: long imaqContourFitCircle(long image, double pixelRadius, int rejectOutliers) - * C: PartialCircle* imaqContourFitCircle(Image* image, double pixelRadius, int rejectOutliers) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourFitCircle(JNIEnv* env, jclass , jlong image, jdouble pixelRadius, jint rejectOutliers) -{ - PartialCircle* rv = imaqContourFitCircle((Image*)image, (double)pixelRadius, (int)rejectOutliers); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: PartialEllipse imaqContourFitEllipse(Image image, double pixelRadius, int rejectOutliers) - * JN: long imaqContourFitEllipse(long image, double pixelRadius, int rejectOutliers) - * C: PartialEllipse* imaqContourFitEllipse(Image* image, double pixelRadius, int rejectOutliers) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourFitEllipse(JNIEnv* env, jclass , jlong image, jdouble pixelRadius, jint rejectOutliers) -{ - PartialEllipse* rv = imaqContourFitEllipse((Image*)image, (double)pixelRadius, (int)rejectOutliers); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ContourFitSplineReport imaqContourFitSpline(Image image, int degree, int numberOfControlPoints) - * JN: long imaqContourFitSpline(long image, int degree, int numberOfControlPoints) - * C: ContourFitSplineReport* imaqContourFitSpline(Image* image, int degree, int numberOfControlPoints) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourFitSpline(JNIEnv* env, jclass , jlong image, jint degree, jint numberOfControlPoints) -{ - ContourFitSplineReport* rv = imaqContourFitSpline((Image*)image, (int)degree, (int)numberOfControlPoints); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ContourFitPolynomialReport imaqContourFitPolynomial(Image image, int order) - * JN: long imaqContourFitPolynomial(long image, int order) - * C: ContourFitPolynomialReport* imaqContourFitPolynomial(Image* image, int order) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqContourFitPolynomial(JNIEnv* env, jclass , jlong image, jint order) -{ - ContourFitPolynomialReport* rv = imaqContourFitPolynomial((Image*)image, (int)order); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Edge Detection functions - */ - -/* J: FindCircularEdgeReport imaqFindCircularEdge2(Image image, ROI roi, CoordinateSystem baseSystem, CoordinateSystem newSystem, FindCircularEdgeOptions edgeOptions, CircleFitOptions circleFitOptions) - * JN: long imaqFindCircularEdge2(long image, long roi, long baseSystem, long newSystem, long edgeOptions, long circleFitOptions) - * C: FindCircularEdgeReport* imaqFindCircularEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindCircularEdgeOptions* edgeOptions, const CircleFitOptions* circleFitOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFindCircularEdge2(JNIEnv* env, jclass , jlong image, jlong roi, jlong baseSystem, jlong newSystem, jlong edgeOptions, jlong circleFitOptions) -{ - FindCircularEdgeReport* rv = imaqFindCircularEdge2((Image*)image, (const ROI*)roi, (const CoordinateSystem*)baseSystem, (const CoordinateSystem*)newSystem, (const FindCircularEdgeOptions*)edgeOptions, (const CircleFitOptions*)circleFitOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: FindConcentricEdgeReport imaqFindConcentricEdge2(Image image, ROI roi, CoordinateSystem baseSystem, CoordinateSystem newSystem, FindConcentricEdgeOptions edgeOptions, ConcentricEdgeFitOptions concentricEdgeFitOptions) - * JN: long imaqFindConcentricEdge2(long image, long roi, long baseSystem, long newSystem, long edgeOptions, long concentricEdgeFitOptions) - * C: FindConcentricEdgeReport* imaqFindConcentricEdge2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const FindConcentricEdgeOptions* edgeOptions, const ConcentricEdgeFitOptions* concentricEdgeFitOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqFindConcentricEdge2(JNIEnv* env, jclass , jlong image, jlong roi, jlong baseSystem, jlong newSystem, jlong edgeOptions, jlong concentricEdgeFitOptions) -{ - FindConcentricEdgeReport* rv = imaqFindConcentricEdge2((Image*)image, (const ROI*)roi, (const CoordinateSystem*)baseSystem, (const CoordinateSystem*)newSystem, (const FindConcentricEdgeOptions*)edgeOptions, (const ConcentricEdgeFitOptions*)concentricEdgeFitOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Morphology Reconstruction functions - */ - -/* J: void imaqGrayMorphologyReconstruct(Image dstImage, Image srcImage, Image markerImage, PointFloat[] points, MorphologyReconstructOperation operation, StructuringElement structuringElement, ROI roi) - * JN: void imaqGrayMorphologyReconstruct(long dstImage, long srcImage, long markerImage, long points, int numOfPoints, int operation, long structuringElement, long roi) - * C: int imaqGrayMorphologyReconstruct(Image* dstImage, Image* srcImage, const Image* markerImage, PointFloat* points, int numOfPoints, MorphologyReconstructOperation operation, const StructuringElement* structuringElement, const ROI* roi) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGrayMorphologyReconstruct(JNIEnv* env, jclass , jlong dstImage, jlong srcImage, jlong markerImage, jlong points, jint numOfPoints, jint operation, jlong structuringElement, jlong roi) -{ - int rv = imaqGrayMorphologyReconstruct((Image*)dstImage, (Image*)srcImage, (const Image*)markerImage, (PointFloat*)points, (int)numOfPoints, (MorphologyReconstructOperation)operation, (const StructuringElement*)structuringElement, (const ROI*)roi); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqMorphologyReconstruct(Image dstImage, Image srcImage, Image markerImage, PointFloat[] points, MorphologyReconstructOperation operation, Connectivity connectivity, ROI roi) - * JN: void imaqMorphologyReconstruct(long dstImage, long srcImage, long markerImage, long points, int numOfPoints, int operation, int connectivity, long roi) - * C: int imaqMorphologyReconstruct(Image* dstImage, Image* srcImage, const Image* markerImage, PointFloat* points, int numOfPoints, MorphologyReconstructOperation operation, Connectivity connectivity, const ROI* roi) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqMorphologyReconstruct(JNIEnv* env, jclass , jlong dstImage, jlong srcImage, jlong markerImage, jlong points, jint numOfPoints, jint operation, jint connectivity, jlong roi) -{ - int rv = imaqMorphologyReconstruct((Image*)dstImage, (Image*)srcImage, (const Image*)markerImage, (PointFloat*)points, (int)numOfPoints, (MorphologyReconstructOperation)operation, (Connectivity)connectivity, (const ROI*)roi); - if (rv == 0) throwJavaException(env); -} - -/* - * Texture functions - */ - -/* J: void imaqDetectTextureDefect(ClassifierSession session, Image destImage, Image srcImage, ROI roi, int initialStepSize, int finalStepSize, short defectPixelValue, double minClassificationScore) - * JN: void imaqDetectTextureDefect(long session, long destImage, long srcImage, long roi, int initialStepSize, int finalStepSize, short defectPixelValue, double minClassificationScore) - * C: int imaqDetectTextureDefect(ClassifierSession* session, Image* destImage, const Image* srcImage, const ROI* roi, int initialStepSize, int finalStepSize, unsigned char defectPixelValue, double minClassificationScore) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDetectTextureDefect(JNIEnv* env, jclass , jlong session, jlong destImage, jlong srcImage, jlong roi, jint initialStepSize, jint finalStepSize, jshort defectPixelValue, jdouble minClassificationScore) -{ - int rv = imaqDetectTextureDefect((ClassifierSession*)session, (Image*)destImage, (const Image*)srcImage, (const ROI*)roi, (int)initialStepSize, (int)finalStepSize, (unsigned char)defectPixelValue, (double)minClassificationScore); - if (rv == 0) throwJavaException(env); -} - -/* - * Regions of Interest Manipulation functions - */ - -/* J: ROI imaqMaskToROI(Image mask) - * JN: long imaqMaskToROI(long mask, long withinLimit) - * C: ROI* imaqMaskToROI(const Image* mask, int* withinLimit) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMaskToROI(JNIEnv* env, jclass , jlong mask, jlong withinLimit) -{ - ROI* rv = imaqMaskToROI((const Image*)mask, (int*)withinLimit); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ROIProfile imaqROIProfile(Image image, ROI roi) - * JN: long imaqROIProfile(long image, long roi) - * C: ROIProfile* imaqROIProfile(const Image* image, const ROI* roi) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqROIProfile(JNIEnv* env, jclass , jlong image, jlong roi) -{ - ROIProfile* rv = imaqROIProfile((const Image*)image, (const ROI*)roi); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqROIToMask(Image mask, ROI roi, int fillValue, Image imageModel) - * JN: void imaqROIToMask(long mask, long roi, int fillValue, long imageModel, long inSpace) - * C: int imaqROIToMask(Image* mask, const ROI* roi, int fillValue, const Image* imageModel, int* inSpace) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqROIToMask(JNIEnv* env, jclass , jlong mask, jlong roi, jint fillValue, jlong imageModel, jlong inSpace) -{ - int rv = imaqROIToMask((Image*)mask, (const ROI*)roi, (int)fillValue, (const Image*)imageModel, (int*)inSpace); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqTransformROI2(ROI roi, CoordinateSystem baseSystem, CoordinateSystem newSystem) - * JN: void imaqTransformROI2(long roi, long baseSystem, long newSystem) - * C: int imaqTransformROI2(ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqTransformROI2(JNIEnv* env, jclass , jlong roi, jlong baseSystem, jlong newSystem) -{ - int rv = imaqTransformROI2((ROI*)roi, (const CoordinateSystem*)baseSystem, (const CoordinateSystem*)newSystem); - if (rv == 0) throwJavaException(env); -} - -/* J: LabelToROIReport imaqLabelToROI(Image image, int[] labelsIn, int maxNumVectors, int isExternelEdges) - * JN: long imaqLabelToROI(long image, long labelsIn, int numLabelsIn, int maxNumVectors, int isExternelEdges) - * C: LabelToROIReport* imaqLabelToROI(const Image* image, const unsigned int* labelsIn, unsigned int numLabelsIn, int maxNumVectors, int isExternelEdges) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqLabelToROI(JNIEnv* env, jclass , jlong image, jlong labelsIn, jint numLabelsIn, jint maxNumVectors, jint isExternelEdges) -{ - LabelToROIReport* rv = imaqLabelToROI((const Image*)image, (const unsigned int*)labelsIn, (unsigned int)numLabelsIn, (int)maxNumVectors, (int)isExternelEdges); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Morphology functions - */ - -/* J: void imaqGrayMorphology(Image dest, Image source, MorphologyMethod method, StructuringElement structuringElement) - * JN: void imaqGrayMorphology(long dest, long source, int method, long structuringElement) - * C: int imaqGrayMorphology(Image* dest, Image* source, MorphologyMethod method, const StructuringElement* structuringElement) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGrayMorphology(JNIEnv* env, jclass , jlong dest, jlong source, jint method, jlong structuringElement) -{ - int rv = imaqGrayMorphology((Image*)dest, (Image*)source, (MorphologyMethod)method, (const StructuringElement*)structuringElement); - if (rv == 0) throwJavaException(env); -} - -/* - * Classification functions - */ - -/* J: void imaqAddClassifierSample(Image image, ClassifierSession session, ROI roi, String sampleClass, double[] featureVector) - * JN: void imaqAddClassifierSample(long image, long session, long roi, long sampleClass, long featureVector, int vectorSize) - * C: int imaqAddClassifierSample(Image* image, ClassifierSession* session, const ROI* roi, const char* sampleClass, double* featureVector, unsigned int vectorSize) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqAddClassifierSample(JNIEnv* env, jclass , jlong image, jlong session, jlong roi, jlong sampleClass, jlong featureVector, jint vectorSize) -{ - int rv = imaqAddClassifierSample((Image*)image, (ClassifierSession*)session, (const ROI*)roi, (const char*)sampleClass, (double*)featureVector, (unsigned int)vectorSize); - if (rv == 0) throwJavaException(env); -} - -/* J: ClassifierReportAdvanced imaqAdvanceClassify(Image image, ClassifierSession session, ROI roi, double[] featureVector) - * JN: long imaqAdvanceClassify(long image, long session, long roi, long featureVector, int vectorSize) - * C: ClassifierReportAdvanced* imaqAdvanceClassify(Image* image, const ClassifierSession* session, const ROI* roi, double* featureVector, unsigned int vectorSize) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqAdvanceClassify(JNIEnv* env, jclass , jlong image, jlong session, jlong roi, jlong featureVector, jint vectorSize) -{ - ClassifierReportAdvanced* rv = imaqAdvanceClassify((Image*)image, (const ClassifierSession*)session, (const ROI*)roi, (double*)featureVector, (unsigned int)vectorSize); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ClassifierReport imaqClassify(Image image, ClassifierSession session, ROI roi, double[] featureVector) - * JN: long imaqClassify(long image, long session, long roi, long featureVector, int vectorSize) - * C: ClassifierReport* imaqClassify(Image* image, const ClassifierSession* session, const ROI* roi, double* featureVector, unsigned int vectorSize) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqClassify(JNIEnv* env, jclass , jlong image, jlong session, jlong roi, jlong featureVector, jint vectorSize) -{ - ClassifierReport* rv = imaqClassify((Image*)image, (const ClassifierSession*)session, (const ROI*)roi, (double*)featureVector, (unsigned int)vectorSize); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ClassifierSession imaqCreateClassifier(ClassifierType type) - * JN: long imaqCreateClassifier(int type) - * C: ClassifierSession* imaqCreateClassifier(ClassifierType type) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqCreateClassifier(JNIEnv* env, jclass , jint type) -{ - ClassifierSession* rv = imaqCreateClassifier((ClassifierType)type); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqDeleteClassifierSample(ClassifierSession session, int index) - * JN: void imaqDeleteClassifierSample(long session, int index) - * C: int imaqDeleteClassifierSample(ClassifierSession* session, int index) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDeleteClassifierSample(JNIEnv* env, jclass , jlong session, jint index) -{ - int rv = imaqDeleteClassifierSample((ClassifierSession*)session, (int)index); - if (rv == 0) throwJavaException(env); -} - -/* J: ClassifierAccuracyReport imaqGetClassifierAccuracy(ClassifierSession session) - * JN: long imaqGetClassifierAccuracy(long session) - * C: ClassifierAccuracyReport* imaqGetClassifierAccuracy(const ClassifierSession* session) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetClassifierAccuracy(JNIEnv* env, jclass , jlong session) -{ - ClassifierAccuracyReport* rv = imaqGetClassifierAccuracy((const ClassifierSession*)session); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ClassifierSampleInfo imaqGetClassifierSampleInfo(ClassifierSession session, int index) - * JN: long imaqGetClassifierSampleInfo(long session, int index, long numSamples) - * C: ClassifierSampleInfo* imaqGetClassifierSampleInfo(const ClassifierSession* session, int index, int* numSamples) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqGetClassifierSampleInfo(JNIEnv* env, jclass , jlong session, jint index, jlong numSamples) -{ - ClassifierSampleInfo* rv = imaqGetClassifierSampleInfo((const ClassifierSession*)session, (int)index, (int*)numSamples); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqGetColorClassifierOptions(ClassifierSession session) - * JN: void imaqGetColorClassifierOptions(long session, long options) - * C: int imaqGetColorClassifierOptions(const ClassifierSession* session, ColorOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetColorClassifierOptions(JNIEnv* env, jclass , jlong session, jlong options) -{ - int rv = imaqGetColorClassifierOptions((const ClassifierSession*)session, (ColorOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetNearestNeighborOptions(ClassifierSession session) - * JN: void imaqGetNearestNeighborOptions(long session, long options) - * C: int imaqGetNearestNeighborOptions(const ClassifierSession* session, NearestNeighborOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetNearestNeighborOptions(JNIEnv* env, jclass , jlong session, jlong options) -{ - int rv = imaqGetNearestNeighborOptions((const ClassifierSession*)session, (NearestNeighborOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqGetParticleClassifierOptions2(ClassifierSession session) - * JN: void imaqGetParticleClassifierOptions2(long session, long preprocessingOptions, long options) - * C: int imaqGetParticleClassifierOptions2(const ClassifierSession* session, ParticleClassifierPreprocessingOptions2* preprocessingOptions, ParticleClassifierOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetParticleClassifierOptions2(JNIEnv* env, jclass , jlong session, jlong preprocessingOptions, jlong options) -{ - int rv = imaqGetParticleClassifierOptions2((const ClassifierSession*)session, (ParticleClassifierPreprocessingOptions2*)preprocessingOptions, (ParticleClassifierOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: ClassifierSession imaqReadClassifierFile(ClassifierSession session, String fileName, ReadClassifierFileMode mode, String description) - * JN: long imaqReadClassifierFile(long session, long fileName, int mode, long type, long engine, long description) - * C: ClassifierSession* imaqReadClassifierFile(ClassifierSession* session, const char* fileName, ReadClassifierFileMode mode, ClassifierType* type, ClassifierEngineType* engine, String255 description) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqReadClassifierFile(JNIEnv* env, jclass , jlong session, jlong fileName, jint mode, jlong type, jlong engine, jlong description) -{ - ClassifierSession* rv = imaqReadClassifierFile((ClassifierSession*)session, (const char*)fileName, (ReadClassifierFileMode)mode, (ClassifierType*)type, (ClassifierEngineType*)engine, (char *)description); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqRelabelClassifierSample(ClassifierSession session, int index, String newClass) - * JN: void imaqRelabelClassifierSample(long session, int index, long newClass) - * C: int imaqRelabelClassifierSample(ClassifierSession* session, int index, const char* newClass) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqRelabelClassifierSample(JNIEnv* env, jclass , jlong session, jint index, jlong newClass) -{ - int rv = imaqRelabelClassifierSample((ClassifierSession*)session, (int)index, (const char*)newClass); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetParticleClassifierOptions2(ClassifierSession session, ParticleClassifierPreprocessingOptions2 preprocessingOptions, ParticleClassifierOptions options) - * JN: void imaqSetParticleClassifierOptions2(long session, long preprocessingOptions, long options) - * C: int imaqSetParticleClassifierOptions2(ClassifierSession* session, const ParticleClassifierPreprocessingOptions2* preprocessingOptions, const ParticleClassifierOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetParticleClassifierOptions2(JNIEnv* env, jclass , jlong session, jlong preprocessingOptions, jlong options) -{ - int rv = imaqSetParticleClassifierOptions2((ClassifierSession*)session, (const ParticleClassifierPreprocessingOptions2*)preprocessingOptions, (const ParticleClassifierOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqSetColorClassifierOptions(ClassifierSession session, ColorOptions options) - * JN: void imaqSetColorClassifierOptions(long session, long options) - * C: int imaqSetColorClassifierOptions(ClassifierSession* session, const ColorOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetColorClassifierOptions(JNIEnv* env, jclass , jlong session, jlong options) -{ - int rv = imaqSetColorClassifierOptions((ClassifierSession*)session, (const ColorOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: NearestNeighborTrainingReport imaqTrainNearestNeighborClassifier(ClassifierSession session, NearestNeighborOptions options) - * JN: long imaqTrainNearestNeighborClassifier(long session, long options) - * C: NearestNeighborTrainingReport* imaqTrainNearestNeighborClassifier(ClassifierSession* session, const NearestNeighborOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqTrainNearestNeighborClassifier(JNIEnv* env, jclass , jlong session, jlong options) -{ - NearestNeighborTrainingReport* rv = imaqTrainNearestNeighborClassifier((ClassifierSession*)session, (const NearestNeighborOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqWriteClassifierFile(ClassifierSession session, String fileName, WriteClassifierFileMode mode, String description) - * JN: void imaqWriteClassifierFile(long session, long fileName, int mode, long description) - * C: int imaqWriteClassifierFile(const ClassifierSession* session, const char* fileName, WriteClassifierFileMode mode, const String255 description) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqWriteClassifierFile(JNIEnv* env, jclass , jlong session, jlong fileName, jint mode, jlong description) -{ - int rv = imaqWriteClassifierFile((const ClassifierSession*)session, (const char*)fileName, (WriteClassifierFileMode)mode, (char *)description); - if (rv == 0) throwJavaException(env); -} - -/* - * Measure Distances functions - */ - -/* J: ClampMax2Report imaqClampMax2(Image image, ROI roi, CoordinateSystem baseSystem, CoordinateSystem newSystem, CurveOptions curveSettings, ClampSettings clampSettings, ClampOverlaySettings clampOverlaySettings) - * JN: long imaqClampMax2(long image, long roi, long baseSystem, long newSystem, long curveSettings, long clampSettings, long clampOverlaySettings) - * C: ClampMax2Report* imaqClampMax2(Image* image, const ROI* roi, const CoordinateSystem* baseSystem, const CoordinateSystem* newSystem, const CurveOptions* curveSettings, const ClampSettings* clampSettings, const ClampOverlaySettings* clampOverlaySettings) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqClampMax2(JNIEnv* env, jclass , jlong image, jlong roi, jlong baseSystem, jlong newSystem, jlong curveSettings, jlong clampSettings, jlong clampOverlaySettings) -{ - ClampMax2Report* rv = imaqClampMax2((Image*)image, (const ROI*)roi, (const CoordinateSystem*)baseSystem, (const CoordinateSystem*)newSystem, (const CurveOptions*)curveSettings, (const ClampSettings*)clampSettings, (const ClampOverlaySettings*)clampOverlaySettings); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* - * Inspection functions - */ - -/* J: void imaqCompareGoldenTemplate(Image image, Image goldenTemplate, Image brightDefects, Image darkDefects, InspectionAlignment alignment, InspectionOptions options) - * JN: void imaqCompareGoldenTemplate(long image, long goldenTemplate, long brightDefects, long darkDefects, long alignment, long options) - * C: int imaqCompareGoldenTemplate(const Image* image, const Image* goldenTemplate, Image* brightDefects, Image* darkDefects, const InspectionAlignment* alignment, const InspectionOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqCompareGoldenTemplate(JNIEnv* env, jclass , jlong image, jlong goldenTemplate, jlong brightDefects, jlong darkDefects, jlong alignment, jlong options) -{ - int rv = imaqCompareGoldenTemplate((const Image*)image, (const Image*)goldenTemplate, (Image*)brightDefects, (Image*)darkDefects, (const InspectionAlignment*)alignment, (const InspectionOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLearnGoldenTemplate(Image goldenTemplate, PointFloat originOffset, Image mask) - * JN: void imaqLearnGoldenTemplate(long goldenTemplate, long originOffset, long mask) - * C: int imaqLearnGoldenTemplate(Image* goldenTemplate, PointFloat originOffset, const Image* mask) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnGoldenTemplate(JNIEnv* env, jclass , jlong goldenTemplate, jlong originOffset, jlong mask) -{ - int rv = imaqLearnGoldenTemplate((Image*)goldenTemplate, *((PointFloat*)originOffset), (const Image*)mask); - if (rv == 0) throwJavaException(env); -} - -/* - * Obsolete functions - */ - -/* J: void imaqGetParticleClassifierOptions(ClassifierSession session) - * JN: void imaqGetParticleClassifierOptions(long session, long preprocessingOptions, long options) - * C: int imaqGetParticleClassifierOptions(const ClassifierSession* session, ParticleClassifierPreprocessingOptions* preprocessingOptions, ParticleClassifierOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqGetParticleClassifierOptions(JNIEnv* env, jclass , jlong session, jlong preprocessingOptions, jlong options) -{ - int rv = imaqGetParticleClassifierOptions((const ClassifierSession*)session, (ParticleClassifierPreprocessingOptions*)preprocessingOptions, (ParticleClassifierOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqParticleFilter3(Image dest, Image source, ParticleFilterCriteria2 criteria, int criteriaCount, ParticleFilterOptions options, ROI roi) - * JN: void imaqParticleFilter3(long dest, long source, long criteria, int criteriaCount, long options, long roi, long numParticles) - * C: int imaqParticleFilter3(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, const ParticleFilterOptions* options, const ROI* roi, int* numParticles) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqParticleFilter3(JNIEnv* env, jclass , jlong dest, jlong source, jlong criteria, jint criteriaCount, jlong options, jlong roi, jlong numParticles) -{ - int rv = imaqParticleFilter3((Image*)dest, (Image*)source, (const ParticleFilterCriteria2*)criteria, (int)criteriaCount, (const ParticleFilterOptions*)options, (const ROI*)roi, (int*)numParticles); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqLearnPattern2(Image image, LearningMode learningMode) - * JN: void imaqLearnPattern2(long image, int learningMode, long advancedOptions) - * C: int imaqLearnPattern2(Image* image, LearningMode learningMode, LearnPatternAdvancedOptions* advancedOptions) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqLearnPattern2(JNIEnv* env, jclass , jlong image, jint learningMode, jlong advancedOptions) -{ - int rv = imaqLearnPattern2((Image*)image, (LearningMode)learningMode, (LearnPatternAdvancedOptions*)advancedOptions); - if (rv == 0) throwJavaException(env); -} - -/* J: void imaqDivide(Image dest, Image sourceA, Image sourceB) - * JN: void imaqDivide(long dest, long sourceA, long sourceB) - * C: int imaqDivide(Image* dest, const Image* sourceA, const Image* sourceB) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqDivide(JNIEnv* env, jclass , jlong dest, jlong sourceA, jlong sourceB) -{ - int rv = imaqDivide((Image*)dest, (const Image*)sourceA, (const Image*)sourceB); - if (rv == 0) throwJavaException(env); -} - -/* J: EdgeReport2 imaqEdgeTool3(Image image, ROI roi, EdgeProcess processType, EdgeOptions2 edgeOptions) - * JN: long imaqEdgeTool3(long image, long roi, int processType, long edgeOptions) - * C: EdgeReport2* imaqEdgeTool3(const Image* image, const ROI* roi, EdgeProcess processType, const EdgeOptions2* edgeOptions) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqEdgeTool3(JNIEnv* env, jclass , jlong image, jlong roi, jint processType, jlong edgeOptions) -{ - EdgeReport2* rv = imaqEdgeTool3((const Image*)image, (const ROI*)roi, (EdgeProcess)processType, (const EdgeOptions2*)edgeOptions); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: ConcentricRakeReport imaqConcentricRake(Image image, ROI roi, ConcentricRakeDirection direction, EdgeProcess process, RakeOptions options) - * JN: long imaqConcentricRake(long image, long roi, int direction, int process, long options) - * C: ConcentricRakeReport* imaqConcentricRake(const Image* image, const ROI* roi, ConcentricRakeDirection direction, EdgeProcess process, const RakeOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqConcentricRake(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jlong options) -{ - ConcentricRakeReport* rv = imaqConcentricRake((const Image*)image, (const ROI*)roi, (ConcentricRakeDirection)direction, (EdgeProcess)process, (const RakeOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: SpokeReport imaqSpoke(Image image, ROI roi, SpokeDirection direction, EdgeProcess process, SpokeOptions options) - * JN: long imaqSpoke(long image, long roi, int direction, int process, long options) - * C: SpokeReport* imaqSpoke(const Image* image, const ROI* roi, SpokeDirection direction, EdgeProcess process, const SpokeOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqSpoke(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jlong options) -{ - SpokeReport* rv = imaqSpoke((const Image*)image, (const ROI*)roi, (SpokeDirection)direction, (EdgeProcess)process, (const SpokeOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: MatchPattern2Result imaqMatchPattern2(Image image, Image pattern, MatchPatternOptions options, MatchPatternAdvancedOptions advancedOptions, Rect searchRect) - * JN: long imaqMatchPattern2(long image, long pattern, long options, long advancedOptions, long searchRect, long numMatches) - * C: PatternMatch* imaqMatchPattern2(const Image* image, const Image* pattern, const MatchPatternOptions* options, const MatchPatternAdvancedOptions* advancedOptions, Rect searchRect, int* numMatches) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqMatchPattern2(JNIEnv* env, jclass , jlong image, jlong pattern, jlong options, jlong advancedOptions, jlong searchRect, jlong numMatches) -{ - PatternMatch* rv = imaqMatchPattern2((const Image*)image, (const Image*)pattern, (const MatchPatternOptions*)options, (const MatchPatternAdvancedOptions*)advancedOptions, *((Rect*)searchRect), (int*)numMatches); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void imaqSetParticleClassifierOptions(ClassifierSession session, ParticleClassifierPreprocessingOptions preprocessingOptions, ParticleClassifierOptions options) - * JN: void imaqSetParticleClassifierOptions(long session, long preprocessingOptions, long options) - * C: int imaqSetParticleClassifierOptions(ClassifierSession* session, const ParticleClassifierPreprocessingOptions* preprocessingOptions, const ParticleClassifierOptions* options) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1imaqSetParticleClassifierOptions(JNIEnv* env, jclass , jlong session, jlong preprocessingOptions, jlong options) -{ - int rv = imaqSetParticleClassifierOptions((ClassifierSession*)session, (const ParticleClassifierPreprocessingOptions*)preprocessingOptions, (const ParticleClassifierOptions*)options); - if (rv == 0) throwJavaException(env); -} - -/* J: RakeReport imaqRake(Image image, ROI roi, RakeDirection direction, EdgeProcess process, RakeOptions options) - * JN: long imaqRake(long image, long roi, int direction, int process, long options) - * C: RakeReport* imaqRake(const Image* image, const ROI* roi, RakeDirection direction, EdgeProcess process, const RakeOptions* options) - */ - -JNIEXPORT jlong JNICALL Java_com_ni_vision_NIVision__1imaqRake(JNIEnv* env, jclass , jlong image, jlong roi, jint direction, jint process, jlong options) -{ - RakeReport* rv = imaqRake((const Image*)image, (const ROI*)roi, (RakeDirection)direction, (EdgeProcess)process, (const RakeOptions*)options); - if (!rv) throwJavaException(env); - return (jlong)rv; -} - -/* J: void Priv_ReadJPEGString_C(Image image, byte[] string) - * JN: void Priv_ReadJPEGString_C(long image, long string, int stringLength) - * C: int Priv_ReadJPEGString_C(Image* image, const unsigned char* string, unsigned int stringLength) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1Priv_1ReadJPEGString_1C(JNIEnv* env, jclass , jlong image, jlong string, jint stringLength) -{ - int rv = Priv_ReadJPEGString_C((Image*)image, (const unsigned char*)string, (unsigned int)stringLength); - if (rv == 0) throwJavaException(env); -} - -/* - * Purpose : Include file for NI-IMAQdx library support. - */ - -/* - * Bus Type Enumeration - */ - -/* - * Camera Control Mode Enumeration - */ - -/* - * Buffer Number Mode Enumeration - */ - -/* - * Plug n Play Event Enumeration - */ - -/* - * Bayer Pattern Enumeration - */ - -/* - * Bayer Decode Algorithm Enumeration - */ - -/* - * Output Image Types -- Values match Vision Development Module image types - */ - -/* - * Controller Destination Mode Enumeration - */ - -/* - * Attribute Type Enumeration - */ - -/* - * Value Type Enumeration - */ - -/* - * Interface File Flags Enumeration - */ - -/* - * Overwrite Mode Enumeration - */ - -/* - * Incomplete Buffer Mode Enumeration - */ - -/* - * Lost Packet Mode Enumeration - */ - -/* - * Attribute Visibility Enumeration - */ - -/* - * Stream Channel Mode Enumeration - */ - -/* - * Pixel Signedness Enumeration - */ - -/* - * USB Connection Speed Enumeration - */ - -/* - * CVI Structures - */ - -/* - * Camera Information Structure - */ - -/* - * Camera File Structure - */ - -/* - * Attribute Information Structure - */ - -/* - * Enumeration Item Structure - */ - -/* - * Camera Information Structure - */ - -/* - * Attributes - */ - -/* - * Functions - */ - -/* J: void IMAQdxSnap(int id, Image image) - * JN: void IMAQdxSnap(int id, long image) - * C: IMAQdxError IMAQdxSnap(IMAQdxSession id, Image* image) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSnap(JNIEnv* env, jclass , jint id, jlong image) -{ - IMAQdxError rv = IMAQdxSnap((IMAQdxSession)id, (Image*)image); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxConfigureGrab(int id) - * JN: void IMAQdxConfigureGrab(int id) - * C: IMAQdxError IMAQdxConfigureGrab(IMAQdxSession id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxConfigureGrab(JNIEnv* env, jclass , jint id) -{ - IMAQdxError rv = IMAQdxConfigureGrab((IMAQdxSession)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGrab(int id, Image image, int waitForNextBuffer) - * JN: void IMAQdxGrab(int id, long image, int waitForNextBuffer, long actualBufferNumber) - * C: IMAQdxError IMAQdxGrab(IMAQdxSession id, Image* image, bool32 waitForNextBuffer, uInt32* actualBufferNumber) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGrab(JNIEnv* env, jclass , jint id, jlong image, jint waitForNextBuffer, jlong actualBufferNumber) -{ - IMAQdxError rv = IMAQdxGrab((IMAQdxSession)id, (Image*)image, (bool32)waitForNextBuffer, (uInt32*)actualBufferNumber); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxDiscoverEthernetCameras(String address, int timeout) - * JN: void IMAQdxDiscoverEthernetCameras(long address, int timeout) - * C: IMAQdxError IMAQdxDiscoverEthernetCameras(const char* address, uInt32 timeout) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxDiscoverEthernetCameras(JNIEnv* env, jclass , jlong address, jint timeout) -{ - IMAQdxError rv = IMAQdxDiscoverEthernetCameras((const char*)address, (uInt32)timeout); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxResetCamera(String name, int resetAll) - * JN: void IMAQdxResetCamera(long name, int resetAll) - * C: IMAQdxError IMAQdxResetCamera(const char* name, bool32 resetAll) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxResetCamera(JNIEnv* env, jclass , jlong name, jint resetAll) -{ - IMAQdxError rv = IMAQdxResetCamera((const char*)name, (bool32)resetAll); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxOpenCamera(String name, IMAQdxCameraControlMode mode) - * JN: void IMAQdxOpenCamera(long name, int mode, long id) - * C: IMAQdxError IMAQdxOpenCamera(const char* name, IMAQdxCameraControlMode mode, IMAQdxSession* id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxOpenCamera(JNIEnv* env, jclass , jlong name, jint mode, jlong id) -{ - IMAQdxError rv = IMAQdxOpenCamera((const char*)name, (IMAQdxCameraControlMode)mode, (IMAQdxSession*)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxCloseCamera(int id) - * JN: void IMAQdxCloseCamera(int id) - * C: IMAQdxError IMAQdxCloseCamera(IMAQdxSession id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxCloseCamera(JNIEnv* env, jclass , jint id) -{ - IMAQdxError rv = IMAQdxCloseCamera((IMAQdxSession)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxConfigureAcquisition(int id, int continuous, int bufferCount) - * JN: void IMAQdxConfigureAcquisition(int id, int continuous, int bufferCount) - * C: IMAQdxError IMAQdxConfigureAcquisition(IMAQdxSession id, bool32 continuous, uInt32 bufferCount) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxConfigureAcquisition(JNIEnv* env, jclass , jint id, jint continuous, jint bufferCount) -{ - IMAQdxError rv = IMAQdxConfigureAcquisition((IMAQdxSession)id, (bool32)continuous, (uInt32)bufferCount); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxStartAcquisition(int id) - * JN: void IMAQdxStartAcquisition(int id) - * C: IMAQdxError IMAQdxStartAcquisition(IMAQdxSession id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxStartAcquisition(JNIEnv* env, jclass , jint id) -{ - IMAQdxError rv = IMAQdxStartAcquisition((IMAQdxSession)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetImage(int id, Image image, IMAQdxBufferNumberMode mode, int desiredBufferNumber) - * JN: void IMAQdxGetImage(int id, long image, int mode, int desiredBufferNumber, long actualBufferNumber) - * C: IMAQdxError IMAQdxGetImage(IMAQdxSession id, Image* image, IMAQdxBufferNumberMode mode, uInt32 desiredBufferNumber, uInt32* actualBufferNumber) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetImage(JNIEnv* env, jclass , jint id, jlong image, jint mode, jint desiredBufferNumber, jlong actualBufferNumber) -{ - IMAQdxError rv = IMAQdxGetImage((IMAQdxSession)id, (Image*)image, (IMAQdxBufferNumberMode)mode, (uInt32)desiredBufferNumber, (uInt32*)actualBufferNumber); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -JNIEXPORT jint JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetImageData(JNIEnv* env, jclass , jint id, jlong buffer, jint bufferSize, jint mode, jint desiredBufferNumber) -{ - uInt32 actualBufferNumber; - IMAQdxError rv = IMAQdxGetImageData((IMAQdxSession)id, (void*)buffer, (uInt32)bufferSize, (IMAQdxBufferNumberMode)mode, (uInt32)desiredBufferNumber, &actualBufferNumber); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); - return (jint)actualBufferNumber; -} - -/* J: void IMAQdxStopAcquisition(int id) - * JN: void IMAQdxStopAcquisition(int id) - * C: IMAQdxError IMAQdxStopAcquisition(IMAQdxSession id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxStopAcquisition(JNIEnv* env, jclass , jint id) -{ - IMAQdxError rv = IMAQdxStopAcquisition((IMAQdxSession)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxUnconfigureAcquisition(int id) - * JN: void IMAQdxUnconfigureAcquisition(int id) - * C: IMAQdxError IMAQdxUnconfigureAcquisition(IMAQdxSession id) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxUnconfigureAcquisition(JNIEnv* env, jclass , jint id) -{ - IMAQdxError rv = IMAQdxUnconfigureAcquisition((IMAQdxSession)id); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxEnumerateVideoModes(JNIEnv* env, jclass , jint id, jlong videoModeArray, jlong count, jlong currentMode) -{ - IMAQdxError rv = IMAQdxEnumerateVideoModes((IMAQdxSession)id, (IMAQdxVideoMode*)videoModeArray, (uInt32*)count, (uInt32*)currentMode); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeType(int id, String name) - * JN: void IMAQdxGetAttributeType(int id, long name, long type) - * C: IMAQdxError IMAQdxGetAttributeType(IMAQdxSession id, const char* name, IMAQdxAttributeType* type) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeType(JNIEnv* env, jclass , jint id, jlong name, jlong type) -{ - IMAQdxError rv = IMAQdxGetAttributeType((IMAQdxSession)id, (const char*)name, (IMAQdxAttributeType*)type); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxIsAttributeReadable(int id, String name) - * JN: void IMAQdxIsAttributeReadable(int id, long name, long readable) - * C: IMAQdxError IMAQdxIsAttributeReadable(IMAQdxSession id, const char* name, bool32* readable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxIsAttributeReadable(JNIEnv* env, jclass , jint id, jlong name, jlong readable) -{ - IMAQdxError rv = IMAQdxIsAttributeReadable((IMAQdxSession)id, (const char*)name, (bool32*)readable); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxIsAttributeWritable(int id, String name) - * JN: void IMAQdxIsAttributeWritable(int id, long name, long writable) - * C: IMAQdxError IMAQdxIsAttributeWritable(IMAQdxSession id, const char* name, bool32* writable) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxIsAttributeWritable(JNIEnv* env, jclass , jint id, jlong name, jlong writable) -{ - IMAQdxError rv = IMAQdxIsAttributeWritable((IMAQdxSession)id, (const char*)name, (bool32*)writable); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxWriteRegister(int id, int offset, int value) - * JN: void IMAQdxWriteRegister(int id, int offset, int value) - * C: IMAQdxError IMAQdxWriteRegister(IMAQdxSession id, uInt32 offset, uInt32 value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxWriteRegister(JNIEnv* env, jclass , jint id, jint offset, jint value) -{ - IMAQdxError rv = IMAQdxWriteRegister((IMAQdxSession)id, (uInt32)offset, (uInt32)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxReadRegister(int id, int offset) - * JN: void IMAQdxReadRegister(int id, int offset, long value) - * C: IMAQdxError IMAQdxReadRegister(IMAQdxSession id, uInt32 offset, uInt32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxReadRegister(JNIEnv* env, jclass , jint id, jint offset, jlong value) -{ - IMAQdxError rv = IMAQdxReadRegister((IMAQdxSession)id, (uInt32)offset, (uInt32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxWriteAttributes(int id, String filename) - * JN: void IMAQdxWriteAttributes(int id, long filename) - * C: IMAQdxError IMAQdxWriteAttributes(IMAQdxSession id, const char* filename) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxWriteAttributes(JNIEnv* env, jclass , jint id, jlong filename) -{ - IMAQdxError rv = IMAQdxWriteAttributes((IMAQdxSession)id, (const char*)filename); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxReadAttributes(int id, String filename) - * JN: void IMAQdxReadAttributes(int id, long filename) - * C: IMAQdxError IMAQdxReadAttributes(IMAQdxSession id, const char* filename) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxReadAttributes(JNIEnv* env, jclass , jint id, jlong filename) -{ - IMAQdxError rv = IMAQdxReadAttributes((IMAQdxSession)id, (const char*)filename); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxResetEthernetCameraAddress(String name, String address, String subnet, String gateway, int timeout) - * JN: void IMAQdxResetEthernetCameraAddress(long name, long address, long subnet, long gateway, int timeout) - * C: IMAQdxError IMAQdxResetEthernetCameraAddress(const char* name, const char* address, const char* subnet, const char* gateway, uInt32 timeout) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxResetEthernetCameraAddress(JNIEnv* env, jclass , jlong name, jlong address, jlong subnet, jlong gateway, jint timeout) -{ - IMAQdxError rv = IMAQdxResetEthernetCameraAddress((const char*)name, (const char*)address, (const char*)subnet, (const char*)gateway, (uInt32)timeout); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeVisibility(int id, String name) - * JN: void IMAQdxGetAttributeVisibility(int id, long name, long visibility) - * C: IMAQdxError IMAQdxGetAttributeVisibility(IMAQdxSession id, const char* name, IMAQdxAttributeVisibility* visibility) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeVisibility(JNIEnv* env, jclass , jint id, jlong name, jlong visibility) -{ - IMAQdxError rv = IMAQdxGetAttributeVisibility((IMAQdxSession)id, (const char*)name, (IMAQdxAttributeVisibility*)visibility); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeU32(int id, String name) - * JN: void IMAQdxGetAttributeU32(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeU32(IMAQdxSession id, const char* name, uInt32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeU32(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeU32((IMAQdxSession)id, (const char*)name, (uInt32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeI64(int id, String name) - * JN: void IMAQdxGetAttributeI64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeI64(IMAQdxSession id, const char* name, Int64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeI64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeI64((IMAQdxSession)id, (const char*)name, (Int64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeF64(int id, String name) - * JN: void IMAQdxGetAttributeF64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeF64(IMAQdxSession id, const char* name, float64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeF64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeF64((IMAQdxSession)id, (const char*)name, (float64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeString(int id, String name) - * JN: void IMAQdxGetAttributeString(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeString(IMAQdxSession id, const char* name, char value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeString(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeString((IMAQdxSession)id, (const char*)name, (char*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeEnum(int id, String name) - * JN: void IMAQdxGetAttributeEnum(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeEnum(IMAQdxSession id, const char* name, IMAQdxEnumItem* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeEnum(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeEnum((IMAQdxSession)id, (const char*)name, (IMAQdxEnumItem*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeBool(int id, String name) - * JN: void IMAQdxGetAttributeBool(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeBool(IMAQdxSession id, const char* name, bool32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeBool(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeBool((IMAQdxSession)id, (const char*)name, (bool32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMinimumU32(int id, String name) - * JN: void IMAQdxGetAttributeMinimumU32(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMinimumU32(IMAQdxSession id, const char* name, uInt32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMinimumU32(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMinimumU32((IMAQdxSession)id, (const char*)name, (uInt32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMinimumI64(int id, String name) - * JN: void IMAQdxGetAttributeMinimumI64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMinimumI64(IMAQdxSession id, const char* name, Int64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMinimumI64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMinimumI64((IMAQdxSession)id, (const char*)name, (Int64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMinimumF64(int id, String name) - * JN: void IMAQdxGetAttributeMinimumF64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMinimumF64(IMAQdxSession id, const char* name, float64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMinimumF64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMinimumF64((IMAQdxSession)id, (const char*)name, (float64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMaximumU32(int id, String name) - * JN: void IMAQdxGetAttributeMaximumU32(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMaximumU32(IMAQdxSession id, const char* name, uInt32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMaximumU32(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMaximumU32((IMAQdxSession)id, (const char*)name, (uInt32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMaximumI64(int id, String name) - * JN: void IMAQdxGetAttributeMaximumI64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMaximumI64(IMAQdxSession id, const char* name, Int64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMaximumI64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMaximumI64((IMAQdxSession)id, (const char*)name, (Int64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeMaximumF64(int id, String name) - * JN: void IMAQdxGetAttributeMaximumF64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeMaximumF64(IMAQdxSession id, const char* name, float64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeMaximumF64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeMaximumF64((IMAQdxSession)id, (const char*)name, (float64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeIncrementU32(int id, String name) - * JN: void IMAQdxGetAttributeIncrementU32(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeIncrementU32(IMAQdxSession id, const char* name, uInt32* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeIncrementU32(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeIncrementU32((IMAQdxSession)id, (const char*)name, (uInt32*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeIncrementI64(int id, String name) - * JN: void IMAQdxGetAttributeIncrementI64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeIncrementI64(IMAQdxSession id, const char* name, Int64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeIncrementI64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeIncrementI64((IMAQdxSession)id, (const char*)name, (Int64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxGetAttributeIncrementF64(int id, String name) - * JN: void IMAQdxGetAttributeIncrementF64(int id, long name, long value) - * C: IMAQdxError IMAQdxGetAttributeIncrementF64(IMAQdxSession id, const char* name, float64* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxGetAttributeIncrementF64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxGetAttributeIncrementF64((IMAQdxSession)id, (const char*)name, (float64*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeU32(int id, String name, int value) - * JN: void IMAQdxSetAttributeU32(int id, long name, int value) - * C: IMAQdxError IMAQdxSetAttributeU32(IMAQdxSession id, const char* name, uInt32 value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeU32(JNIEnv* env, jclass , jint id, jlong name, jint value) -{ - IMAQdxError rv = IMAQdxSetAttributeU32((IMAQdxSession)id, (const char*)name, (uInt32)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeI64(int id, String name, long value) - * JN: void IMAQdxSetAttributeI64(int id, long name, long value) - * C: IMAQdxError IMAQdxSetAttributeI64(IMAQdxSession id, const char* name, Int64 value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeI64(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxSetAttributeI64((IMAQdxSession)id, (const char*)name, (Int64)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeF64(int id, String name, double value) - * JN: void IMAQdxSetAttributeF64(int id, long name, double value) - * C: IMAQdxError IMAQdxSetAttributeF64(IMAQdxSession id, const char* name, float64 value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeF64(JNIEnv* env, jclass , jint id, jlong name, jdouble value) -{ - IMAQdxError rv = IMAQdxSetAttributeF64((IMAQdxSession)id, (const char*)name, (float64)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeString(int id, String name, String value) - * JN: void IMAQdxSetAttributeString(int id, long name, long value) - * C: IMAQdxError IMAQdxSetAttributeString(IMAQdxSession id, const char* name, const char* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeString(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxSetAttributeString((IMAQdxSession)id, (const char*)name, (const char*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeEnum(int id, String name, IMAQdxEnumItem value) - * JN: void IMAQdxSetAttributeEnum(int id, long name, long value) - * C: IMAQdxError IMAQdxSetAttributeEnum(IMAQdxSession id, const char* name, const IMAQdxEnumItem* value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeEnum(JNIEnv* env, jclass , jint id, jlong name, jlong value) -{ - IMAQdxError rv = IMAQdxSetAttributeEnum((IMAQdxSession)id, (const char*)name, (const IMAQdxEnumItem*)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} - -/* J: void IMAQdxSetAttributeBool(int id, String name, int value) - * JN: void IMAQdxSetAttributeBool(int id, long name, int value) - * C: IMAQdxError IMAQdxSetAttributeBool(IMAQdxSession id, const char* name, bool32 value) - */ - -JNIEXPORT void JNICALL Java_com_ni_vision_NIVision__1IMAQdxSetAttributeBool(JNIEnv* env, jclass , jint id, jlong name, jint value) -{ - IMAQdxError rv = IMAQdxSetAttributeBool((IMAQdxSession)id, (const char*)name, (bool32)value); - if (rv != IMAQdxErrorSuccess) dxthrowJavaException(env, rv); -} -} - -static const char* getErrorText(int err) { - switch (err) { - case ERR_3DVISION_INVALID_SESSION_TYPE: return "This 3D vision function cannot be called on this type of 3d vision session."; - case ERR_ARRAY_SIZE_MISMATCH: return "The array sizes are not compatible."; - case ERR_AVI_DATA_EXCEEDS_BUFFER_SIZE: return "The data for this frame exceeds the data buffer size specified when creating the AVI file."; - case ERR_AVI_READ_SESSION_REQUIRED: return "The AVI session is a write session, but this operation requires a read session."; - case ERR_AVI_SESSION_ALREADY_OPEN: return "This AVI session is already open. You must close it before calling the Create or Open functions."; - case ERR_AVI_TIMEOUT: return "DirectX has timed out reading or writing the AVI file. When closing an AVI file, try adding an additional delay. When reading an AVI file, try reducing CPU and disk load."; - case ERR_AVI_UNOPENED_SESSION: return "The AVI session has not been opened."; - case ERR_AVI_VERSION: return "The AVI file was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this AVI file."; - case ERR_AVI_WRITE_SESSION_REQUIRED: return "The AVI session is a read session, but this operation requires a write session."; - case ERR_BAD_FILTER_WIDTH: return "The filter width must be odd for the Canny operator."; - case ERR_BAD_INDEX: return "Invalid handle table index."; - case ERR_BAD_MEASURE: return "Invalid measure number."; - case ERR_BAD_PASSWORD: return "Incorrect password."; - case ERR_BAD_ROI: return "Invalid ROI."; - case ERR_BAD_ROI_BOX: return "Invalid ROI global rectangle."; - case ERR_BAD_SAMPLE_INDEX: return "The Sample Index fell outside the range of Samples."; - case ERR_BARCODE: return "The barcode does not match the type you specified."; - case ERR_BARCODE_CHECKSUM: return "The decoded barcode information did not pass the checksum test."; - case ERR_BARCODE_CODABAR: return "The barcode is not a valid Codabar barcode."; - case ERR_BARCODE_CODE128: return "The barcode is not a valid Code128 barcode."; - case ERR_BARCODE_CODE128_FNC: return "The FNC value in the Code128 barcode is not located before the first data value."; - case ERR_BARCODE_CODE128_SET: return "The starting code set in the Code128 barcode is not valid."; - case ERR_BARCODE_CODE39: return "The barcode is not a valid Code 3 of 9 barcode."; - case ERR_BARCODE_CODE93: return "The barcode is not a valid Code93 barcode."; - case ERR_BARCODE_CODE93_SHIFT: return "The Code93 barcode contains invalid shift encoding."; - case ERR_BARCODE_EAN13: return "The barcode is not a valid EAN13 barcode."; - case ERR_BARCODE_EAN8: return "The barcode is not a valid EAN8 barcode."; - case ERR_BARCODE_I25: return "The barcode is not a valid Interleaved 2 of 5 barcode."; - case ERR_BARCODE_INVALID: return "The image does not represent a valid linear barcode."; - case ERR_BARCODE_MSI: return "The barcode is not a valid MSI barcode."; - case ERR_BARCODE_PHARMACODE: return "The barcode is not a valid Pharmacode symbol"; - case ERR_BARCODE_RSSLIMITED: return "The barcode is not a valid RSS Limited symbol"; - case ERR_BARCODE_TYPE: return "The barcode type is invalid."; - case ERR_BARCODE_UPCA: return "The barcode is not a valid UPCA barcode."; - case ERR_BOARD_NOT_FOUND: return "Board not found."; - case ERR_BOARD_NOT_OPEN: return "Board not opened."; - case ERR_BOTH_MARKER_INPUTS_SUPPLIED: return "Both Marker Image and Points are supplied."; - case ERR_CALIBRATION_DUPLICATE_REFERENCE_POINT: return "The reference points passed are inconsistent. At least two similar pixel coordinates correspond to different real-world coordinates."; - case ERR_CALIBRATION_ERRORMAP: return "The calibration error map cannot be computed."; - case ERR_CALIBRATION_FAILED_TO_FIND_GRID: return "Unable to automatically detect grid because the image is too distorted."; - case ERR_CALIBRATION_IMAGE_CORRECTED: return "The operation is invalid in a corrected image."; - case ERR_CALIBRATION_IMAGE_UNCALIBRATED: return "The source/input image has not been calibrated."; - case ERR_CALIBRATION_INFO_1: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_2: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_3: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_4: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_5: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_6: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_MICRO_PLANE: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_PERSPECTIVE_PROJECTION: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_SIMPLE_TRANSFORM: return "Invalid calibration template image."; - case ERR_CALIBRATION_INFO_VERSION: return "Invalid calibration information version."; - case ERR_CALIBRATION_INSF_POINTS: return "Insufficient number of calibration feature points."; - case ERR_CALIBRATION_INVALID_ROI: return "The ROI contains an invalid contour type or is not contained in the ROI learned for calibration."; - case ERR_CALIBRATION_INVALID_SCALING_FACTOR: return "Invalid calibration scaling factor."; - case ERR_CAMERA_MODEL_NOT_AVAILABLE: return "Camera Model is not learned"; - case ERR_CANNOT_COMPACT_UNTRAINED: return "You may only save a session in compact form if it is trained."; - case ERR_CANT_DRAW_INTO_VIEWER: return "Unable to draw to viewer. You must have the latest version of the control."; - case ERR_CANT_RESIZE_EXTERNAL: return "Cannot resize an image in an acquisition buffer."; - case ERR_CLASSIFIER_CLASSIFY_IMAGE_WITH_CUSTOM_SESSION: return "Custom classifier sessions only classify feature vectors. They do not support classifying images."; - case ERR_CLASSIFIER_INVALID_ENGINE_TYPE: return "The engine for this classifier session does not support this operation."; - case ERR_CLASSIFIER_INVALID_SESSION_TYPE: return "This classifier function cannot be called on this type of classifier session."; - case ERR_CLASSIFIER_SESSION_NOT_TRAINED: return "This classifier session is not trained. You may only call this function on a trained classifier session."; - case ERR_CLASS_NAME_NOT_FOUND: return "Required Class name is not found in trained labels/Class names"; - case ERR_COLORMODE_REQUIRES_CHANGECOLORSPACE2: return "The specified color mode requires the use of imaqChangeColorSpace2."; - case ERR_COLOR_IMAGE_REQUIRED: return "The input image must be a color image."; - case ERR_COLOR_LEARN_SETUP_DATA: return "Invalid color learn setup data."; - case ERR_COLOR_LEARN_SETUP_DATA_SHAPE: return "Invalid color learn setup data."; - case ERR_COLOR_MATCH_SETUP_DATA: return "Invalid color match setup data."; - case ERR_COLOR_MATCH_SETUP_DATA_SHAPE: return "Invalid color match setup data."; - case ERR_COLOR_ROTATION_REQUIRES_SHAPE_FEATURE: return "Rotation-invariant color pattern matching requires a feature mode including shape."; - case ERR_COLOR_SPECTRUM_MASK: return "The color mask removes too much color information."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_1: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_2: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_3: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_4: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_5: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_6: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_NOROTATION: return "The color template image does not contain data required for rotation-invariant color matching."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHAPE: return "The color template image does not contain data required for color matching in shape feature mode."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSHIFT: return "The color template image does not contain data required for shift-invariant color matching."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_NOSPECTRUM: return "The color template image does not contain data required for color matching in color feature mode."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_1: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_2: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_3: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_4: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_ROTATION_5: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_1: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_DESCRIPTOR_SHIFT_2: return "Invalid color template image."; - case ERR_COLOR_TEMPLATE_IMAGE_HUE_CONTRAST_TOO_LOW: return "The contrast in the hue plane of the image is too low for learning shape features."; - case ERR_COLOR_TEMPLATE_IMAGE_LUMINANCE_CONTRAST_TOO_LOW: return "The contrast in the luminance plane of the image is too low to learn shape features."; - case ERR_COLOR_TEMPLATE_IMAGE_TOO_LARGE: return "The color template image is too large."; - case ERR_COLOR_TEMPLATE_IMAGE_TOO_SMALL: return "The color template image is too small."; - case ERR_COMPLEXPLANE_NOT_REAL_OR_IMAGINARY: return "You can perform this operation on a real or an imaginary ComplexPlane only."; - case ERR_COMPLEX_IMAGE_REQUIRED: return "A complex image is required."; - case ERR_COMPLEX_PLANE: return "Invalid complex plane."; - case ERR_COMPLEX_ROOT: return "The roots of the equation are complex."; - case ERR_COM_INITIALIZE: return "Error initializing COM."; - case ERR_CONTAINER_CAPACITY_EXCEEDED_INT_MAX: return "The operation would have exceeded the capacity of an internal container, which is limited to 2147483648 unique elements."; - case ERR_CONTAINER_CAPACITY_EXCEEDED_UINT_MAX: return "The operation would have exceeded the capacity of an internal container, which is limited to 4294967296 unique elements."; - case ERR_CONTOURID_NOT_FOUND: return "The supplied ContourID did not correlate to a contour inside the ROI."; - case ERR_CONTOUR_COMPARE_KERNEL: return "Invalid Smoothing Kernel width for contour comparison. Must be zero or an odd positive integer."; - case ERR_CONTOUR_COMPARE_SINGLE_IMAGE: return "If no template image is provided, the target image must contain both a contour with extracted points and a fitted equation."; - case ERR_CONTOUR_CONNECT_DUPLICATE: return "Only one range is allowed per curve connection constraint type."; - case ERR_CONTOUR_CONNECT_TYPE: return "Invalid contour connection constraint type."; - case ERR_CONTOUR_CURVATURE_KERNEL: return "Invalid kernel width for curvature calculation. Must be an odd value greater than 1."; - case ERR_CONTOUR_EXTRACT_DIRECTION: return "Invalid Search Direction for contour extraction."; - case ERR_CONTOUR_EXTRACT_ROI: return "Invalid ROI for contour extraction. The ROI must contain an annulus, rectangle or rotated rectangle."; - case ERR_CONTOUR_EXTRACT_SELECTION: return "Invalid Contour Selection method for contour extraction."; - case ERR_CONTOUR_GPM_FAIL: return "Matching failed to align the template and target contours."; - case ERR_CONTOUR_INDEX_OUT_OF_RANGE: return "The contour index you supplied is larger than the number of contours in the ROI."; - case ERR_CONTOUR_INVALID: return "Invalid contour image."; - case ERR_CONTOUR_INVALID_KERNEL_FOR_SMOOTHING: return "Invalid kernel for contour smoothing. Zero indicates no smoothing, otherwise value must be odd."; - case ERR_CONTOUR_INVALID_REFINEMENTS: return "Invalid number specified for maximum contour refinements."; - case ERR_CONTOUR_LINE_INVALID: return "The contour line fit is invalid. Line segment start and stop must differ."; - case ERR_CONTOUR_MATCH_STR_NOT_APPLICABLE: return "In order to use contour matching, you must provide a template image that has been trained with IMAQ Learn Contour Pattern"; - case ERR_CONTOUR_NO_CURVES: return "No curves were found in the image."; - case ERR_CONTOUR_OPENING_NEWER_VERSION: return "The contour you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_CONTOUR_TEMPLATE_IMAGE_INVALID: return "The template image must be trained with IMAQ Learn Contour Pattern or be the same size as the target image."; - case ERR_COORDSYS_NOT_FOUND: return "The coordinate system could not be found on this image."; - case ERR_COORD_SYS_FIRST_AXIS: return "Unable to fit a line for the primary axis."; - case ERR_COORD_SYS_SECOND_AXIS: return "Unable to fit a line for the secondary axis."; - case ERR_COST_LABEL_NOT_FOUND: return "Label name is not found in added samples"; - case ERR_CREATE_WINDOW: return "Unable to create window."; - case ERR_CURVE_EXTRACTION_MODE_MUST_BE_SAME: return "You must specify the same curve extraction mode for all the templates you want to match."; - case ERR_CUSTOMDATA_INVALID_KEY: return "They custom data key you supplied is invalid. The only valid character values are decimal 32-126 and 161-255. There must also be no repeated, leading, or trailing spaces."; - case ERR_CUSTOMDATA_INVALID_SIZE: return "The size you specified is out of the valid range."; - case ERR_CUSTOMDATA_KEY_NOT_FOUND: return "The key you specified cannot be found in the image."; - case ERR_DATA_CORRUPTED: return "The data is corrupted and cannot be read."; - case ERR_DATA_VERSION: return "The data was stored with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this data."; - case ERR_DEPRECATED_FUNCTION: return "This backwards-compatibility function can not be used with this session. Use newer, supported functions instead."; - case ERR_DESCRIPTION_TOO_LONG: return "The description must be <= 255 characters."; - case ERR_DIRECTX: return "An internal DirectX error has occurred. Try upgrading to the latest version of DirectX."; - case ERR_DIRECTX_CERTIFICATION_FAILURE: return "A software key is restricting the use of this compression filter."; - case ERR_DIRECTX_DLL_NOT_FOUND: return "Quartz.dll not found. Install DirectX 8.1 or later."; - case ERR_DIRECTX_ENUMERATE_FILTERS: return "DirectX is unable to enumerate the compression filters. This is caused by a third-party compression filter that is either improperly installed or is preventing itself from being enumerated. Remove any recently installed compression filters and try again."; - case ERR_DIRECTX_INCOMPATIBLE_COMPRESSION_FILTER: return "Incompatible compression filter."; - case ERR_DIRECTX_INVALID_FILTER_QUALITY: return "The filter quality you provided is invalid. Valid quality values range from -1 to 1000."; - case ERR_DIRECTX_NOT_FOUND: return "DirectX is required for this feature. Please install the latest version.."; - case ERR_DIRECTX_NO_FILTER: return "An appropriate DirectX filter to process this file could not be found. Install the filter that was used to create this AVI. Upgrading to the latest version of DirectX may correct this error. NI Vision requires DirectX 8.1 or higher."; - case ERR_DIRECTX_UNKNOWN_COMPRESSION_FILTER: return "Unknown compression filter."; - case ERR_DISPATCH_STATUS_CONFLICT: return "You are attempting to set the same algorithm to dispatch and to not dispatch. Remove one of the conflicting settings."; - case ERR_DIV_BY_ZERO: return "Cannot divide by zero."; - case ERR_DLL_FUNCTION_NOT_FOUND: return "DLL function not found."; - case ERR_DLL_NOT_FOUND: return "DLL not found."; - case ERR_DRAWTEXT_COLOR_MUST_BE_GRAYSCALE: return "Set the foreground and background text colors to grayscale to draw on a U8 image."; - case ERR_DRIVER: return "Cannot access NI-IMAQ driver."; - case ERR_DUPLICATE_LABEL: return "Duplicate labels are not allowed."; - case ERR_DUPLICATE_TRANSFORM_TYPE: return "Found a duplicate transform type in the properties array. Each properties array may only contain one behavior for each transform type."; - case ERR_EDGE_FILTER_SIZE_MUST_BE_SAME: return "You must specify the same edge filter size for all the templates you want to match."; - case ERR_ENABLE_CALIBRATION_SUPPORT_MUST_BE_SAME: return "You must specify the same value for the enable calibration support advanced match option for all templates you want to match."; - case ERR_EVEN_WINDOW_SIZE: return "The window size must be odd for the Canny operator."; - case ERR_EXCEEDED_SVM_MAX_ITERATION: return "SVM training exceeded maximim Iteration limit"; - case ERR_EXTERNAL_ALIGNMENT: return "The external buffer must be aligned on a 4-byte boundary. The line width and border pixels must be 4-byte aligned, as well."; - case ERR_EXTERNAL_NOT_SUPPORTED: return "This operation is not supported for images in an acquisition buffer."; - case ERR_EXTRAINFO_VERSION: return "The image was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this image."; - case ERR_FILE_ARGERR: return "Invalid parameter."; - case ERR_FILE_COLOR_TABLE: return "Invalid color table."; - case ERR_FILE_EOF: return "Premature end of file."; - case ERR_FILE_FILENAME_NULL: return "You must pass a valid file name. Do not pass in NULL."; - case ERR_FILE_FILE_HEADER: return "Invalid file header."; - case ERR_FILE_FILE_TYPE: return "Invalid file type."; - case ERR_FILE_FORMAT: return "Invalid file format."; - case ERR_FILE_GET_INFO: return "Could not read Vision info from file."; - case ERR_FILE_INVALID_DATA_TYPE: return "NI Vision does not support the file data type you specified."; - case ERR_FILE_INVALID_TYPE: return "NI Vision does not support the file type you specified."; - case ERR_FILE_IO_ERR: return "File I/O error."; - case ERR_FILE_NOT_FOUND: return "File not found."; - case ERR_FILE_NO_SPACE: return "Disk full."; - case ERR_FILE_OPEN: return "File is already open for writing."; - case ERR_FILE_OPERATION: return "Invalid file operation."; - case ERR_FILE_PERMISSION: return "File access denied."; - case ERR_FILE_READ: return "Unable to read data."; - case ERR_FILE_TOO_MANY_OPEN: return "Too many files open."; - case ERR_FILE_WRITE: return "Unable to write data."; - case ERR_FIND_COORDSYS_MORE_THAN_ONE_EDGE: return "When searching for a coordinate system, the number of lines to fit must be 1."; - case ERR_FONT_FILE_FORMAT: return "Invalid font file format."; - case ERR_FONT_FILE_NOT_FOUND: return "Font file not found."; - case ERR_GHT_INVALID_MAXIMUM_LEARN_ANGLE_VALUE: return "The maximum rotation angle value specifed during learning of the template is not supported."; - case ERR_GHT_INVALID_MAXIMUM_LEARN_SCALE_FACTOR: return "The maximum scale factor specifed during learning of the template is not supported."; - case ERR_GHT_INVALID_MINIMUM_LEARN_ANGLE_VALUE: return "The minimum rotation angle value specifed during learning of the template is not supported."; - case ERR_GHT_INVALID_MINIMUM_LEARN_SCALE_FACTOR: return "The minimum scale factor specifed during learning of the template is not supported."; - case ERR_GHT_INVALID_USE_ALL_CURVES_VALUE: return "The use all curves advanced option specified during learn is not supported"; - case ERR_GIP_RANGE: return "An internal error occurred while attempting to access an invalid coordinate on an image."; - case ERR_GRADING_INFORMATION_NOT_FOUND: return "The source image does not contain grading information. You must prepare the source image for grading when reading the Data Matrix, and you cannot change the contents of the source image between reading and grading the Data Matrix."; - case ERR_HARDWARE_DOESNT_SUPPORT_NONTEARING: return "Your hardware is not supported by DirectX and cannot be put into NonTearing mode."; - case ERR_HEAP_TRASHED: return "An internal memory error occurred."; - case ERR_IGNORE_COLOR_SPECTRUM_SET: return "The ignore color spectra array is invalid."; - case ERR_IMAGES_NOT_DIFF: return "The source image and destination image must be different."; - case ERR_IMAGE_CONTAINS_NAN_VALUES: return "Float image contains NaN values"; - case ERR_IMAGE_SIZE_MISMATCH: return "The two input image sizes are different"; - case ERR_IMAGE_SMALLER_THAN_BORDER: return "Your image must be larger than its border size for this operation."; - case ERR_IMAGE_TOO_SMALL: return "The image is not large enough for the operation."; - case ERR_IMAQ_QR_DIMENSION_INVALID: return "Invalid Dimensions."; - case ERR_INCOMPATIBLE_CLASSIFIER_TYPES: return "The session you read from file must be the same type as the session you passed in."; - case ERR_INCOMPATIBLE_MARKER_IMAGE_SIZE: return "Source Image and Marker Image should be of same size."; - case ERR_INCOMP_MATRIX_SIZE: return "The number of pixel and real-world coordinates must be equal."; - case ERR_INCOMP_SIZE: return "Incompatible image size."; - case ERR_INCOMP_TYPE: return "Incompatible image type."; - case ERR_INEFFICIENT_POINTS: return "You supplied an inefficient set of points to match the minimum score."; - case ERR_INFO_NOT_FOUND: return "You must provide information about the subimage within the browser."; - case ERR_INIT: return "Initialization error."; - case ERR_INSF_POINTS: return "You supplied an insufficient number of points to perform this operation."; - case ERR_INSUFFICIENT_BUFFER_SIZE: return "The buffer that was passed in is not big enough to hold all of the data."; - case ERR_INTERNAL: return "Internal error."; - case ERR_INVALID_2D_BARCODE_CELL_SHAPE: return "Invalid 2-D barcode cell shape."; - case ERR_INVALID_2D_BARCODE_CONTRAST: return "Invalid 2-D barcode contrast."; - case ERR_INVALID_2D_BARCODE_CONTRAST_FOR_ROI: return "When using a region of interest that is not a rectangle, you must specify the contrast mode of the barcode as either black on white or white on black."; - case ERR_INVALID_2D_BARCODE_SEARCH_MODE: return "NI Vision does not support the search mode you provided."; - case ERR_INVALID_2D_BARCODE_SHAPE: return "Invalid 2-D barcode shape."; - case ERR_INVALID_2D_BARCODE_SUBTYPE: return "Invalid 2-D barcode Data Matrix subtype."; - case ERR_INVALID_2D_BARCODE_TYPE: return "Invalid 2-D barcode type."; - case ERR_INVALID_3DDIRECTION: return "NI Vision does not support the 3DDirection value you supplied."; - case ERR_INVALID_3DPLANE: return "NI Vision does not support the 3DPlane value you supplied."; - case ERR_INVALID_3DVISION_SESSION: return "Not a valid 3D Vision session."; - case ERR_INVALID_ACTION: return "The function does not support the requested action."; - case ERR_INVALID_ALIGNMENT: return "The supplied scale is invalid for your template."; - case ERR_INVALID_ANGLE_RANGE_FOR_STRAIGHT_EDGE: return "Angle range value should be equal to or greater than zero."; - case ERR_INVALID_ANGLE_TOL_FOR_STRAIGHT_EDGE: return "The angle tolerance should be equal to or greater than 0.001."; - case ERR_INVALID_ASPECT_RATIO: return "Invalid aspect ratio. Valid aspect ratios must be greater than or equal to zero."; - case ERR_INVALID_AVI_SESSION: return "Invalid AVI session."; - case ERR_INVALID_AXIS_ORIENTATION: return "NI Vision does not support the axis orientation you supplied."; - case ERR_INVALID_BARCODETYPE: return "NI Vision does not support the BarcodeType value you supplied."; - case ERR_INVALID_BIT_DEPTH: return "NI Vision does not support the bit depth you supplied for the image you supplied."; - case ERR_INVALID_BORDER: return "Invalid image border."; - case ERR_INVALID_BORDERMETHOD: return "NI Vision does not support the BorderMethod value you supplied."; - case ERR_INVALID_BORDER_INTEGRITY: return "Invalid border integrity. Valid values range from 0 to 100."; - case ERR_INVALID_BORDER_SIZE: return "Invalid border size. Acceptable values range from 0 to 50."; - case ERR_INVALID_BROWSER_IMAGE: return "Invalid browser image."; - case ERR_INVALID_BUTTON_LABEL: return "Invalid button label."; - case ERR_INVALID_CALIBRATION_METHOD: return "Invalid calibration method requested"; - case ERR_INVALID_CALIBRATION_MODE: return "NI Vision does not support the calibration mode you supplied."; - case ERR_INVALID_CALIBRATION_ROI_MODE: return "NI Vision does not support the calibration ROI mode you supplied."; - case ERR_INVALID_CALIBRATION_UNIT: return "NI Vision does not support the calibration unit you supplied."; - case ERR_INVALID_CELL_FILL_TYPE: return "Invalid cell fill type."; - case ERR_INVALID_CELL_FILTER_MODE: return "Invalid cell filter mode."; - case ERR_INVALID_CELL_SAMPLE_SIZE: return "Invalid cell sample size."; - case ERR_INVALID_CLASSIFIER_SESSION: return "Not a valid classifier session."; - case ERR_INVALID_CLASSIFIER_TYPE: return "You requested an invalid classifier type."; - case ERR_INVALID_COLORSENSITIVITY: return "NI Vision does not support the ColorSensitivity value you supplied."; - case ERR_INVALID_COLOR_IGNORE_MODE: return "Invalid color ignore mode."; - case ERR_INVALID_COLOR_MODE: return "NI Vision does not support the color mode you specified."; - case ERR_INVALID_COLOR_RESOLUTION: return "Invalid Color Resolution for the Color Classifier"; - case ERR_INVALID_COLOR_SPECTRUM: return "The color spectrum array you provided has an invalid number of elements or contains an element set to not-a-number (NaN)."; - case ERR_INVALID_COLOR_WEIGHT: return "Invalid color weight. Acceptable values range from 0 to 1000."; - case ERR_INVALID_COLUMN_STEP: return "Invalid column step. Valid range is 1 to 255."; - case ERR_INVALID_COMPAREFUNCTION: return "NI Vision does not support the CompareFunction value you supplied."; - case ERR_INVALID_COMPLEXPLANE: return "NI Vision does not support the ComplexPlane value you supplied."; - case ERR_INVALID_COMPRESSION_RATIO: return "The compression ratio must be greater than or equal to 1."; - case ERR_INVALID_COMPRESSION_TYPE: return "Invalid compression type."; - case ERR_INVALID_CONCENTRIC_RAKE_DIRECTION: return "Invalid concentric rake direction."; - case ERR_INVALID_CONTRAST: return "Invalid contrast value. Valid contrast values range from 0 to 255."; - case ERR_INVALID_CONTRAST_REVERSAL_MODE: return "The contrast reversal mode specified during matching is invalid."; - case ERR_INVALID_CONTRAST_THRESHOLD: return "Invalid contrast threshold. The threshold value must be greater than 0."; - case ERR_INVALID_CONVERSIONSTYLE: return "NI Vision does not support the Conversion Method value you supplied."; - case ERR_INVALID_COOCCURRENCE_LEVEL: return "The coOccurrence Level must lie between 1 and the maximum pixel value of an image (255 for U8 image)"; - case ERR_INVALID_CURVE_EXTRACTION_MODE: return "Invalid curve extraction mode."; - case ERR_INVALID_CUSTOM_SAMPLE: return "The size of the feature vector in the custom sample must match the size of those you have already added."; - case ERR_INVALID_DEMODULATION_MODE: return "Invalid demodulation mode."; - case ERR_INVALID_DETECTION_MODE: return "Invalid detection mode."; - case ERR_INVALID_DISTANCE: return "Invalid Color Segmentation Distance"; - case ERR_INVALID_DISTANCE_LEVEL: return "Invalid Color Segmentation distance level"; - case ERR_INVALID_DISTANCE_METRIC: return "You requested an invalid distance metric."; - case ERR_INVALID_DISTORTION_MODEL: return "Invalid distortion model type"; - case ERR_INVALID_DRAWMODE: return "NI Vision does not support the DrawMode value you supplied."; - case ERR_INVALID_DRAWMODE_FOR_LINE: return "imaqDrawLineOnImage does not support the DrawMode value you supplied."; - case ERR_INVALID_ECC_TYPE: return "Invalid ECC type."; - case ERR_INVALID_EDGE_DIR: return "You supplied an invalid edge direction in the Canny operator."; - case ERR_INVALID_EDGE_FILTER_SIZE: return "Invalid edge filter size."; - case ERR_INVALID_EDGE_POLARITY_SEARCH_MODE: return "Invalid edge polarity search mode."; - case ERR_INVALID_EDGE_PROCESS: return "Invalid edge process."; - case ERR_INVALID_EDGE_THICKNESS: return "Edge Thickness to Ignore must be greater than zero."; - case ERR_INVALID_EDGE_THRESHOLD: return "Invalid edge threshold. Valid values range from 1 to 360."; - case ERR_INVALID_ENERGY: return "Minimum Energy should lie between 0 and 100"; - case ERR_INVALID_FEATURE_MODE: return "Invalid feature mode."; - case ERR_INVALID_FILL_STYLE: return "The fill style for the window background is invalid."; - case ERR_INVALID_FINAL_STEP_SIZE: return "The final step size must be lesser than the initial step size"; - case ERR_INVALID_FLIPAXIS: return "NI Vision does not support the axis of symmetry you supplied."; - case ERR_INVALID_FONTCOLOR: return "NI Vision does not support the FontColor value you supplied."; - case ERR_INVALID_FRAMES_PER_SECOND: return "The frames per second in an AVI must be greater than zero."; - case ERR_INVALID_FRAME_NUMBER: return "Invalid frame number."; - case ERR_INVALID_FUNCTION: return "Unsupported function."; - case ERR_INVALID_GAUSS_FILTER_TYPE: return "The specified Gaussian filter type is not supported."; - case ERR_INVALID_GAUSS_SIGMA_VALUE: return "The sigma value specified for the Gaussian filter is too small."; - case ERR_INVALID_GEOMETRIC_FEATURE_TYPE: return "The geometric feature type specified is invalid."; - case ERR_INVALID_GEOMETRIC_MATCHING_TEMPLATE: return "Invalid geometric matching template image."; - case ERR_INVALID_GRADING_MODE: return "Invalid grading mode."; - case ERR_INVALID_HATCH_STYLE: return "The hatch style for the window background is invalid."; - case ERR_INVALID_HORN_SCHUNCK_LAMBDA: return "Invalid smoothing parameter in Horn Schunck operation."; - case ERR_INVALID_HORN_SCHUNCK_TYPE: return "Invalid stopping criteria type for Horn Schunck optical flow."; - case ERR_INVALID_ICONS_PER_LINE: return "NI Vision does not support less than one icon per line."; - case ERR_INVALID_IDENTIFICATION_SCORE: return "Invalid Identification score. Must be between 0-1000."; - case ERR_INVALID_IMAGE_TYPE: return "Invalid image type."; - case ERR_INVALID_INITIAL_MATCH_LIST_LENGTH: return "Invalid initial match list length. Values must be integers greater than 5."; - case ERR_INVALID_INSPECTION_TEMPLATE: return "Invalid golden template."; - case ERR_INVALID_INTERPOLATIONMETHOD: return "NI Vision does not support the InterpolationMethod value you supplied."; - case ERR_INVALID_INTERPOLATIONMETHOD_FOR_ROTATE: return "imaqRotate does not support the InterpolationMethod value you supplied."; - case ERR_INVALID_INTERPOLATIONMETHOD_FOR_UNWRAP: return "UnwrapImage does not support the interpolation method value you supplied. Valid interpolation methods are zero order and bilinear."; - case ERR_INVALID_INTERPOLATIONMETHOD_INTERPOLATEPOINTS: return "imaqInterpolatePoints does not support the InterpolationMethod value you supplied."; - case ERR_INVALID_KERNEL_CODE: return "Invalid kernel code."; - case ERR_INVALID_KERNEL_SIZE: return "The Kernel size must be smaller than the image size."; - case ERR_INVALID_KERNEL_SIZE_FOR_EDGE_DETECTION: return "Invalid kernel size for edge detection. The minimum kernel size is 3, the maximum kernel size is 1073741823 and the kernel size must be odd."; - case ERR_INVALID_KNN_METHOD: return "You requested an invalid Nearest Neighbor classifier method."; - case ERR_INVALID_LEARN_GEOMETRIC_PATTERN_SETUP_DATA: return "Invalid learn geometric pattern setup data."; - case ERR_INVALID_LEARN_MODE: return "Invalid learn mode."; - case ERR_INVALID_LENGTH: return "The length of the edge detection line must be greater than zero."; - case ERR_INVALID_LIMITS: return "The limits you supplied are not valid."; - case ERR_INVALID_LINE: return "The line you provided contains two identical points, or one of the coordinate locations for the line is not a number (NaN)."; - case ERR_INVALID_LINEAR_AVERAGE_MODE: return "Invalid linear average mode."; - case ERR_INVALID_LINEGAUGEMETHOD: return "Invalid line gauge method."; - case ERR_INVALID_LKP_KERNEL: return "The kernel must be symmetric with non-zero coefficients and of odd size"; - case ERR_INVALID_LUCAS_KANADE_WINDOW_SIZE: return "Both dimensions of the window size should be odd, greater than 2 and less than 16."; - case ERR_INVALID_MATCHFACTOR: return "The function does not support the matchFactor that you specified."; - case ERR_INVALID_MATCH_CONSTRAINT_TYPE: return "You specified an invalid value for the match constraint value of the range settings."; - case ERR_INVALID_MATCH_GEOMETRIC_PATTERN_SETUP_DATA: return "Invalid match geometric pattern setup data."; - case ERR_INVALID_MATCH_MODE: return "Invalid match mode."; - case ERR_INVALID_MATHTRANSFORMMETHOD: return "NI Vision does not support the MathTransformMethod value you supplied."; - case ERR_INVALID_MATRIX_MIRROR_MODE: return "Invalid matrix mirror mode."; - case ERR_INVALID_MATRIX_POLARITY: return "Invalid matrix polarity."; - case ERR_INVALID_MATRIX_SIZE_RANGE: return "The maximum Data Matrix barcode size must be equal to or greater than the minimum Data Matrix barcode size."; - case ERR_INVALID_MATRIX_TYPE: return "The type of matrix supplied to the function is not supported."; - case ERR_INVALID_MAXIMUM_END_POINT_GAP: return "Invalid maximum end point gap. Valid values range from 0 to 32767."; - case ERR_INVALID_MAXIMUM_FEATURES_LEARNED: return "Invalid maximum number of features learn. Values must be integers greater than zero."; - case ERR_INVALID_MAXIMUM_FEATURES_PER_MATCH: return "Invalid maximum number of features used per match. Values must be integers greater than or equal to zero."; - case ERR_INVALID_MAXIMUM_PIXEL_DISTANCE_FROM_LINE: return "Invalid maximum pixel distance from line. Values must be positive real numbers."; - case ERR_INVALID_MAXPOINTS: return "The function does not support the maximum number of points that you specified."; - case ERR_INVALID_MAX_ITERATIONS: return "Invalid maximum number of iterations. Maximum number of iterations must be greater than zero."; - case ERR_INVALID_MAX_MATCH_OVERLAP: return "Invalid max match overlap. Values must be between -1 and 100."; - case ERR_INVALID_MAX_WAVELET_TRANSFORM_LEVEL: return "Invalid maximum wavelet transform level. Valid values range from 0 to 255."; - case ERR_INVALID_MEASURE_PARTICLES_CALIBRATION_MODE: return "Invalid measure particles calibration mode."; - case ERR_INVALID_METAFILE_HANDLE: return "Invalid metafile handle."; - case ERR_INVALID_METERARCMODE: return "NI Vision does not support the MeterArcMode value you supplied."; - case ERR_INVALID_MINIMUM_CURVE_LENGTH: return "Invalid minimum length. Valid values must be greater than or equal to zero."; - case ERR_INVALID_MINIMUM_FEATURES_TO_MATCH: return "Invalid minimum number of features used for matching. Values must be integers greater than zero."; - case ERR_INVALID_MINIMUM_FEATURE_ASPECT_RATIO: return "Invalid aspect ratio for rectangular features. Values must be positive real numbers in the range 0.01 to 1.0."; - case ERR_INVALID_MINIMUM_FEATURE_LENGTH: return "Invalid minimum length for linear features. Values must be integers greater than 0."; - case ERR_INVALID_MINIMUM_FEATURE_RADIUS: return "Invalid minimum radius for circular features. Values must be integers greater than 0."; - case ERR_INVALID_MINIMUM_FEATURE_STRENGTH: return "Invalid minimum strength for features. Values must be positive real numbers."; - case ERR_INVALID_MINIMUM_RECTANGLE_DIMENSION: return "Invalid minimum rectangle dimension. Values must be integers greater than 0."; - case ERR_INVALID_MIN_COVERAGE_FOR_STRAIGHT_EDGE: return "Minimum coverage value should be greater than zero."; - case ERR_INVALID_MIN_MATCH_SCORE: return "Invalid minimum match score. Acceptable values range from 0 to 1000."; - case ERR_INVALID_MIN_MATCH_SEPARATION_ANGLE: return "Invalid minimum match separation angle. Values must be between -1 and 360."; - case ERR_INVALID_MIN_MATCH_SEPARATION_DISTANCE: return "Invalid minimum match separation distance. Values must be greater than or equal to -1."; - case ERR_INVALID_MIN_MATCH_SEPARATION_SCALE: return "Invalid minimum match separation scale. Values must be greater than or equal to -1."; - case ERR_INVALID_MORPHOLOGICAL_OPERATION: return "Invalid Morphological Operation."; - case ERR_INVALID_MORPHOLOGYMETHOD: return "NI Vision does not support the MorphologyMethod value you supplied."; - case ERR_INVALID_MULTIPLE_GEOMETRIC_TEMPLATE: return "Invalid multiple geometric template."; - case ERR_INVALID_NIBLACK_DEVIATION_FACTOR: return "The deviation factor for Niblack local threshold must be between 0 and 1."; - case ERR_INVALID_NORMALIZATION_METHOD: return "You must provide a valid normalization method."; - case ERR_INVALID_NUMBER_OF_FEATURES_RANGE: return "The minimum number of features must be less than or equal to the maximum number of features."; - case ERR_INVALID_NUMBER_OF_LABELS: return "You supplied an invalid number of labels."; - case ERR_INVALID_NUMBER_OF_MATCH_OPTIONS: return "You supplied an invalid number of match options."; - case ERR_INVALID_NUM_MATCHES_REQUESTED: return "Invalid number of matches requested. You must request a minimum of one match."; - case ERR_INVALID_NUM_OF_CLASSES: return "Invalid number of classes for auto threshold. Acceptable values range from 2 to 256."; - case ERR_INVALID_OCCLUSION_RANGE: return "Invalid occlusion range. Valid values for the bounds range from 0 to 100 and the upper bound must be greater than or equal to the lower bound."; - case ERR_INVALID_OFFSET: return "The offset you specified must be size 2."; - case ERR_INVALID_OPERATION_ON_COMPACT_CALIBRATION_ATTEMPTED: return "This calibration is compact. Re-Learning calibration and retrieving thumbnails are not possible with this calibration"; - case ERR_INVALID_OPERATION_ON_COMPACT_SESSION_ATTEMPTED: return "This classifier session is compact. Only the Classify and Dispose functions may be called on a compact classifier session."; - case ERR_INVALID_OPTICAL_FLOW_TERMINATION_CRITERIA_TYPE: return "An invalid termination criteria was specified for the optical flow computation."; - case ERR_INVALID_OUTLINEMETHOD: return "NI Vision does not support the OutlineMethod value you supplied."; - case ERR_INVALID_PALETTE_TYPE: return "NI Vision does not support the PaletteType value you supplied."; - case ERR_INVALID_PARTICLEINFOMODE: return "NI Vision does not support the ParticleInfoMode value you supplied."; - case ERR_INVALID_PARTICLE_AREA: return "Invalid Color Segmenation Particle Area"; - case ERR_INVALID_PARTICLE_CLASSIFIER_THRESHOLD_TYPE: return "Invalid particle classifier threshold type."; - case ERR_INVALID_PARTICLE_INFO: return "The image has invalid particle information. Call imaqCountParticles on the image to create particle information."; - case ERR_INVALID_PARTICLE_NUMBER: return "Invalid particle number."; - case ERR_INVALID_PARTICLE_OPTIONS: return "The sum of Scale Dependence and Symmetry Dependence must be less than 1000."; - case ERR_INVALID_PARTICLE_PARAMETER_VALUE: return "You entered an invalid selection in the particle parameter."; - case ERR_INVALID_PARTICLE_TYPE: return "You requested an invalid particle type."; - case ERR_INVALID_POINTSYMBOL: return "Invalid point symbol."; - case ERR_INVALID_POLYNOMIAL_MODEL_K_COUNT: return "Invalid number of K values"; - case ERR_INVALID_PROCESS_TYPE_FOR_EDGE_DETECTION: return "Invalid process type for edge detection."; - case ERR_INVALID_PYRAMID_LEVEL: return "The pyramid level specified cannot be negative"; - case ERR_INVALID_QUALITY: return "The quality you provided is invalid. Valid quality values range from -1 to 1000."; - case ERR_INVALID_QUANTIZATION_STEP_SIZE: return "The quantization step size must be greater than or equal to 0."; - case ERR_INVALID_RAKE_DIRECTION: return "Invalid rake direction."; - case ERR_INVALID_RANGE: return "The range you supplied is invalid."; - case ERR_INVALID_RECT: return "NI Vision does not support rectangles with negative widths or negative heights."; - case ERR_INVALID_REFERENCEMODE: return "NI Vision does not support the ReferenceMode value you supplied."; - case ERR_INVALID_REGISTRATION_METHOD: return "You provided an invalid registration method."; - case ERR_INVALID_ROTATION_MODE: return "Invalid rotation mode."; - case ERR_INVALID_ROTATION_RANGE: return "Invalid roation angle range. The upper bound must be greater than or equal to the lower bound."; - case ERR_INVALID_ROUNDING_MODE: return "NI Vision does not support the RoundingMode value you supplied."; - case ERR_INVALID_ROW_STEP: return "Invalid row step. Valid range is 1 to 255."; - case ERR_INVALID_SCALE: return "Scale must be greater than zero."; - case ERR_INVALID_SCALE_RANGE: return "Invalid scale range. Values for the lower bound must be a positive real numbers and the upper bound must be greater than or equal to the lower bound."; - case ERR_INVALID_SCALINGMODE: return "NI Vision does not support the ScalingMode value you supplied."; - case ERR_INVALID_SCALING_METHOD: return "NI Vision does not support the scaling method you provided."; - case ERR_INVALID_SCAN_DIRECTION: return "Invalid scan direction."; - case ERR_INVALID_SEARCH_MODE_FOR_STRAIGHT_EDGE: return "Invalid search mode for detecting straight edges"; - case ERR_INVALID_SEARCH_STRATEGY: return "Invalid search strategy."; - case ERR_INVALID_SEARCH_VECTOR_WIDTH: return "Invalid search vector width. The width must be an odd number greater than zero."; - case ERR_INVALID_SHAPEMODE: return "NI Vision does not support the ShapeMode value you supplied."; - case ERR_INVALID_SHAPE_DESCRIPTOR: return "The passed shape descriptor is invalid."; - case ERR_INVALID_SIZETYPE: return "NI Vision does not support the SizeType value you supplied."; - case ERR_INVALID_SKELETONMETHOD: return "NI Vision does not support the SkeletonMethod value you supplied."; - case ERR_INVALID_SKELETONMODE: return "The Skeleton mode you specified is invalid."; - case ERR_INVALID_SPOKE_DIRECTION: return "Invalid spoke direction."; - case ERR_INVALID_STEEPNESS: return "Invalid steepness."; - case ERR_INVALID_STEP_SIZE: return "Step size must be greater than zero and less than Image size"; - case ERR_INVALID_STEREO_BLOCKMATCHING_FILTERTYPE: return "You have specified an invalid filter type for block matching."; - case ERR_INVALID_STEREO_BLOCKMATCHING_NUMDISPARITIES: return "The specifed value for number of disparities is invalid."; - case ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_CAP: return "The specified value for the filter cap for block matching is invalid."; - case ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_SIZE: return "The specified prefilter size for block matching is invalid."; - case ERR_INVALID_STEREO_BLOCKMATCHING_PREFILTER_TYPE: return "The specified prefilter type for block matching is invalid."; - case ERR_INVALID_STEREO_BLOCKMATCHING_WINDOW_SIZE: return "The specified window size for block matching is invalid."; - case ERR_INVALID_STEREO_CAMERA_POSITION: return "You have requested results at an invalid camera position in the stereo setup."; - case ERR_INVALID_SUBPIXEL_DIVISIONS: return "Invalid subpixel divisions."; - case ERR_INVALID_SUBPIXEL_ITERATIONS: return "Invalid number of subpixel iterations. Values must be integers greater 10."; - case ERR_INVALID_SUBPIXEL_TOLERANCE: return "Invalid subpixel tolerance. Values must be positive real numbers."; - case ERR_INVALID_SUBPIX_TYPE: return "NI Vision does not support the interpolation type you supplied."; - case ERR_INVALID_SUBSAMPLING_RATIO: return "Invalid subsampling ratio."; - case ERR_INVALID_SVM_KERNEL: return "Invalid SVM kernel type"; - case ERR_INVALID_SVM_PARAMETER: return "Invalid SVM Parameter"; - case ERR_INVALID_SVM_TYPE: return "Invalid SVM model type"; - case ERR_INVALID_TETRAGON: return "The input tetragon must have four points. The points are specified clockwise starting with the top left point."; - case ERR_INVALID_TEXTALIGNMENT: return "NI Vision does not support the TextAlignment value you supplied."; - case ERR_INVALID_TEXTORIENTATION: return "NI Vision does not support the text orientation value you supplied."; - case ERR_INVALID_TEXTURE_FEATURE: return "Requested for invalid texture feature"; - case ERR_INVALID_TEXTURE_LABEL: return "The classification label must be texture or defect for texture defect classifier"; - case ERR_INVALID_THRESHOLDMETHOD: return "NI Vision does not support the threshold method value you supplied."; - case ERR_INVALID_THRESHOLD_PERCENTAGE: return "Invalid threshold percentage. Valid values range from 0 to 100."; - case ERR_INVALID_THUMBNAIL_INDEX: return "Supplied thumbnail index is invalid"; - case ERR_INVALID_TOLERANCE: return "The tolerance parameter must be greater than or equal to 0."; - case ERR_INVALID_TOOL: return "NI Vision does not support the Tool value you supplied."; - case ERR_INVALID_TYPE_OF_FLATTEN: return "Invalid type of flatten."; - case ERR_INVALID_USE_OF_COMPACT_SESSION_FILE: return "You can not use a compact classification file with read options other than Read All."; - case ERR_INVALID_VERTICAL_TEXT_ALIGNMENT: return "NI Vision does not support the VerticalTextAlignment value you supplied."; - case ERR_INVALID_VIDEO_BLIT: return "RT Video Out does not support displaying the supplied image type at the selected color depth."; - case ERR_INVALID_VIDEO_MODE: return "Invalid video mode."; - case ERR_INVALID_VISION_INFO: return "NI Vision does not support the vision information type you supplied."; - case ERR_INVALID_WAVELET_SUBBAND: return "Request for invalid wavelet subBand"; - case ERR_INVALID_WAVELET_TRANSFORM_MODE: return "Invalid wavelet transform mode."; - case ERR_INVALID_WAVELET_TYPE: return "The wavelet type is invalid"; - case ERR_INVALID_WIDTH: return "Invalid pixel width."; - case ERR_INVALID_WINDOW_SIZE: return "The size of each dimension of the window must be greater than 2 and less than or equal to the size of the image in the corresponding dimension."; - case ERR_INVALID_WINDOW_THREAD_POLICY: return "NI Vision does not support the WindowThreadPolicy value you supplied."; - case ERR_IO_ERROR: return "I/O error."; - case ERR_JPEG2000_LOSSLESS_WITH_FLOATING_POINT: return "Lossless compression cannot be used with the floating point wavelet transform mode. Either set the wavelet transform mode to integer, or use lossy compression."; - case ERR_JPEG2000_UNSUPPORTED_MULTIPLE_LAYERS: return "NI Vision does not support reading JPEG2000 files with more than one layer."; - case ERR_K_TOO_HIGH: return "The k parameter must be <= the number of samples in each class."; - case ERR_K_TOO_LOW: return "The k parameter must be greater than two."; - case ERR_LABEL_NOT_FOUND: return "Cannot find a label that matches the one you specified."; - case ERR_LABEL_TOO_LONG: return "Labels must be <= 255 characters."; - case ERR_LAB_VERSION: return "The version of LabVIEW or BridgeVIEW you are running does not support this operation."; - case ERR_LCD_BAD_MATCH: return "The LCD does not form a known digit."; - case ERR_LCD_CALIBRATE: return "The input image does not seem to be a valid LCD or LED calibration image."; - case ERR_LCD_NOT_NUMERIC: return "LCD image is not a number."; - case ERR_LCD_NO_SEGMENTS: return "No lit segment."; - case ERR_LEARN_SETUP_DATA: return "Invalid learn setup data."; - case ERR_LINEAR_COEFF: return "The linear equations are not independent."; - case ERR_LINES_PARALLEL: return "You specified parallel lines for the meter ROI."; - case ERR_LKP_NULL_PYRAMID: return "The pyramid levels where not properly allocated."; - case ERR_MARKER_INFORMATION_NOT_SUPPLIED: return "Marker image and points are not supplied"; - case ERR_MASK_NOT_TEMPLATE_SIZE: return "The mask must be the same size as the template."; - case ERR_MASK_OUTSIDE_IMAGE: return "When the mask's offset was applied, the mask was entirely outside of the image."; - case ERR_MATCHFACTOR_OBSOLETE: return "matchFactor has been obsoleted. Instead, set the initialMatchListLength and matchListReductionFactor in the MatchPatternAdvancedOptions structure."; - case ERR_MATCH_SETUP_DATA: return "Invalid match setup data."; - case ERR_MATRIX_SIZE: return "Invalid matrix size in the structuring element."; - case ERR_MEMORY_ERROR: return "Memory error."; - case ERR_MULTICORE_INVALID_ARGUMENT: return "You have given Multicore Options an invalid argument."; - case ERR_MULTICORE_OPERATION: return "The operation you have given Multicore Options is invalid. Please see the available enumeration values for Multicore Operation."; - case ERR_NEED_FULL_VERSION: return "The function requires an NI Vision 5.0 Advanced license."; - case ERR_NIOCR_BOOLEAN_VALUE_FOR_INTEGER_ATTRIBUTE: return "Boolean values are not valid for this attribute. Enter an integer value."; - case ERR_NIOCR_BOOLEAN_VALUE_FOR_STRING_ATTRIBUTE: return "String values are not valid for this attribute. Enter a Boolean value."; - case ERR_NIOCR_CHARACTER_SET_DESCRIPTION_TOO_LONG: return "The character set description must be <=255 characters."; - case ERR_NIOCR_CHARACTER_VALUE_CANNOT_BE_EMPTYSTRING: return "The character value must not be an empty string."; - case ERR_NIOCR_CHARACTER_VALUE_TOO_LONG: return "Character values must be <=255 characters."; - case ERR_NIOCR_GET_ONLY_ATTRIBUTE: return "This attribute is read-only."; - case ERR_NIOCR_INTEGER_VALUE_FOR_BOOLEAN_ATTRIBUTE: return "This attribute requires a Boolean value."; - case ERR_NIOCR_INTEGER_VALUE_FOR_STRING_ATTRIBUTE: return "You must specify characters for a string. A string cannot contain integers."; - case ERR_NIOCR_INVALID_ACCEPTANCE_LEVEL: return "The acceptance level is outside the valid range of 0 to 1000."; - case ERR_NIOCR_INVALID_ASPECT_RATIO: return "Invalid aspect ratio value. The aspect ratio must be zero or >= 100."; - case ERR_NIOCR_INVALID_ATTRIBUTE: return "Invalid attribute."; - case ERR_NIOCR_INVALID_BOUNDING_RECT_HEIGHT_RANGE: return "The minimum character bounding rectangle height must be less than the maximum character bounding rectangle height."; - case ERR_NIOCR_INVALID_BOUNDING_RECT_WIDTH_RANGE: return "The minimum character bounding rectangle width must be less than the maximum character bounding rectangle width."; - case ERR_NIOCR_INVALID_CHARACTER_INDEX: return "Invalid character index."; - case ERR_NIOCR_INVALID_CHARACTER_SET_FILE: return "Invalid or corrupt character set file."; - case ERR_NIOCR_INVALID_CHARACTER_SET_FILE_VERSION: return "The character set file was created by a newer version of NI Vision. Upgrade to the latest version of NI Vision to read the character set file."; - case ERR_NIOCR_INVALID_CHARACTER_SIZE: return "Invalid character size. Character size must be >= 1."; - case ERR_NIOCR_INVALID_CHARACTER_SIZE_RANGE: return "The minimum character size must be less than the maximum character size."; - case ERR_NIOCR_INVALID_CHARACTER_VALUE: return "A character cannot have an ASCII value of 255."; - case ERR_NIOCR_INVALID_HIGH_THRESHOLD_VALUE: return "Invalid high threshold value. Valid threshold values range from 0 to 255."; - case ERR_NIOCR_INVALID_LOWER_THRESHOLD_LIMIT: return "Invalid lower threshold limit. Valid lower threshold limits range from 0 to 255."; - case ERR_NIOCR_INVALID_LOW_THRESHOLD_VALUE: return "Invalid low threshold value. Valid threshold values range from 0 to 255."; - case ERR_NIOCR_INVALID_MAX_HORIZ_ELEMENT_SPACING: return "Invalid maximum horizontal element spacing value. Maximum horizontal element spacing must be >= 0."; - case ERR_NIOCR_INVALID_MAX_VERT_ELEMENT_SPACING: return "Invalid maximum vertical element spacing value. Maximum vertical element spacing must be >= 0."; - case ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_HEIGHT: return "Invalid minimum bounding rectangle height. The minimum bounding rectangle height must be >= 1."; - case ERR_NIOCR_INVALID_MIN_BOUNDING_RECT_WIDTH: return "Invalid minimum bounding rectangle width. Minimum bounding rectangle width must be >= 1."; - case ERR_NIOCR_INVALID_MIN_CHAR_SPACING: return "Invalid minimum character spacing value. Character spacing must be >= 1 pixel."; - case ERR_NIOCR_INVALID_NUMBER_OF_BLOCKS: return "Invalid number of blocks. Number of blocks must be >= 4 and <= 50."; - case ERR_NIOCR_INVALID_NUMBER_OF_CHARACTERS: return "The number of characters in the character value must match the number of objects in the image."; - case ERR_NIOCR_INVALID_NUMBER_OF_EROSIONS: return "Invalid number of erosions. The number of erosions must be >= 0."; - case ERR_NIOCR_INVALID_NUMBER_OF_OBJECTS_TO_VERIFY: return "The number of objects found does not match the number of expected characters or patterns to verify."; - case ERR_NIOCR_INVALID_NUMBER_OF_VALID_CHARACTER_POSITIONS: return "Invalid number of character positions. Valid values range from 0 to 255."; - case ERR_NIOCR_INVALID_OBJECT_INDEX: return "Invalid object index."; - case ERR_NIOCR_INVALID_PREDEFINED_CHARACTER: return "Invalid predefined character value."; - case ERR_NIOCR_INVALID_READ_OPTION: return "Invalid read option."; - case ERR_NIOCR_INVALID_READ_RESOLUTION: return "Invalid read resolution."; - case ERR_NIOCR_INVALID_READ_STRATEGY: return "Invalid read strategy."; - case ERR_NIOCR_INVALID_SPACING_RANGE: return "The maximum horizontal element spacing value must not exceed the minimum character spacing value."; - case ERR_NIOCR_INVALID_SUBSTITUTION_CHARACTER: return "Invalid substitution character. Valid substitution characters are ASCII values that range from 1 to 254."; - case ERR_NIOCR_INVALID_THRESHOLD_LIMITS: return "The lower threshold limit must be less than the upper threshold limit."; - case ERR_NIOCR_INVALID_THRESHOLD_MODE: return "Invalid threshold mode value."; - case ERR_NIOCR_INVALID_THRESHOLD_RANGE: return "The low threshold must be less than the high threshold."; - case ERR_NIOCR_INVALID_UPPER_THRESHOLD_LIMIT: return "Invalid upper threshold limit. Valid upper threshold limits range from 0 to 255."; - case ERR_NIOCR_MUST_BE_SINGLE_CHARACTER: return "Requires a single-character string."; - case ERR_NIOCR_NOT_A_VALID_CHARACTER_SET: return "Not a valid character set."; - case ERR_NIOCR_NOT_A_VALID_SESSION: return "Not a valid OCR session."; - case ERR_NIOCR_RENAME_REFCHAR: return "A trained OCR character cannot be renamed while it is a reference character."; - case ERR_NIOCR_STRING_VALUE_FOR_BOOLEAN_ATTRIBUTE: return "String values are invalid for this attribute. Enter a boolean value."; - case ERR_NIOCR_STRING_VALUE_FOR_INTEGER_ATTRIBUTE: return "This attribute requires integer values."; - case ERR_NIOCR_UNLICENSED: return "This copy of NI OCR is unlicensed."; - case ERR_NOT_AN_OBJECT: return "Not an object."; - case ERR_NOT_ENOUGH_REGIONS: return "You specified a viewer that does not contain enough regions."; - case ERR_NOT_ENOUGH_TEMPLATE_FEATURES: return "The template does not contain enough features for geometric matching."; - case ERR_NOT_ENOUGH_TEMPLATE_FEATURES_1: return "The template does not contain enough features for geometric matching."; - case ERR_NOT_IMAGE: return "Not an image."; - case ERR_NOT_RECT_OR_ROTATED_RECT: return "The ROI must only have either a single Rectangle contour or a single Rotated Rectangle contour."; - case ERR_NO_CLAMP_FOUND: return "No valid clamp was found with the current configuration"; - case ERR_NO_CLAMP_WITHIN_ANGLE_RANGE: return "Supplied angle range for clamp is insufficient"; - case ERR_NO_DEST_IMAGE: return "You must provide a destination image."; - case ERR_NO_LABEL: return "You must pass in a label."; - case ERR_NO_PARTICLE: return "The image yielded no particles."; - case ERR_NO_SAMPLES: return "This operation cannot be performed because you have not added any samples."; - case ERR_NO_SUPPORT_VECTOR_FOUND: return "No Support Vector is found at SVM training"; - case ERR_NO_TEMPLATE_TO_LEARN: return "Need at least one template to learn."; - case ERR_NO_VIDEO_DRIVER: return "No video driver is installed."; - case ERR_NULL_POINTER: return "Null pointer."; - case ERR_NUMBER_CLASS: return "Invalid number of classes."; - case ERR_NUMBER_LABEL_LIMIT_EXCEEDED: return "Number of Labels exceeded limit of label Image type"; - case ERR_NUMBER_OF_PALETTE_COLORS: return "The color palette must have exactly 0 or 256 entries."; - case ERR_OCR_ADD_WORD_FAILED: return "The supplied word could not be added to the user dictionary."; - case ERR_OCR_BAD_TEXT_TEMPLATE: return "The supplied text template contains nonstandard characters that cannot be generated by OCR."; - case ERR_OCR_BAD_USER_DICTIONARY: return "The provided filename is not valid user dictionary filename."; - case ERR_OCR_BIN_DIR_NOT_FOUND: return "The system could not locate the OCR binary directory required for OCR initialization."; - case ERR_OCR_CANNOT_MATCH_TEXT_TEMPLATE: return "At least one character in the text template was of a lexical class that did not match the supplied character reports."; - case ERR_OCR_CHAR_REPORT_CORRUPTED: return "One of the character reports is no longer usable by the system."; - case ERR_OCR_CORRECTION_FAILED: return "The OCR engine failed during the correction stage."; - case ERR_OCR_INI_FILE_NOT_FOUND: return "The system could not locate the initialization file required for OCR initialization."; - case ERR_OCR_INVALID_AUTOCORRECTIONMODE: return "NI Vision does not support the AutoCorrectionMode value you supplied."; - case ERR_OCR_INVALID_AUTOORIENTMODE: return "NI Vision does not support the AutoOrientMode value you supplied."; - case ERR_OCR_INVALID_CHARACTERPREFERENCE: return "NI Vision does not support the CharacterPreference value you supplied."; - case ERR_OCR_INVALID_CHARACTERSET: return "NI Vision does not support the CharacterSet value you supplied."; - case ERR_OCR_INVALID_CHARACTERTYPE: return "NI Vision does not support the CharacterType value you supplied."; - case ERR_OCR_INVALID_CONTRASTMODE: return "NI Vision does not support the ContrastMode value you supplied."; - case ERR_OCR_INVALID_CORRECTIONLEVEL: return "NI Vision does not support the CorrectionLevel value you supplied."; - case ERR_OCR_INVALID_CORRECTIONMODE: return "NI Vision does not support the CorrectionMethod value you supplied."; - case ERR_OCR_INVALID_LANGUAGE: return "NI Vision does not support the Language value you supplied."; - case ERR_OCR_INVALID_MAXPOINTSIZE: return "NI Vision does not support the maximum point size you supplied. Valid values range from 4 to 72."; - case ERR_OCR_INVALID_OUTPUTDELIMITER: return "NI Vision does not support the OutputDelimiter value you supplied."; - case ERR_OCR_INVALID_PARAMETER: return "One of the parameters supplied to the OCR function that generated this error is invalid."; - case ERR_OCR_INVALID_RECOGNITIONMODE: return "NI Vision does not support the RecognitionMode value you supplied."; - case ERR_OCR_INVALID_TOLERANCE: return "NI Vision does not support the tolerance value you supplied. Valid values are non-negative."; - case ERR_OCR_LIB_INIT: return "The OCR library cannot be initialized correctly."; - case ERR_OCR_LOAD_LIBRARY: return "There was a failure when loading one of the internal OCR engine or LabView libraries."; - case ERR_OCR_NO_TEXT_FOUND: return "The OCR engine could not find any text in the supplied region."; - case ERR_OCR_ORIENT_DETECT_FAILED: return "The OCR attempted to detected the text orientation and failed."; - case ERR_OCR_PREPROCESSING_FAILED: return "The OCR engine failed during the preprocessing stage."; - case ERR_OCR_RECOGNITION_FAILED: return "The OCR engine failed during the recognition stage."; - case ERR_OCR_REGION_TOO_SMALL: return "The OCR region provided was too small to have contained any characters."; - case ERR_OCR_SKEW_DETECT_FAILED: return "The OCR attempted to detected the text skew and failed."; - case ERR_OCR_TEMPLATE_WRONG_SIZE: return "The size of the template string must match the size of the string you are trying to correct."; - case ERR_OCR_WTS_DIR_NOT_FOUND: return "The system could not locate the OCR weights directory required for OCR initialization."; - case ERR_OPENING_NEWER_3DVISION_SESSION: return "The 3D vision session you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OPENING_NEWER_AIM_GRADING_DATA: return "The AIM grading data attached to the image you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OPENING_NEWER_CLASSIFIER_SESSION: return "The classifier session you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OPENING_NEWER_GEOMETRIC_MATCHING_TEMPLATE: return "The geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OPENING_NEWER_INSPECTION_TEMPLATE: return "The golden template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OPENING_NEWER_MULTIPLE_GEOMETRIC_TEMPLATE: return "The multiple geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OUT_OF_MEMORY: return "Not enough memory for requested operation."; - case ERR_OVERLAY_EXTRAINFO_OPENING_NEW_VERSION: return "The overlay information you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case ERR_OVERLAY_GROUP_NOT_FOUND: return "Overlay Group Not Found."; - case ERR_PALETTE_NOT_SUPPORTED: return "Only 8-bit images support the use of palettes. Either do not use a palette, or convert your image to an 8-bit image before using a palette."; - case ERR_PARTICLE: return "Invalid particle."; - case ERR_POINTS_ARE_COLLINEAR: return "Do not supply collinear points for this operation."; - case ERR_PRECISION_NOT_GTR_THAN_0: return "The precision parameter must be greater than 0."; - case ERR_PROP_NODE_WRITE_NOT_SUPPORTED: return "The Image Display control does not support writing this property node."; - case ERR_PROTECTION: return "Protection error."; - case ERR_QR_DETECTION_MODE: return "The data stream that was demodulated could not be read because the mode was not detected."; - case ERR_QR_DETECTION_MODELTYPE: return "Couldn't determine the correct model of the QR code."; - case ERR_QR_DETECTION_VERSION: return "Couldn't determine the correct version of the QR code."; - case ERR_QR_INVALID_BARCODE: return "The barcode that was read contains invalid parameters."; - case ERR_QR_INVALID_READ: return "Invalid read of the QR code."; - case ERR_REQUIRES_WIN2000_OR_NEWER: return "The function requires the operating system to be Microsoft Windows 2000 or newer."; - case ERR_RESERVED_MUST_BE_NULL: return "You must pass NULL for the reserved parameter."; - case ERR_ROI_HAS_OPEN_CONTOURS: return "The ROI you passed in may only contain closed contours."; - case ERR_ROI_NOT_2_LINES: return "The ROI you passed into imaqGetMeterArc must consist of two lines."; - case ERR_ROI_NOT_ANNULUS: return "The ROI must only have a single Annulus contour."; - case ERR_ROI_NOT_LINE: return "The ROI must only have a single Line contour."; - case ERR_ROI_NOT_POINT: return "The ROI must only have a single Point contour."; - case ERR_ROI_NOT_POINTS: return "The ROI must only have Point contours."; - case ERR_ROI_NOT_POLYGON: return "ROI is not a polygon."; - case ERR_ROI_NOT_RECT: return "The ROI must only have a single Rectangle contour."; - case ERR_ROLLBACK_DELETE_TIMER: return "No initialized timed environment is available to close."; - case ERR_ROLLBACK_INIT_TIMER: return "The timed environment could not be initialized."; - case ERR_ROLLBACK_NOT_SUPPORTED: return "The function is not supported when a time limit is active."; - case ERR_ROLLBACK_RESIZE: return "The results of the operation exceeded the size limits on the output data arrays."; - case ERR_ROLLBACK_RESOURCE_CANNOT_UNLOCK: return "A resource conflict occurred in the timed environment. Two processes cannot manage the same resource and be time bounded."; - case ERR_ROLLBACK_RESOURCE_CONFLICT_1: return "An image created before a time limit is started cannot be resized while a time limit is active."; - case ERR_ROLLBACK_RESOURCE_CONFLICT_2: return "An image with pattern matching, calibration, or overlay information cannot be manipulated while a time limit is active."; - case ERR_ROLLBACK_RESOURCE_CONFLICT_3: return "An image being modified by one process cannot be requested by another process while a time limit is active."; - case ERR_ROLLBACK_RESOURCE_ENABLED: return "Multiple timed environments are not supported."; - case ERR_ROLLBACK_RESOURCE_LOCKED: return "A resource conflict occurred in the timed environment. Two processes cannot access the same resource and be time bounded."; - case ERR_ROLLBACK_RESOURCE_NON_EMPTY_INITIALIZE: return "Multiple timed environments are not supported."; - case ERR_ROLLBACK_RESOURCE_OUT_OF_MEMORY: return "Not enough reserved memory in the timed environment for the requested operation."; - case ERR_ROLLBACK_RESOURCE_REINITIALIZE: return "The timed environment is already initialized."; - case ERR_ROLLBACK_RESOURCE_UNINITIALIZED_ENABLE: return "A time limit cannot be started until the timed environment is initialized."; - case ERR_ROLLBACK_START_TIMER: return "A time limit could not be set."; - case ERR_ROLLBACK_STOP_TIMER: return "No time limit is available to stop."; - case ERR_ROLLBACK_TIMEOUT: return "The time limit has expired."; - case ERR_ROLLBACK_UNBOUNDED_INTERFACE: return "During timed execution, you must use the preallocated version of this operation."; - case ERR_ROTATION_ANGLE_RANGE_TOO_LARGE: return "At least one range in the array of rotation angle ranges exceeds 360 degrees."; - case ERR_RPC_BIND: return "Unable to establish network connection."; - case ERR_RPC_EXECUTE: return "Unable to display remote image on network connection."; - case ERR_RPC_EXECUTE_IVB: return "Unable to establish network connection with remote system."; - case ERR_SAME_WAVELET_BANDS_SELECTED: return "Same Wavelet band is selected multiple times"; - case ERR_SATURATION_THRESHOLD_OUT_OF_RANGE: return "The value of the saturation threshold must be from 0 to 255."; - case ERR_SHAPEMATCH_BADIMAGEDATA: return "Shape Match requires the image to contain only pixel values of 0 or 1."; - case ERR_SHAPEMATCH_BADTEMPLATE: return "The template you supplied for ShapeMatch contains no shape information."; - case ERR_SMOOTH_CONTOURS_MUST_BE_SAME: return "You must specify the same value for the smooth contours advanced match option for all templates you want to match."; - case ERR_SUCCESS: return "No error."; - case ERR_SYSTEM_ERROR: return "System error."; - case ERR_TEMPLATEDESCRIPTOR_LEARNSETUPDATA: return "Invalid template descriptor."; - case ERR_TEMPLATEDESCRIPTOR_ROTATION_SEARCHSTRATEGY: return "The template descriptor does not contain data required for the requested search strategy in rotation-invariant matching."; - case ERR_TEMPLATEIMAGE_EDGEINFO: return "The template image does not contain enough edge information for the sample size(s) requested."; - case ERR_TEMPLATEIMAGE_NOCIRCLE: return "The template image does not contain enough information for learning the aggressive search strategy."; - case ERR_TEMPLATE_DESCRIPTOR: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_1: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_2: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_3: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_4: return "The template descriptor was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this template."; - case ERR_TEMPLATE_DESCRIPTOR_NOROTATION: return "The template descriptor does not contain data required for rotation-invariant matching."; - case ERR_TEMPLATE_DESCRIPTOR_NOSCALE: return "The template descriptor does not contain data required for scale-invariant matching."; - case ERR_TEMPLATE_DESCRIPTOR_NOSHIFT: return "The template descriptor does not contain data required for shift-invariant matching."; - case ERR_TEMPLATE_DESCRIPTOR_ROTATION: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_ROTATION_1: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_SHIFT: return "Invalid template descriptor."; - case ERR_TEMPLATE_DESCRIPTOR_SHIFT_1: return "Invalid template descriptor."; - case ERR_TEMPLATE_EMPTY: return "The template image is empty."; - case ERR_TEMPLATE_IMAGE_CONTRAST_TOO_LOW: return "The template image does not contain enough contrast."; - case ERR_TEMPLATE_IMAGE_TOO_LARGE: return "The template image is too large."; - case ERR_TEMPLATE_IMAGE_TOO_SMALL: return "The template image is too small."; - case ERR_TEMPLATE_NOT_LEARNED: return "You supplied a template that was not learned."; - case ERR_THREAD_COULD_NOT_INITIALIZE: return "Could not execute the function in the separate thread because the thread could not initialize."; - case ERR_THREAD_INITIALIZING: return "Could not execute the function in the separate thread because the thread has not completed initialization."; - case ERR_TIMEOUT: return "Trigger timeout."; - case ERR_TIME_BOUNDED_EXECUTION_NOT_SUPPORTED: return "NI Vision no longer supports time-bounded execution."; - case ERR_TOO_MANY_3DVISION_SESSIONS: return "There are too many 3D vision sessions open. You must close a session before you can open another one."; - case ERR_TOO_MANY_AVI_SESSIONS: return "There are too many AVI sessions open. You must close a session before you can open another one."; - case ERR_TOO_MANY_CLASSIFICATION_SESSIONS: return "There are too many classification sessions open. You must close a session before you can open another one."; - case ERR_TOO_MANY_CONTOURS: return "The ROI contains too many contours."; - case ERR_TOO_MANY_CURVES: return "Too many curves extracted from image. Raise the edge threshold or reduce the ROI."; - case ERR_TOO_MANY_OCCLUSION_RANGES: return "You can specify only one occlusion range."; - case ERR_TOO_MANY_OCR_SESSIONS: return "There are too many OCR sessions open. You must close a session before you can open another one."; - case ERR_TOO_MANY_PARTICLES: return "The image has too many particles for this process."; - case ERR_TOO_MANY_ROTATION_ANGLE_RANGES: return "The array of rotation angle ranges contains too many ranges."; - case ERR_TOO_MANY_SCALE_RANGES: return "You can specify only one scale range."; - case ERR_TOO_MANY_ZONES: return "The number of zones found exceeded the capacity of the algorithm."; - case ERR_TRIG_TIMEOUT: return "Trigger timeout."; - case ERR_UNDEF_POINT: return "You specified a point that lies outside the image."; - case ERR_UNINIT: return "NI Vision did not initialize properly."; - case ERR_UNKNOWN_ALGORITHM: return "You specified the dispatch status of an unknown algorithm."; - case ERR_UNREGISTERED: return "Unlicensed copy of NI Vision."; - case ERR_UNSUPPORTED_2D_BARCODE_SEARCH_MODE: return "NI Vision does not support the search mode you provided for the type of 2D barcode for which you are searching."; - case ERR_UNSUPPORTED_COLOR_MODE: return "This function does not currently support the color mode you specified."; - case ERR_UNSUPPORTED_JPEG2000_COLORSPACE_METHOD: return "NI Vision does not support reading JPEG2000 files with this colorspace method."; - case ERR_VALUE_NOT_IN_ENUM: return "Value not in enumeration."; - case ERR_WINDOW_ID: return "Invalid window ID."; - case ERR_WRITE_FILE_NOT_SUPPORTED: return "Writing files is not supported on this device."; - case ERR_WRONG_REGION_TYPE: return "You selected a region that is not of the right type."; - case IMAQdxErrorAsyncRead: return "Unable to perform asychronous register read."; - case IMAQdxErrorAsyncWrite: return "Unable to perform asychronous register write."; - case IMAQdxErrorAttributeNotReadable: return "Unable to get attribute."; - case IMAQdxErrorAttributeNotSettable: return "Unable to set attribute."; - case IMAQdxErrorAttributeNotSupported: return "Attribute not supported by the camera."; - case IMAQdxErrorAttributeOutOfRange: return "Attribute value is out of range."; - case IMAQdxErrorBayerPixelFormatNotSelected: return "This operation requires that the camera has a Bayer pixel format selected."; - case IMAQdxErrorBufferHasLostPackets: return "The requested buffer has lost packets and the user requested an error to be generated."; - case IMAQdxErrorBufferIncompleteData: return "The requested buffer has incomplete data and the user requested an error to be generated."; - case IMAQdxErrorBufferListEmpty: return "Buffer list is empty. Add one or more buffers."; - case IMAQdxErrorBufferListLocked: return "Buffer list is already locked. Reconfigure acquisition and try again."; - case IMAQdxErrorBufferListNotLocked: return "No buffer list. Reconfigure acquisition and try again."; - case IMAQdxErrorBufferNotAvailable: return "Requested buffer is unavailable."; - case IMAQdxErrorBusReset: return "Bus reset occurred during a transaction."; - case IMAQdxErrorCameraAcquisitionConfigFailed: return "The camera returned an error starting the acquisition."; - case IMAQdxErrorCameraClosePending: return "The camera still has outstanding references and will be closed when these operations complete."; - case IMAQdxErrorCameraConfigurationHasChanged: return "The camera did not return an image of the correct type it was configured for previously."; - case IMAQdxErrorCameraInUse: return "Camera is already in use."; - case IMAQdxErrorCameraInvalidAuthentication: return "The camera is configured with password authentication and either the user name and password were not configured or they are incorrect."; - case IMAQdxErrorCameraMulticastNotAvailable: return "Unable to configure the system for multicast support."; - case IMAQdxErrorCameraNotConfiguredForListener: return "The camera is not configured properly to support a listener."; - case IMAQdxErrorCameraNotFound: return "Camera not found"; - case IMAQdxErrorCameraNotInitialized: return "Camera is not initialized."; - case IMAQdxErrorCameraNotRunning: return "No acquisition in progress."; - case IMAQdxErrorCameraPropertyInvalid: return "The value for an invalid camera property was requested."; - case IMAQdxErrorCameraRemoved: return "Camera has been removed."; - case IMAQdxErrorCameraRunning: return "Acquisition in progress."; - case IMAQdxErrorCameraUnreachable: return "Unable to connect to the camera."; - case IMAQdxErrorCorruptedImageReceived: return "The camera returned a corrupted image."; - case IMAQdxErrorDLLNotFound: return "The DLL could not be found."; - case IMAQdxErrorFileAccess: return "Unable to read/write to file."; - case IMAQdxErrorFirmwareUpdateNeeded: return "The acquisition hardware needs a firmware update before it can be used."; - case IMAQdxErrorFirmwareUpdateRebootNeeded: return "The firmware on the acquisition hardware has been updated and the system must be rebooted before use."; - case IMAQdxErrorFormat7Parameters: return "For format 7: The combination of speed, image position, image size, and color coding is incorrect."; - case IMAQdxErrorFunctionNotFound: return "The function could not be found."; - case IMAQdxErrorGenICamError: return "Unknown Genicam error."; - case IMAQdxErrorGiGEVisionError: return "Unknown GiGE Vision error."; - case IMAQdxErrorGuard: return "None"; - case IMAQdxErrorHighPerformanceNotSupported: return "High performance acquisition is not supported on the specified network interface. Connect the camera to a network interface running the high performance driver."; - case IMAQdxErrorInterfaceNotRenamed: return "Unable to rename interface. Invalid or duplicate name specified."; - case IMAQdxErrorInternal: return "Internal error"; - case IMAQdxErrorInvalidAddress: return "Invalid address"; - case IMAQdxErrorInvalidAttributeType: return "The attribute type is not compatible with the passed variable type."; - case IMAQdxErrorInvalidCameraFile: return "Invalid camera file."; - case IMAQdxErrorInvalidCameraURLString: return "Camera has malformed URL string."; - case IMAQdxErrorInvalidDeviceType: return "Invalid device type"; - case IMAQdxErrorInvalidInterface: return "Invalid camera session"; - case IMAQdxErrorInvalidParameter: return "Invalid parameter"; - case IMAQdxErrorInvalidPointer: return "Invalid pointer"; - case IMAQdxErrorInvalidRegistryKey: return "Invalid registry key"; - case IMAQdxErrorInvalidU3VUSBDescriptor: return "The camera has a USB descriptor that is incompatible with the USB3 Vision specification."; - case IMAQdxErrorInvalidXML: return "Unable to load camera's XML file."; - case IMAQdxErrorJumboFramesNotEnabled: return "Jumbo frames are not enabled on the host. Maximum packet size is 1500 bytes."; - case IMAQdxErrorKernelDriverUnavailable: return "Unable to attach to the kernel mode driver."; - case IMAQdxErrorLicenseNotActivated: return "License not activated."; - case IMAQdxErrorLightingCurrentOutOfRange: return "The requested current level from the lighting controller is not possible."; - case IMAQdxErrorNetworkError: return "Unknown network error."; - case IMAQdxErrorNoSupportedVideoModes: return "The camera does not have any video modes which are supported."; - case IMAQdxErrorNotImplemented: return "Not implemented"; - case IMAQdxErrorPixelFormatDecoderUnavailable: return "No decoder available for selected pixel format."; - case IMAQdxErrorResourcesAllocated: return "Transfer engine resources already allocated. Reconfigure acquisition and try again."; - case IMAQdxErrorResourcesUnavailable: return "Insufficient transfer engine resources."; - case IMAQdxErrorSoftwareFault: return "An unexpected software error occurred."; - case IMAQdxErrorSoftwareTriggerOverrun: return "Software trigger overrun."; - case IMAQdxErrorSystemMemoryFull: return "Not enough memory"; - case IMAQdxErrorTestPacketNotReceived: return "The system did not receive a test packet from the camera. The packet size may be too large for the network configuration or a firewall may be enabled."; - case IMAQdxErrorTimeout: return "Timeout."; - case IMAQdxErrorU3VControlInterfaceError: return "There was an error from the control interface of the USB3 Vision camera."; - case IMAQdxErrorU3VEventInterfaceError: return "There was an error from the event interface of the USB3 Vision camera."; - case IMAQdxErrorU3VInsufficientPower: return "The USB3 Vision camera requires more current than can be supplied by the USB port in use."; - case IMAQdxErrorU3VInvalidControlInterface: return "The USB3 Vision control interface is not implemented or is invalid on this camera."; - case IMAQdxErrorU3VInvalidEventInterface: return "The USB3 Vision event interface is not implemented or is invalid on this camera."; - case IMAQdxErrorU3VInvalidMaxCurrent: return "The U3V_MaximumCurrentUSB20_mA registry value is not valid for the connected USB3 Vision camera."; - case IMAQdxErrorU3VInvalidStreamInterface: return "The USB3 Vision stream interface is not implemented or is invalid on this camera."; - case IMAQdxErrorU3VStreamInterfaceError: return "There was an error from the stream interface of the USB3 Vision camera."; - case IMAQdxErrorU3VUnsupportedConnectionSpeed: return "The USB connection speed is not supported by the camera. Check whether the camera is plugged into a USB 2.0 port instead of a USB 3.0 port. If so, verify that the camera supports this use case."; - case IMAQdxErrorUSB3VisionError: return "Unknown USB3 Vision error."; - case IMAQdxErrorUnknownHTTPError: return "The camera returned an unknown HTTP error."; - default: return "Unknown error"; - } -} diff --git a/wpilibj/src/athena/cpp/nivision/dxattr.h b/wpilibj/src/athena/cpp/nivision/dxattr.h deleted file mode 100644 index e03a97df55..0000000000 --- a/wpilibj/src/athena/cpp/nivision/dxattr.h +++ /dev/null @@ -1,63 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -IMAQdxError NI_FUNC IMAQdxGetAttributeU32(IMAQdxSession id, const char* name, - uInt32* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeI64(IMAQdxSession id, const char* name, - Int64* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeF64(IMAQdxSession id, const char* name, - float64* value); -IMAQdxError NI_FUNC -IMAQdxGetAttributeString(IMAQdxSession id, const char* name, - char value[IMAQDX_MAX_API_STRING_LENGTH]); -IMAQdxError NI_FUNC IMAQdxGetAttributeEnum(IMAQdxSession id, const char* name, - IMAQdxEnumItem* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeBool(IMAQdxSession id, const char* name, - bool32* value); - -IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumU32(IMAQdxSession id, - const char* name, - uInt32* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumI64(IMAQdxSession id, - const char* name, - Int64* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumF64(IMAQdxSession id, - const char* name, - float64* value); - -IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumU32(IMAQdxSession id, - const char* name, - uInt32* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumI64(IMAQdxSession id, - const char* name, - Int64* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumF64(IMAQdxSession id, - const char* name, - float64* value); - -IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementU32(IMAQdxSession id, - const char* name, - uInt32* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementI64(IMAQdxSession id, - const char* name, - Int64* value); -IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementF64(IMAQdxSession id, - const char* name, - float64* value); - -IMAQdxError NI_FUNC IMAQdxSetAttributeU32(IMAQdxSession id, const char* name, - uInt32 value); -IMAQdxError NI_FUNC IMAQdxSetAttributeI64(IMAQdxSession id, const char* name, - Int64 value); -IMAQdxError NI_FUNC IMAQdxSetAttributeF64(IMAQdxSession id, const char* name, - float64 value); -IMAQdxError NI_FUNC IMAQdxSetAttributeString(IMAQdxSession id, const char* name, - const char* value); -IMAQdxError NI_FUNC IMAQdxSetAttributeEnum(IMAQdxSession id, const char* name, - const IMAQdxEnumItem* value); -IMAQdxError NI_FUNC IMAQdxSetAttributeBool(IMAQdxSession id, const char* name, - bool32 value); diff --git a/wpilibj/src/athena/cpp/nivision/dxattr.ini b/wpilibj/src/athena/cpp/nivision/dxattr.ini deleted file mode 100644 index f0db5efee1..0000000000 --- a/wpilibj/src/athena/cpp/nivision/dxattr.ini +++ /dev/null @@ -1,5 +0,0 @@ -[IMAQdxGetAttributeString] -outparams=value - -[Block Comment] -exclude= diff --git a/wpilibj/src/athena/cpp/nivision/dxattr_funcs.txt b/wpilibj/src/athena/cpp/nivision/dxattr_funcs.txt deleted file mode 100644 index a685381056..0000000000 --- a/wpilibj/src/athena/cpp/nivision/dxattr_funcs.txt +++ /dev/null @@ -1,21 +0,0 @@ -IMAQdxGetAttributeU32 -IMAQdxGetAttributeI64 -IMAQdxGetAttributeF64 -IMAQdxGetAttributeString -IMAQdxGetAttributeEnum -IMAQdxGetAttributeBool -IMAQdxGetAttributeMinimumU32 -IMAQdxGetAttributeMinimumI64 -IMAQdxGetAttributeMinimumF64 -IMAQdxGetAttributeMaximumU32 -IMAQdxGetAttributeMaximumI64 -IMAQdxGetAttributeMaximumF64 -IMAQdxGetAttributeIncrementU32 -IMAQdxGetAttributeIncrementI64 -IMAQdxGetAttributeIncrementF64 -IMAQdxSetAttributeU32 -IMAQdxSetAttributeI64 -IMAQdxSetAttributeF64 -IMAQdxSetAttributeString -IMAQdxSetAttributeEnum -IMAQdxSetAttributeBool diff --git a/wpilibj/src/athena/cpp/nivision/gen_java.py b/wpilibj/src/athena/cpp/nivision/gen_java.py deleted file mode 100644 index 0c6c510b0d..0000000000 --- a/wpilibj/src/athena/cpp/nivision/gen_java.py +++ /dev/null @@ -1,2032 +0,0 @@ -from __future__ import print_function - -import codecs -import os -import sys - -try: - import configparser -except ImportError: - import ConfigParser as configparser - -from nivision_parse import * - -# base, cast-out-pre, cast-out-post, cast-in-pre, cast-in-post -java_accessor_map = { - "B": ("", "", "", "", ""), - "C": ("Char", "", "", "", ""), - "S": ("Short", "", "", "", ""), - "I": ("Int", "", "", "", ""), - "J": ("Long", "", "", "", ""), - "F": ("Float", "", "", "", ""), - "D": ("Double", "", "", "", ""), - "Z": ("Boolean", "", "", "", ""), - "X": ("", "(short)(", " & 0xff)", "(byte)(", " & 0xff)"), - "Y": ("Short", "(int)(", " & 0xffff)", "(short)(", " & 0xffff)"), -} - -java_size_map = { - "B": 1, - "C": 2, - "S": 2, - "I": 4, - "J": 8, - "F": 4, - "D": 8, - "Z": 1, -} - - -class JavaType: - def __init__(self, j_type, jn_type, jni_type, jni_sig, is_enum=False, is_struct=False, - is_opaque=False, string_array=False, array_size=None): - self.j_type = j_type - self.jn_type = jn_type - self.jni_type = jni_type - self.jni_sig = jni_sig - self.is_enum = is_enum - self.is_struct = is_struct - self.is_opaque = is_opaque - self.string_array = string_array - self.array_size = array_size - - def copy(self): - return JavaType(self.j_type, self.jn_type, self.jni_type, self.jni_sig, - is_enum=self.is_enum, is_struct=self.is_struct, - is_opaque=self.is_opaque, - string_array=self.string_array, - array_size=self.array_size) - - def __repr__(self): - return "JavaType(%s, %s, %s, %s, is_enum=%s, is_struct=%s, is_opaque=%s, string_array=%s, array_size=%s)" % ( - self.j_type, self.jn_type, self.jni_type, self.jni_sig, - self.is_enum, self.is_struct, - self.is_opaque, self.string_array, self.array_size) - - -java_types_map = { - ("void", None): JavaType("void", "void", "void", None), - ("env", None): JavaType("", "", "JNIEnv*", None), - ("cls", None): JavaType("", "", "jclass", None), - ("int", None): JavaType("int", "int", "jint", "I"), - ("char", None): JavaType("byte", "byte", "jbyte", "B"), - ("wchar_t", None): JavaType("char", "char", "jchar", "C"), - ("unsigned char", None): JavaType("short", "short", "jshort", "X"), - ("short", None): JavaType("short", "short", "jshort", "S"), - ("unsigned short", None): JavaType("int", "int", "jint", "Y"), - ("unsigned", None): JavaType("int", "int", "jint", "I"), - ("unsigned int", None): JavaType("int", "int", "jint", "I"), - ("uInt32", None): JavaType("int", "int", "jint", "I"), - ("IMAQdxSession", None): JavaType("int", "int", "jint", "I"), - ("bool32", None): JavaType("int", "int", "jint", "I"), - ("long", None): JavaType("long", "long", "jlong", "J"), - ("unsigned long", None): JavaType("long", "long", "jlong", "J"), - ("__int64", None): JavaType("long", "long", "jlong", "J"), - ("long long", None): JavaType("long", "long", "jlong", "J"), - ("unsigned __int64", None): JavaType("long", "long", "jlong", "J"), - ("__uint64", None): JavaType("long", "long", "jlong", "J"), - ("unsigned long long", None): JavaType("long", "long", "jlong", "J"), - ("float", None): JavaType("float", "float", "jfloat", "F"), - ("double", None): JavaType("double", "double", "jdouble", "D"), - ("long double", None): JavaType("double", "double", "jdouble", "D"), - ("unsigned char*", None): JavaType("String", "String", "jstring", "Ljava/lang/String;"), - ("char*", None): JavaType("String", "String", "jstring", "Ljava/lang/String;"), - ("void*", None): JavaType("RawData", "long", "jlong", "J", is_opaque=True), - # ("size_t", None): JavaType("long", "long", "jlong", "J"), - ("String255", None): JavaType("String", "String", "jstring", "Ljava/lang/String;", - string_array=True, array_size="256"), - ("String255", ""): JavaType("String[]", "String[]", "jstringArray", "[Ljava/lang/String;", - string_array=True, array_size="256"), - ("char*", ""): JavaType("String[]", "String[]", "jstringArray", "[Ljava/lang/String;"), - ("char", ""): JavaType("String", "String", "jstring", "Ljava/lang/String;", string_array=True, - array_size=""), - ("unsigned char", ""): JavaType("byte[]", "byte[]", "jbyteArray", "[B"), - ("short", ""): JavaType("short[]", "short[]", "jshortArray", "[S"), - ("int", ""): JavaType("int[]", "int[]", "jintArray", "[I"), - ("unsigned int", ""): JavaType("int[]", "int[]", "jintArray", "[I"), - ("uInt32", ""): JavaType("int[]", "int[]", "jintArray", "[I"), - ("long", ""): JavaType("long[]", "long[]", "jlongArray", "[J"), - ("float", ""): JavaType("float[]", "float[]", "jfloatArray", "[F"), - ("double", ""): JavaType("double[]", "double[]", "jdoubleArray", "[D"), -} - - -def c_to_jtype(name, arr): - jtype = java_types_map.get((name, arr), None) - if jtype is not None: - return jtype - - # sized array is treated the same as unsized - if arr is not None and arr != "": - jtype = c_to_jtype(name, "").copy() - jtype.array_size = arr - java_types_map[(name, arr)] = jtype # cache - return jtype - - # Opaque structures - if name in opaque_structs: - if arr is None: - jtype = JavaType(name, "long", "jlong", "J", is_opaque=True) - else: - # FIXME - jtype = JavaType(name + "[]", "long[]", "jlongArray", "[J", is_opaque=True) - java_types_map[(name, arr)] = jtype # cache - return jtype - - # Enums - if name in enums: - if arr is None: - jtype = JavaType(name, "int", "jint", "I", is_enum=True) - else: - # FIXME - jtype = JavaType(name + "[]", "int[]", "jintArray", "[I", is_enum=True) - java_types_map[(name, arr)] = jtype # cache - return jtype - - # handle pointers as void* (FIXME) - if name[-1] == '*': - if name[:-1] not in structs and name[:-1] not in defined: - return java_types_map[("void*", None)] - return c_to_jtype(name[:-1], arr) - - # Otherwise it's a normal structure object - if arr is None: - jtype = JavaType(name, "long", "jlong", "J", is_struct=True) - else: - # FIXME - jtype = JavaType(name + "[]", "long[]", "jlongArray", "[J", is_struct=True) - java_types_map[(name, arr)] = jtype - return jtype - - -class JavaEmitData: - def __init__(self): - self.construct = [] - self.backingRead = [] - self.read = [] - self.writeBufs = [] - self.write = [] - self.backingWrite = [] - self.toArg = "" - - def addConstruct(self, s): - self.construct.extend(s.split('\n')[1 if s[0] == '\n' else 0:]) - - def addBackingRead(self, s): - self.backingRead.extend(s.split('\n')[1 if s[0] == '\n' else 0:]) - - def addRead(self, s): - self.read.extend(s.split('\n')[1 if s[0] == '\n' else 0:]) - - def addWriteBuf(self, s): - self.writeBufs.append(s) - - def addWrite(self, s): - self.write.extend(s.split('\n')[1 if s[0] == '\n' else 0:]) - - def addBackingWrite(self, s): - self.backingWrite.extend(s.split('\n')[1 if s[0] == '\n' else 0:]) - - -class JavaEmitArrayData(JavaEmitData): - def __init__(self): - JavaEmitData.__init__(self) - self.addConstruct("{fname} = new {ftype_one}[0];") - self.addBackingRead("int {size_fname} = {backing}.get{jaccessor}({size_foffset});") - self.addBackingWrite("{backing}.put{jaccessor}({size_foffset}, {fname}.length);") - - -# sized array of null-terminated strings -strzArrayEmitSized = JavaEmitArrayData() -strzArrayEmitSized.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -strzArrayEmitSized.addRead(""" -{fname} = new String[{size_fname}]; -if ({size_fname} > 0 && {fname}_addr != 0) {{ - ByteBuffer bb = newDirectByteBuffer({fname}_addr, {size_fname}*{pointer_sz}); - for (int i=0, off=0; i<{size_fname}; i++, off += {pointer_sz}) {{ - long addr = getPointer(bb, off); - if (addr == 0) - {fname}[i] = null; - else {{ - ByteBuffer bb2 = newDirectByteBuffer(addr, 1000); // FIXME - while (bb2.get() != 0) {{}} - byte[] bytes = new byte[bb2.position()-1]; - bb2.rewind(); - getBytes(bb2, bytes, 0, bytes.length); - try {{ - {fname}[i] = new String(bytes, "UTF-8"); - }} catch (UnsupportedEncodingException e) {{ - {fname}[i] = ""; - }} - }} - }} -}}""") -strzArrayEmitSized.addWriteBuf("{buftype} {fname}_buf") -strzArrayEmitSized.addWriteBuf("{buftype}[] {fname}_bufs") -strzArrayEmitSized.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length*{pointer_sz}).order(ByteOrder.nativeOrder()); -for (int i=0, off=0; i<{fname}.length; i++, off += {pointer_sz}) {{ - if ({fname}[i] == null) - putPointer({fname}_buf, off, 0); - else {{ - byte[] bytes; - try {{ - bytes = {fname}[i].getBytes("UTF-8"); - }} catch (UnsupportedEncodingException e) {{ - bytes = new byte[0]; - }} - {fname}_bufs[i] = ByteBuffer.allocateDirect(bytes.length+1); - putBytes({fname}_bufs[i], bytes, 0, bytes.length).put(bytes.length, (byte)0); - putPointer({fname}_buf, off, getByteBufferAddress({fname}_bufs[i])); - }} -}}""") -strzArrayEmitSized.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") - -# unsized array; final terminating zero determines the length -strzArrayEmitUnsized = JavaEmitData() -strzArrayEmitUnsized.addConstruct("{fname} = new {ftype_one}[0];") -strzArrayEmitUnsized.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -strzArrayEmitUnsized.addRead(""" -{{ - if ({fname}_addr == 0) - {fname} = new {ftype_one}[0]; - else {{ - // prescan to find length - ByteBuffer bb = newDirectByteBuffer({fname}_addr, 1000*{pointer_sz}); // FIXME - int size = 0; - for (int off=0; getPointer(bb, off) != 0; size++, off += {pointer_sz}) {{ }} - {fname} = new String[size]; - for (int i=0, off=0; i 0 && {fname}_addr != 0) {{ - ByteBuffer bb = newDirectByteBuffer({fname}_addr, {size_fname}*%d); - for (int i=0, off=0; i<{size_fname}; i++, off += %d) {{ - {fname}[i] = {ftype_one}.fromValue(bb.getInt(off)); - }} -}}""" % (4, 4)) -enumArrayEmit.addWriteBuf("{buftype} {fname}_buf") -enumArrayEmit.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length*%d).order(ByteOrder.nativeOrder()); -for (int i=0, off=0; i<{fname}.length; i++, off += %d) {{ - if ({fname} != null) - {fname}_buf.putInt(off, {fname}[i].getValue()); -}}""" % (4, 4)) -enumArrayEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") -enumArrayEmit.toArg = "getByteBufferAddress({fname}_buf)" - -# array of opaque structures -opaqueArrayEmit = JavaEmitArrayData() -opaqueArrayEmit.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -opaqueArrayEmit.addRead(""" -{fname} = new {ftype_one}[{size_fname}]; -if ({size_fname} > 0 && {fname}_addr != 0) {{ - ByteBuffer bb = newDirectByteBuffer({fname}_addr, {size_fname}*{pointer_sz}); - for (int i=0, off=0; i<{size_fname}; i++, off += {pointer_sz}) {{ - {fname}[i] = new {ftype_one}(getPointer(bb, off), false); - }} -}}""") -opaqueArrayEmit.addWriteBuf("{buftype} {fname}_buf") -opaqueArrayEmit.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length*{pointer_sz}).order(ByteOrder.nativeOrder()); -for (int i=0, off=0; i<{fname}.length; i++, off += {pointer_sz}) {{ - putPointer({fname}_buf, off, {fname}[i]); -}}""") -opaqueArrayEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") -opaqueArrayEmit.toArg = "getByteBufferAddress({fname}_buf)" - -# array of String255 -string255ArrayEmit = JavaEmitArrayData() -string255ArrayEmit.addBackingRead(""" -{fname} = new String[{size_fname}]; -if ({size_fname} > 0) {{ - byte[] bytes = new byte[%d]; - int len; - for (int i=0, off={foffset}; i<{size_fname}; i++, off += %d) {{ - getBytes({backing}, bytes, off, %d); - for (len=0; len 0 && {fname}_addr != 0) {{ - ByteBuffer bb = newDirectByteBuffer({fname}_addr, {size_fname}*{struct_sz}); - for (int i=0, off=0; i<{size_fname}; i++, off += {struct_sz}) {{ - {fname}[i] = new {ftype_one}(bb, off); - {fname}[i].read(); - }} -}}""") -structArrayEmit.addWriteBuf("{buftype} {fname}_buf") -# FIXME: This can be optimized for the read->write case. -structArrayEmit.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length*{struct_sz}).order(ByteOrder.nativeOrder()); -for (int i=0, off=0; i<{fname}.length; i++, off += {struct_sz}) {{ - {fname}[i].setBuffer({fname}_buf, off); - {fname}[i].write(); -}}""") -structArrayEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") -structArrayEmit.toArg = "getByteBufferAddress({fname}_buf)" - -# array of bytes -byteArrayEmit = JavaEmitArrayData() -byteArrayEmit.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -byteArrayEmit.addRead(""" -{fname} = new {ftype_one}[{size_fname}]; -if ({size_fname} > 0 && {fname}_addr != 0) {{ - getBytes(newDirectByteBuffer({fname}_addr, {size_fname}), {fname}, 0, {size_fname}); -}}""") -byteArrayEmit.addWriteBuf("{buftype} {fname}_buf") -byteArrayEmit.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length); -putBytes({fname}_buf, {fname}, 0, {fname}.length);""") -byteArrayEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") -byteArrayEmit.toArg = "getByteBufferAddress({fname}_buf)" - -# array of java types -jtypeArrayEmit = JavaEmitArrayData() -jtypeArrayEmit.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -jtypeArrayEmit.addRead("""{fname} = new {ftype_one}[{size_fname}]; -if ({size_fname} > 0 && {fname}_addr != 0) {{ - newDirectByteBuffer({fname}_addr, {size_fname}*{struct_sz}).as{buftype}().get({fname}); -}}""") -jtypeArrayEmit.addWriteBuf("ByteBuffer {fname}_buf") -jtypeArrayEmit.addWrite(""" -{fname}_buf = ByteBuffer.allocateDirect({fname}.length*{struct_sz}).order(ByteOrder.nativeOrder()); -{fname}_buf.as{buftype}().put({fname}).rewind();""") -jtypeArrayEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname}_buf);") -jtypeArrayEmit.toArg = "getByteBufferAddress({fname}_buf)" - -# enum -enumEmit = JavaEmitData() -enumEmit.addBackingRead("{fname} = {ftype}.fromValue({backing}.getInt({foffset}));") -enumEmit.addBackingWrite("""if ({fname} != null) - {backing}.putInt({foffset}, {fname}.getValue());""") -enumEmit.toArg = "{fname}.getValue()" - -# opaque structure -opaqueEmit = JavaEmitData() -opaqueEmit.addBackingRead("long {fname}_addr = getPointer({backing}, {foffset});") -opaqueEmit.addRead("""if ({fname}_addr == 0) - {fname} = null; -else - {fname} = new {ftype}({fname}_addr, false);""") -opaqueEmit.addBackingWrite("putPointer({backing}, {foffset}, {fname});") -opaqueEmit.toArg = "{fname}.getAddress()" - -# inline normal structure -structEmit = JavaEmitData() -structEmit.addConstruct("{fname} = new {ftype}({backing}, {foffset});") -structEmit.addRead("{fname}.read();") -structEmit.addWrite("{fname}.write();") -structEmit.toArg = "{fname}.getAddress()" - -# java type -jtypeEmit = JavaEmitData() -jtypeEmit.addBackingRead( - "{fname} = {jaccessor_cast_out_pre}{backing}.get{jaccessor}({foffset}){jaccessor_cast_out_post};") -jtypeEmit.addBackingWrite( - "{backing}.put{jaccessor}({foffset}, {jaccessor_cast_in_pre}{fname}{jaccessor_cast_in_post});") - -# string - array of characters -strSizedEmit = JavaEmitData() -strSizedEmit.addBackingRead("""{{ - byte[] bytes = new byte[{array_size}]; - getBytes({backing}, bytes, {foffset}, {array_size}); - int len; - for (len=0; len 0 and read[0][0] == '{': - read[0] = ifcheck + read[0] - else: - read = (" " + "\n ".join(read)).split('\n') - read.insert(0, ifcheck + "{") - read.append("}") - if len(write[0]) > 0 and write[0][0] == '{': - write[0] = ifcheck + write[0] - else: - write = (" " + "\n ".join(write)).split('\n') - write.insert(0, ifcheck + "{") - write.append("}") - - jread.extend(read) - jwrite.extend(write) - - jfielddefs.extend(jfielddefs_private) - - # Java definition - p1 = """ - public static class {name} extends DisposedStruct {{ - {jfielddefs} - - private void init() {{ - {jconstruct} - }} - public {name}() {{ - super({size}); - init(); - }}""" - - if jcargs: - p2 = """ - public {name}({jcargs}) {{ - super({size}); - {jcinit} - }}""" - else: - p2 = "" - - p3 = """ - protected {name}(ByteBuffer backing, int offset) {{ - super(backing, offset, {size}); - init(); - }} - protected {name}(long nativeObj, boolean owned) {{ - super(nativeObj, owned, {size}); - init(); - }} - protected void setBuffer(ByteBuffer backing, int offset) {{ - super.setBuffer(backing, offset, {size}); - }} - public void read() {{ - {jread} - }} - public void write() {{ - {jwrite} - }} - public int size() {{ - return {size}; - }} - }}""" - return "".join([p1, p2, p3]).format( - name=self.name, - jfielddefs="\n ".join(jfielddefs), - jread="\n ".join(jread), - jwrite="\n ".join(jwrite), - jconstruct="\n ".join(jconstruct), - jcargs=", ".join(jcargs), - jcinit="\n ".join(jcinit), - size=self.config_struct_get("_SIZE_")) - - -class JavaEmitter: - def __init__(self, outdir, config, config_struct, library_funcs): - self.outdir = outdir - self.config = config - self.config_struct = config_struct - self.library_funcs = library_funcs - self.package = "com.ni.vision" - self.classname = "NIVision" - self.classpath = self.package.replace(".", "/") + "/" + self.classname - - self.unions = {} - self.errors = {} - - with open(os.path.join(outdir, "VisionException.java"), "wt") as f: - print("""// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -package {package}; - -public class VisionException extends RuntimeException {{ - - private static final long serialVersionUID = 1L; - - public VisionException(String msg) {{ - super(msg); - }} - - @Override - public String toString() {{ - return "VisionException [" + super.toString() + "]"; - }} -}}""".format(package=self.package), file=f) - - self.out = open(os.path.join(outdir, "NIVision.java"), "wt") - print("""// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -package {package}; - -import java.lang.reflect.*; -import java.io.UnsupportedEncodingException; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -public class {classname} {{ - private {classname}() {{}} - - private static native void imaqDispose(long addr); - - private static Constructor constructDirectByteBuffer; - private static Field bufferAddressField; - - static {{ - try {{ - Class[] cArg = new Class[2]; - cArg[0] = long.class; - cArg[1] = int.class; - constructDirectByteBuffer = Class.forName("java.nio.DirectByteBuffer").getDeclaredConstructor(cArg); - constructDirectByteBuffer.setAccessible(true); - - bufferAddressField = Buffer.class.getDeclaredField("address"); - bufferAddressField.setAccessible(true); - }} catch (ReflectiveOperationException e) {{ - throw new ExceptionInInitializerError(e); - }} - }} - - private static ByteBuffer newDirectByteBuffer(long addr, int cap) {{ - try {{ - return ((ByteBuffer)(constructDirectByteBuffer.newInstance(addr, cap))).order(ByteOrder.nativeOrder()); - }} catch (ReflectiveOperationException e) {{ - throw new ExceptionInInitializerError(e); - }} - }} - - private static long getByteBufferAddress(ByteBuffer bb) {{ - try {{ - return bufferAddressField.getLong(bb); - }} catch (IllegalAccessException e) {{ - return 0; - }} - }} - - public static ByteBuffer sliceByteBuffer(ByteBuffer bb, int offset, int size) {{ - int pos = bb.position(); - int lim = bb.limit(); - bb.position(offset); - bb.limit(offset+size); - ByteBuffer new_bb = bb.slice().order(ByteOrder.nativeOrder()); - bb.position(pos); - bb.limit(lim); - return new_bb; - }} - - public static ByteBuffer getBytes(ByteBuffer bb, byte[] dst, int offset, int size) {{ - int pos = bb.position(); - bb.position(offset); - bb.get(dst, 0, size); - bb.position(pos); - return bb; - }} - - public static ByteBuffer putBytes(ByteBuffer bb, byte[] src, int offset, int size) {{ - int pos = bb.position(); - bb.position(offset); - bb.put(src, 0, size); - bb.position(pos); - return bb; - }} - - private static abstract class DisposedStruct {{ - protected ByteBuffer backing; - private boolean owned; - protected DisposedStruct(int size) {{ - backing = ByteBuffer.allocateDirect(size); - backing.order(ByteOrder.nativeOrder()); - owned = false; - }} - protected DisposedStruct(ByteBuffer backing, int offset, int size) {{ - this.backing = sliceByteBuffer(backing, offset, size); - owned = false; - }} - private DisposedStruct(long nativeObj, boolean owned, int size) {{ - backing = newDirectByteBuffer(nativeObj, size); - this.owned = owned; - }} - public void free() {{ - if (owned) {{ - imaqDispose(getByteBufferAddress(backing)); - owned = false; - backing = null; - }} - }} - @Override - protected void finalize() throws Throwable {{ - if (owned) - imaqDispose(getByteBufferAddress(backing)); - super.finalize(); - }} - public long getAddress() {{ - if (backing == null) - return 0; - write(); - return getByteBufferAddress(backing); - }} - protected void setBuffer(ByteBuffer backing, int offset, int size) {{ - this.backing = sliceByteBuffer(backing, offset, size); - }} - - abstract public void read(); - abstract public void write(); - abstract public int size(); - }} - - private static abstract class OpaqueStruct {{ - private long nativeObj; - private boolean owned; - protected OpaqueStruct() {{ - nativeObj = 0; - owned = false; - }} - protected OpaqueStruct(long nativeObj, boolean owned) {{ - this.nativeObj = nativeObj; - this.owned = owned; - }} - public void free() {{ - if (owned && nativeObj != 0) {{ - imaqDispose(nativeObj); - owned = false; - nativeObj = 0; - }} - }} - @Override - protected void finalize() throws Throwable {{ - if (owned && nativeObj != 0) - imaqDispose(nativeObj); - super.finalize(); - }} - public long getAddress() {{ - return nativeObj; - }} - }} - - public static class RawData {{ - private ByteBuffer buf; - private boolean owned; - public RawData() {{ - owned = false; - }} - public RawData(ByteBuffer buf) {{ - this.buf = buf; - owned = false; - }} - private RawData(long nativeObj, boolean owned, int size) {{ - buf = newDirectByteBuffer(nativeObj, size); - this.owned = owned; - }} - public void free() {{ - if (owned) {{ - imaqDispose(getByteBufferAddress(buf)); - owned = false; - buf = null; - }} - }} - @Override - protected void finalize() throws Throwable {{ - if (owned) - imaqDispose(getByteBufferAddress(buf)); - super.finalize(); - }} - public long getAddress() {{ - if (buf == null) - return 0; - return getByteBufferAddress(buf); - }} - public ByteBuffer getBuffer() {{ - return buf; - }} - public void setBuffer(ByteBuffer buf) {{ - if (owned) - free(); - this.buf = buf; - }} - }}""".format(package=self.package, classname=self.classname), file=self.out) - - if int(self.config_struct.get("_platform_", "pointer")) == 4: - # 32-bit addressing - java_types_map[("size_t", None)] = JavaType("int", "int", "jint", "I") - print(""" - private static long getPointer(ByteBuffer bb, int offset) { - return (long)bb.getInt(offset); - } - private static void putPointer(ByteBuffer bb, int offset, long address) { - bb.putInt(offset, (int)address); - } - private static void putPointer(ByteBuffer bb, int offset, ByteBuffer buf) { - if (buf == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int)getByteBufferAddress(buf)); - } - private static void putPointer(ByteBuffer bb, int offset, DisposedStruct struct) { - if (struct == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int)struct.getAddress()); - } - private static void putPointer(ByteBuffer bb, int offset, OpaqueStruct struct) { - if (struct == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int)struct.getAddress()); - }""", file=self.out) - else: - # 64-bit addressing - java_types_map[("size_t", None)] = JavaType("long", "long", "jlong", "J") - print(""" - private static long getPointer(ByteBuffer bb, int offset) { - return bb.getLong(offset); - } - private static void putPointer(ByteBuffer bb, int offset, long address) { - bb.putLong(offset, address); - } - private static void putPointer(ByteBuffer bb, int offset, ByteBuffer buf) { - if (buf == null) - bb.putLong(offset, 0); - else - bb.putLong(offset, getByteBufferAddress(buf)); - } - private static void putPointer(ByteBuffer bb, int offset, OpaqueStruct struct) { - if (struct == null) - bb.putLong(offset, 0); - else - bb.putLong(offset, struct.getAddress()); - } - private static void putPointer(ByteBuffer bb, int offset, DisposedStruct struct) { - if (struct == null) - bb.putLong(offset, 0); - else - bb.putLong(offset, struct.getAddress()); - }""", file=self.out) - - self.outc = open(os.path.join(outdir, "NIVision.cpp"), "wt") - print("""// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -#include -#include -#include -#include -#include -#include - -static const char* getErrorText(int err); - -// throw java exception -static void throwJavaException(JNIEnv *env) {{ - jclass je = env->FindClass("{packagepath}/VisionException"); - int err = imaqGetLastError(); - const char* err_text = getErrorText(err); - char* full_err_msg = static_cast(malloc(30+strlen(err_text))); - sprintf(full_err_msg, "imaqError: %d: %s", err, err_text); - env->ThrowNew(je, full_err_msg); - free(full_err_msg); -}} - -// throw IMAQdx java exception -static void dxthrowJavaException(JNIEnv *env, IMAQdxError err) {{ - jclass je = env->FindClass("{packagepath}/VisionException"); - const char* err_text = getErrorText(err); - char* full_err_msg = static_cast(malloc(30+strlen(err_text))); - sprintf(full_err_msg, "IMAQdxError: %d: %s", err, err_text); - env->ThrowNew(je, full_err_msg); - free(full_err_msg); -}} - -extern "C" {{ - -JNIEXPORT void JNICALL Java_{package}_{classname}_imaqDispose(JNIEnv* , jclass , jlong addr) -{{ - imaqDispose((void*)addr); -}} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeU32(IMAQdxSession id, const char* name, uInt32* value) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeU32, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeI64(IMAQdxSession id, const char* name, Int64* value) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeI64, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeF64(IMAQdxSession id, const char* name, float64* value) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeF64, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeString(IMAQdxSession id, const char* name, char value[IMAQDX_MAX_API_STRING_LENGTH]) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeString, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeEnum(IMAQdxSession id, const char* name, IMAQdxEnumItem* value) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeEnumItem, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeBool(IMAQdxSession id, const char* name, bool32* value) -{{ - return IMAQdxGetAttribute(id, name, IMAQdxValueTypeBool, (void*)value); -}} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumU32(IMAQdxSession id, const char* name, uInt32* value) -{{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeU32, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumI64(IMAQdxSession id, const char* name, Int64* value) -{{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeI64, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMinimumF64(IMAQdxSession id, const char* name, float64* value) -{{ - return IMAQdxGetAttributeMinimum(id, name, IMAQdxValueTypeF64, (void*)value); -}} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumU32(IMAQdxSession id, const char* name, uInt32* value) -{{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeU32, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumI64(IMAQdxSession id, const char* name, Int64* value) -{{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeI64, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeMaximumF64(IMAQdxSession id, const char* name, float64* value) -{{ - return IMAQdxGetAttributeMaximum(id, name, IMAQdxValueTypeF64, (void*)value); -}} - -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementU32(IMAQdxSession id, const char* name, uInt32* value) -{{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeU32, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementI64(IMAQdxSession id, const char* name, Int64* value) -{{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeI64, (void*)value); -}} -static inline IMAQdxError NI_FUNC IMAQdxGetAttributeIncrementF64(IMAQdxSession id, const char* name, float64* value) -{{ - return IMAQdxGetAttributeIncrement(id, name, IMAQdxValueTypeF64, (void*)value); -}} - -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeU32(IMAQdxSession id, const char* name, uInt32 value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeU32, value); -}} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeI64(IMAQdxSession id, const char* name, Int64 value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeI64, value); -}} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeF64(IMAQdxSession id, const char* name, float64 value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeF64, value); -}} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeString(IMAQdxSession id, const char* name, const char* value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeString, value); -}} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeEnum(IMAQdxSession id, const char* name, const IMAQdxEnumItem* value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeU32, value->Value); -}} -static inline IMAQdxError NI_FUNC IMAQdxSetAttributeBool(IMAQdxSession id, const char* name, bool32 value) -{{ - return IMAQdxSetAttribute(id, name, IMAQdxValueTypeBool, value); -}} -""".format(packagepath=self.package.replace(".", "/"), - package=self.package.replace(".", "_"), - classname=self.classname), file=self.outc) - - self.block_comment("Opaque Structures") - for name in sorted(opaque_structs): - self.opaque_struct(name) - - def finish(self): - print("}", file=self.out) - print("""}} - -static const char* getErrorText(int err) {{ - switch (err) {{ - {errs} - default: return "Unknown error"; - }} -}}""".format(errs="\n ".join( - 'case %s: return "%s";' % (x, self.errors[x]) for x in sorted(self.errors))), - file=self.outc) - - def config_get(self, section, option, fallback): - try: - return self.config.get(section, option) - except (ValueError, configparser.NoSectionError, configparser.NoOptionError): - return fallback - - def config_getboolean(self, section, option, fallback): - try: - return self.config.getboolean(section, option) - except (ValueError, configparser.NoSectionError, configparser.NoOptionError): - return fallback - - def block_comment(self, comment): - print(""" - /** - * {comment} - */""".format(comment=comment), file=self.out) - print(""" -/* - * {comment} - */""".format(comment=comment), file=self.outc) - - def opaque_struct(self, name): - print(""" - public static class {name} extends OpaqueStruct {{ - private {name}() {{}} - private {name}(long nativeObj, boolean owned) {{ - super(nativeObj, owned); - }} - }}""".format(name=name), file=self.out) - - def define(self, name, value, comment): - if self.config_getboolean(name, "exclude", fallback=False): - return - if name in opaque_structs: - return - clean = None - type = None - after_struct = False - if value == "TRUE": - clean = "true" - type = "boolean" - elif value == "FALSE": - clean = "false" - type = "boolean" - elif name.startswith("IMAQ_INIT_RGB") and value[0] == '{' and value[-1] == '}': - return - elif value.startswith("imaqMake"): - clean = "new " + value[8:] - type = value.split("(")[0][8:] - after_struct = True - elif value[0] == '"': - if len(value) == 2: - clean = "{ 0 }" - else: - clean = "{ %s,0 }" % ",".join("0x%x" % ord(c) for c in value[1:-1]) - type = "byte[]" - elif number_re.match(value): - clean = value - type = "int" - elif constant_re.match(value): - clean = value - after_struct = value not in defined - - if clean is None: - print("Invalid #define: %s" % name) - return - - if name.startswith("ERR_"): - self.errors[name] = comment - return - - # strip IMAQ_ prefix - if name.startswith("IMAQ_"): - name = name[5:] - - code = " public static final {type} {name} = {value};" \ - .format(type=type, name=name, value=clean) - if after_struct: - define_after_struct.append((name, code)) - return - - print(code, file=self.out) - defined.add(name) - - def text(self, text): - print(text, file=self.out) - - def static_const(self, name, ctype, value): - # strip IMAQ_ prefix - if name.startswith("IMAQ_"): - name = name[5:] - - if hasattr(value, "__iter__"): - code = " public static final {ctype} {name} = new {ctype}({value});" - value = ", ".join(value) - else: - code = "{name} = {value};" - print(code.format(name=name, value=value, ctype=ctype), - file=self.out) - defined.add(name) - - def enum(self, name, values): - if self.config_getboolean(name, "exclude", fallback=False): - return - if name in opaque_structs: - return - valuestrs = [] - need_search = False - prev_value = -1 - for vname, value, comment in values: - if vname.endswith("SIZE_GUARD"): - continue - if value is None: - # auto-increment - value = "%d" % (prev_value + 1) - value_i = int(value, 0) - if value_i < 0 or value_i != (prev_value + 1): - # need to do search instead of index for fromValue() - need_search = True - prev_value = value_i - - if vname == "IMAQdxErrorSuccess": - continue - if vname.startswith("IMAQdxError"): - self.errors[vname] = comment - continue - - if vname.startswith("IMAQ_"): - vname = vname[5:] - if vname.startswith("IMAQdx"): - vname = vname[6:] - if vname[0] in "0123456789": - vname = "C" + vname - valuestrs.append("%s(%s),%s" % (vname, value, " // %s" % comment if comment else "")) - defined.add(vname) - - if not valuestrs: - return - - print(""" - public static enum {name} {{ - {values} - ; - private final int value; - private {name}(int value) {{ - this.value = value; - }} - public static {name} fromValue(int val) {{""".format(name=name, - values="\n ".join(valuestrs)), - file=self.out) - if need_search: - print(""" for ({name} v : values()) {{ - if (v.value == val) - return v; - }} - return null;""".format(name=name), file=self.out) - else: - print(""" try {{ - return values()[val]; - }} catch (ArrayIndexOutOfBoundsException e) {{ - return null; - }}""".format(), file=self.out) - print(""" }} - public int getValue() {{ - return value; - }} - }}""".format(), file=self.out) - defined.add(name) - enums.add(name) - - def typedef(self, name, typedef, arr): - if self.config_getboolean(name, "exclude", fallback=False): - return - if name in opaque_structs: - return - if typedef.startswith("struct"): - return - elif typedef.startswith("union"): - return - elif (name, arr) not in java_types_map: - java_types_map[(name, arr)] = c_to_jtype(typedef, arr).copy() - if arr is None: - java_types_map[(name, "")] = c_to_jtype(typedef, "").copy() - defined.add(name) - - def typedef_function(self, name, restype, params): - if self.config_getboolean(name, "exclude", fallback=False): - return - if name in opaque_structs: - return - raise NotImplementedError("typedef function not implemented") - - def function(self, name, restype, params): - if name not in self.library_funcs: - return - if name == "IMAQdxEnumerateVideoModes": - # full custom code - print(""" - public static class dxEnumerateVideoModesResult {{ - public IMAQdxEnumItem[] videoModeArray; - public int currentMode; - private ByteBuffer videoModeArray_buf; - private dxEnumerateVideoModesResult(ByteBuffer rv_buf, ByteBuffer videoModeArray_buf) {{ - this.videoModeArray_buf = videoModeArray_buf; - int count = rv_buf.getInt(0); - videoModeArray = new IMAQdxEnumItem[count]; - for (int i=0, off=0; i...") - exit(0) - - inputs = [] - for i in range(1, len(sys.argv), 4): - fname = sys.argv[i] - config_struct_name = sys.argv[i + 1] - configname = sys.argv[i + 2] - funcs_name = sys.argv[i + 3] - inputs.append((fname, config_struct_name, configname, funcs_name)) - - generate("", "", inputs) diff --git a/wpilibj/src/athena/cpp/nivision/gen_struct_sizer.py b/wpilibj/src/athena/cpp/nivision/gen_struct_sizer.py deleted file mode 100644 index d449729f00..0000000000 --- a/wpilibj/src/athena/cpp/nivision/gen_struct_sizer.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import print_function - -import os -import sys - -try: - import configparser -except ImportError: - import ConfigParser as configparser - -from nivision_parse import * - - -class StructSizerEmitter: - def __init__(self, out, config, hname): - self.out = out - self.config = config - print("""#include -#include -#include <{hname}> - -int main() -{{ - asm("#STRUCT_SIZER [_platform_]\\n"); - asm("#STRUCT_SIZER pointer=%0\\n" : : "n"((int)sizeof(void*))); -""".format(hname=hname), file=self.out) - - def finish(self): - print("}", file=self.out) - - def config_get(self, section, option, fallback): - try: - return self.config.get(section, option) - except (ValueError, configparser.NoSectionError, configparser.NoOptionError): - return fallback - - def config_getboolean(self, section, option, fallback): - try: - return self.config.getboolean(section, option) - except (ValueError, configparser.NoSectionError, configparser.NoOptionError): - return fallback - - def block_comment(self, comment): - pass - - def opaque_struct(self, name): - pass - - def define(self, name, value, comment): - pass - - def text(self, text): - print(text, file=self.out) - - def static_const(self, name, ctype, value): - pass - - def enum(self, name, values): - pass - - def typedef(self, name, typedef, arr): - pass - - def typedef_function(self, name, restype, params): - pass - - def function(self, name, restype, params): - pass - - def structunion(self, ctype, name, fields): - if name in opaque_structs: - return - - print('asm("#STRUCT_SIZER [{name}]\\n");'.format(name=name), file=self.out) - print('asm("#STRUCT_SIZER _SIZE_=%0\\n" : : "n"((int)sizeof({name})));'.format(name=name), - file=self.out) - - for fname, ftype, arr, comment in fields: - if ':' in fname: - continue # can't handle bitfields - print( - 'asm("#STRUCT_SIZER {field}=%0\\n" : : "n"((int)offsetof({name}, {field})));'.format( - name=name, field=fname), file=self.out) - - def struct(self, name, fields): - self.structunion("Structure", name, fields) - - def union(self, name, fields): - self.structunion("Union", name, fields) - - -def generate(srcdir, configpath=None, hpath=None): - # read config file - config = configparser.ConfigParser() - config.read(configpath) - block_comment_exclude = set(x.strip() for x in - config.get("Block Comment", "exclude").splitlines()) - - # open input file - inf = open(hpath) - - # prescan for undefined structures - prescan_file(inf) - inf.seek(0) - - # generate - with open("struct_sizer.c", "wt") as out: - emit = StructSizerEmitter(out, config, os.path.basename(hpath)) - parse_file(emit, inf, block_comment_exclude) - emit.finish() - - -if __name__ == "__main__": - if len(sys.argv) != 3: - print("Usage: gen_struct_sizer.py ") - exit(0) - - fname = sys.argv[1] - configname = sys.argv[2] - - generate("", configname, fname) diff --git a/wpilibj/src/athena/cpp/nivision/generateJNI.sh b/wpilibj/src/athena/cpp/nivision/generateJNI.sh deleted file mode 100644 index 3f92311586..0000000000 --- a/wpilibj/src/athena/cpp/nivision/generateJNI.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -#This script should be able to generate the JNI -# bindings for NIVision. At some point, -# it should be integrated into the build system. -# Assumes running from allwpilib/wpilibj/wpilibJavaJNI/nivision - -# Get structure sizes. -python gen_struct_sizer.py ../../../wpilibc/wpilibC++Devices/include/nivision.h nivision_2011.ini -arm-frc-linux-gnueabi-gcc -I../../../wpilibc/wpilibC++Devices/include -S struct_sizer.c -cat struct_sizer.s | python get_struct_size.py > nivision_arm.ini - -python gen_struct_sizer.py ../../../wpilibc/wpilibC++Devices/include/NIIMAQdx.h imaqdx.ini -arm-frc-linux-gnueabi-gcc -I../../../wpilibc/wpilibC++Devices/include -S struct_sizer.c -cat struct_sizer.s | python get_struct_size.py > imaqdx_arm.ini - -# Get functions actually in the .so; some functions are in the header but -# not the shared library! -arm-frc-linux-gnueabi-nm -D ../../../ni-libraries/libnivision.so.14.0.0 | cut -c 12- | grep ^imaq > nivision_funcs.txt -echo Priv_ReadJPEGString_C >> nivision_funcs.txt -arm-frc-linux-gnueabi-nm -D ../../../ni-libraries/libniimaqdx.so.14.0.0 | cut -c 12- | grep ^IMAQdx > imaqdx_funcs.txt - -# Run python generator. -python gen_java.py \ - ../../../wpilibc/wpilibC++Devices/include/nivision.h \ - nivision_arm.ini \ - nivision_2011.ini \ - nivision_funcs.txt \ - \ - ../../../wpilibc/wpilibC++Devices/include/NIIMAQdx.h \ - imaqdx_arm.ini \ - imaqdx.ini \ - imaqdx_funcs.txt \ - \ - dxattr.h \ - imaqdx_arm.ini \ - dxattr.ini \ - dxattr_funcs.txt - -# Stick generated files into appropriate places. -cp NIVision.cpp ../lib/NIVisionJNI.cpp -mkdir -p ../../wpilibJavaDevices/src/main/java/com/ni/vision -cp *.java ../../wpilibJavaDevices/src/main/java/com/ni/vision/ diff --git a/wpilibj/src/athena/cpp/nivision/get_struct_size.py b/wpilibj/src/athena/cpp/nivision/get_struct_size.py deleted file mode 100644 index 3df06fc5a7..0000000000 --- a/wpilibj/src/athena/cpp/nivision/get_struct_size.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import print_function - -import sys - - -def main(): - for line in sys.stdin: - line = line.strip() - if not line.startswith("#STRUCT_SIZER"): - continue - line = line[14:] - line = line.replace("#", "") - print(line) - - -if __name__ == "__main__": - main() diff --git a/wpilibj/src/athena/cpp/nivision/imaqdx.ini b/wpilibj/src/athena/cpp/nivision/imaqdx.ini deleted file mode 100644 index c643dcf73d..0000000000 --- a/wpilibj/src/athena/cpp/nivision/imaqdx.ini +++ /dev/null @@ -1,80 +0,0 @@ -[Block Comment] -exclude= - Typedefs - Forward Declare Data Structures - Error Codes Enumeration - Callbacks - -; Error Codes Enumeration -[IMAQdxError] - -; Callbacks -[FrameDoneEventCallbackPtr] -exclude=True -[PnpEventCallbackPtr] -exclude=True -[AttributeUpdatedEventCallbackPtr] -exclude=True - -; Functions -[IMAQdxSequence] -arraysize=images:count -exclude=True -[IMAQdxEnumerateCameras] -arraysize=cameraInformationArray:count -exclude=True -[IMAQdxGetImageData] -#arraysize=buffer:bufferSize -[IMAQdxEnumerateVideoModes] -arraysize=videoModeArray:count -exclude=True -[IMAQdxEnumerateAttributes] -arraysize=attributeInformationArray:count -exclude=True -[IMAQdxGetAttribute] -exclude=True -[IMAQdxSetAttribute] -# has to be manual due to "..." -exclude=True -[IMAQdxGetAttributeMinimum] -exclude=True -[IMAQdxGetAttributeMaximum] -exclude=True -[IMAQdxGetAttributeIncrement] -exclude=True -[IMAQdxEnumerateAttributeValues] -arraysize=list:size -exclude=True -[IMAQdxGetAttributeTooltip] -exclude=True -[IMAQdxGetAttributeUnits] -exclude=True -[IMAQdxRegisterFrameDoneEvent] -# callback -exclude=True -[IMAQdxRegisterPnpEvent] -# callback -exclude=True -[IMAQdxWriteMemory] -arraysize=values:count -exclude=True -[IMAQdxReadMemory] -arraysize=values:count -exclude=True -[IMAQdxGetErrorString] -exclude=True -[IMAQdxEnumerateAttributes2] -arraysize=attributeInformationArray:count -exclude=True -[IMAQdxGetAttributeDescription] -exclude=True -[IMAQdxGetAttributeDisplayName] -exclude=True -[IMAQdxDispose] -exclude=True -[IMAQdxRegisterAttributeUpdatedEvent] -# callback -exclude=True -[IMAQdxEnumerateAttributes3] -arraysize=attributeInformationArray:count -exclude=True diff --git a/wpilibj/src/athena/cpp/nivision/nivision_2011.ini b/wpilibj/src/athena/cpp/nivision/nivision_2011.ini deleted file mode 100644 index 572c391f9c..0000000000 --- a/wpilibj/src/athena/cpp/nivision/nivision_2011.ini +++ /dev/null @@ -1,840 +0,0 @@ -; -; [name] -; arraysize -- comma separated list of "param:numParam" where param is the -; name of the pointer parameter, and numParam is the name of -; the parameter that contains the array size for the pointer -; retarraysize -- name of the pass-by-reference parameter that on function -; return contains the array size of the returned pointer -; exclude -- if True, no code is output for this name (full custom) -; underscore -- if True, only underscored raw wrapper is output (partial custom) -; outparams -- comma separated list of output parameter names -; inparams -- comma separated list of parameter names that are input -; parameters (e.g. not output parameters) -; defaults -- comma separated list of "param:default" where param is the -; parameter name and default is the default value -; exclude_members -- for structures, members to not emit -; nullok -- comma separated list of parameter names that may be null -; retref -- parameter that (if non-null) is returned as a reference -; retunowned -- if True, return value should not be owned -; -; The generator code auto-detects many parameters, so this file is only needed -; for overriding the auto-detected behavior. - -; defines -[IMAQ_IMPORT] -exclude=True -[IMAQ_FUNC] -exclude=True -[IMAQ_STDCALL] -exclude=True -[IMAQ_CALLBACK] -exclude=True -[IMAQ_DEFAULT_LEARNING_MODE] -exclude=True -[ERR_INVALID_COLORCOMPLEXITY] -exclude=True - -; structures -[PolyModel] -arraysize=kCoeffs:numKCoeffs -[CalibrationReferencePoints] -arraysize=pixelCoords:numPixelCoords,realCoords:numRealCoords -[GetCameraParametersReport] -#TODO: projectionMatrix:projectionMatrixRows*projectionMatrixCols -exclude_members=projectionMatrix -[GetCalibrationInfoReport] -#TODO: errorMap:errorMapRows*errorMapCols -exclude_members=errorMap -[ContourFitSplineReport] -arraysize=points:numberOfPoints -[ContourFitPolynomialReport] -arraysize=bestFit:numberOfPoints,polynomialCoefficients:numberOfCoefficients -[SetupMatchPatternData] -arraysize=matchSetupData:numMatchSetupData -[ContourInfoReport] -arraysize=pointsPixel:numPointsPixel,pointsReal:numPointsReal,curvaturePixel:numCurvaturePixel,curvatureReal:numCurvatureReal -[SupervisedColorSegmentationReport] -arraysize=labelOut:numLabelOut -[LabelToROIReport] -arraysize=roiArray:numOfROIs,labelsOutArray:numOfLabels,isTooManyVectorsArray:isTooManyVectorsArraySize -[ClassifiedCurve] -arraysize=curvePoints:numCurvePoints -[CurvatureAnalysisReport] -arraysize=curves:numCurves -[ComputeDistancesReport] -arraysize=distances:numDistances,distancesReal:numDistancesReal -[ClassifiedDisparity] -arraysize=templateSubsection:numTemplateSubsection,targetSubsection:numTargetSubsection -[ClassifyDistancesReport] -arraysize=classifiedDistances:numClassifiedDistances -[ContourComputeCurvatureReport] -arraysize=curvaturePixel:numCurvaturePixel,curvatureReal:numCurvatureReal -[ExtractContourReport] -arraysize=contourPoints:numContourPoints,sourcePoints:numSourcePoints -[ExtractTextureFeaturesReport] -arraysize=waveletBands:numWaveletBands -#TODO: textureFeatures:textureFeaturesRows:textureFeaturesCols -exclude_members=textureFeatures -[WaveletBandsReport] -#TODO: LLBand:rows:cols -#TODO: LHBand:rows:cols -#TODO: HLBand:rows:cols -#TODO: HHBand:rows:cols -#TODO: LLLBand:rows:cols -#TODO: LLHBand:rows:cols -#TODO: LHHBand:rows:cols -exclude_members=LLBand,LHBand,HLBand,HHBand,LLLBand,LLHBand,LHHBand -[MeasureParticlesReport] -#TODO: pixelMeasurements:numParticles:numMeasurements -#TODO: calibratedMeasurements:numParticles:numMeasurements -exclude_members=pixelMeasurements,calibratedMeasurements -[ClassifierReportAdvanced] -arraysize=allScores:allScoresSize,sampleScores:sampleScoresSize -[FindEdgeReport] -arraysize=straightEdges:numStraightEdges -[ReadTextReport3] -arraysize=characterReport:numCharacterReports -[EdgeReport2] -arraysize=edges:numEdges,gradientInfo:numGradientInfo -[ConcentricRakeReport2] -arraysize=firstEdges:numFirstEdges,lastEdges:numLastEdges,searchArcs:numSearchArcs -[SpokeReport2] -arraysize=firstEdges:numFirstEdges,lastEdges:numLastEdges,searchLines:numSearchLines -[RakeReport2] -arraysize=firstEdges:numFirstEdges,lastEdges:numLastEdges,searchLines:numSearchLines -[QRCodeDataToken] -arraysize=data:dataLength -[StraightEdgeReport2] -arraysize=straightEdges:numStraightEdges,searchLines:numSearchLines -[StraightEdge] -arraysize=usedEdges:numUsedEdges -[QRCodeReport] -arraysize=data:dataLength,tokenizedData:sizeOfTokenizedData -[DataMatrixReport] -arraysize=data:dataLength -[ReadTextReport2] -arraysize=characterReport:numCharacterReports -[FeatureData] -arraysize=contourPoints:numContourPoints -uniontype=feature:type:IMAQ_CIRCLE_FEATURE=circle:IMAQ_ELLIPSE_FEATURE=ellipse:IMAQ_CONST_CURVE_FEATURE=constCurve:IMAQ_RECTANGLE_FEATURE=rectangle:IMAQ_LEG_FEATURE=leg:IMAQ_CORNER_FEATURE=corner:IMAQ_PARALLEL_LINE_PAIR_FEATURE=parallelLinePair:IMAQ_PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE=pairOfParallelLinePairs:IMAQ_LINE_FEATURE=line:IMAQ_CLOSED_CURVE_FEATURE=closedCurve -[GeometricPatternMatch2] -arraysize=featureData:numFeatureData -[ShapeDetectionOptions] -arraysize=angleRanges:numAngleRanges -[Curve] -arraysize=points:numPoints -[Barcode2DInfo] -arraysize=data:dataLength -[ClassifierAccuracyReport] -arraysize=classNames:size,classAccuracy:size,classPredictiveValue:size -#TODO: classificationDistribution:classPredictiveValue:size -exclude_members=classificationDistribution -[NearestNeighborTrainingReport] -arraysize=allScores:allScoresSize -#TODO: classDistancesTable -exclude_members=classDistancesTable -[ClassifierSampleInfo] -arraysize=featureVector:featureVectorSize -[ClassifierReport] -arraysize=allScores:allScoresSize -[MatchGeometricPatternOptions] -arraysize=angleRanges:numAngleRanges -[ConstructROIOptions2] -arraysize=palette:numColors -[BestEllipse2] -arraysize=pointsUsed:numPointsUsed -[BestCircle2] -arraysize=pointsUsed:numPointsUsed -[ReadTextOptions] -arraysize=validChars:numValidChars -[ReadTextReport] -arraysize=characterReport:numCharacterReports -[EdgeLocationReport] -arraysize=edges:numEdges -[ImageInfo] -#TODO: imageStart -exclude_members=reserved0,reserved1,imageStart -[LCDReport] -arraysize=segmentInfo:numCharacters -exclude_members=reserved -[LCDSegments] -exclude_members=reserved -[LearnColorPatternOptions] -arraysize=colorsToIgnore:numColorsToIgnore -[LinearAverages] -arraysize=columnAverages:columnCount,rowAverages:rowCount,risingDiagAverages:risingDiagCount,fallingDiagAverages:fallingDiagCount -[LineProfile] -arraysize=profileData:dataCount -[MatchColorPatternOptions] -arraysize=angleRanges:numRanges -[HistogramReport] -arraysize=histogram:histogramCount -[BestLine] -arraysize=pointsUsed:numPointsUsed -[CalibrationInfo] -#TODO: errorMap:mapColumns*mapRows -exclude_members=errorMap -[CalibrationPoints] -arraysize=pixelCoordinates:numCoordinates,realWorldCoordinates:numCoordinates -[CaliperReport] -exclude_members=reserved -[ClosedContour] -arraysize=points:numPoints -[ColorInformation] -arraysize=info:infoCount -[ConcentricRakeReport] -arraysize=rakeArcs:numArcs,firstEdges:numFirstEdges,lastEdges:numLastEdges,allEdges:numLinesWithEdges,linesWithEdges:numLinesWithEdges -[ConstructROIOptions] -arraysize=palette:numColors -[ContourInfo] -arraysize=points:numPoints -[ContourInfo2] -uniontype=structure:type:IMAQ_POINT=point:IMAQ_LINE=line:IMAQ_RECT=rect:IMAQ_OVAL=ovalBoundingBox:IMAQ_CLOSED_CONTOUR=closedContour:IMAQ_OPEN_CONTOUR=openContour:IMAQ_ANNULUS=annulus:IMAQ_ROTATED_RECT=rotatedRect -[UserPointSymbol] -#TODO: pixels:cols*rows -exclude_members=pixels -[MatchPatternOptions] -arraysize=angleRanges:numRanges -[OpenContour] -arraysize=points:numPoints -[QuantifyReport] -arraysize=regions:regionCount -[RakeReport] -arraysize=rakeLines:numRakeLines,firstEdges:numFirstEdges,lastEdges:numLastEdges,allEdges:numLinesWithEdges,linesWithEdges:numLinesWithEdges -[TransformReport] -arraysize=points:numPoints,validPoints:numPoints -[MeterArc] -arraysize=arcCoordPoints:numOfArcCoordPoints -[StructuringElement] -#TODO: arraysize=kernel:matrixRows*matrixCols -exclude_members=kernel -[SpokeReport] -arraysize=spokeLines:numSpokeLines,firstEdges:numFirstEdges,lastEdges:numLastEdges,allEdges:numLinesWithEdges,linesWithEdges:numLinesWithEdges -[ToolWindowOptions] -exclude_members=reserved2,reserved3,reserved4 -[EventCallback] -exclude=True - -; Logical functions -; TODO: constant versions -[imaqAndConstant] -exclude=True -[imaqCompareConstant] -exclude=True -[imaqLogicalDifferenceConstant] -exclude=True -[imaqNandConstant] -exclude=True -[imaqNorConstant] -exclude=True -[imaqOrConstant] -exclude=True -[imaqXnorConstant] -exclude=True -[imaqXorConstant] -exclude=True - -; Arithmetic functions -; TODO: constant versions -[imaqAbsoluteDifferenceConstant] -exclude=True -[imaqAddConstant] -exclude=True -[imaqAverageConstant] -exclude=True -[imaqDivideConstant2] -exclude=True -[imaqMaxConstant2] -exclude=True -[imaqMinConstant] -exclude=True -[imaqModuloConstant] -exclude=True -[imaqMultiplyConstant] -exclude=True -[imaqSubtractConstant] -exclude=True - -; Particle Analysis functions -[imaqCountParticles] -outparams=numParticles -[imaqMeasureParticle] -outparams=value -[imaqMeasureParticles] -arraysize=measurements:numMeasurements -[imaqParticleFilter4] -arraysize=criteria:criteriaCount -outparams=numParticles -nullok=roi - -; Morphology functions -[imaqFindCircles] -retarraysize=numCircles -[imaqLabel2] -outparams=particleCount -[imaqMorphology] -nullok=structuringElement -[imaqSeparation] -nullok=structuringElement -[imaqSimpleDistance] -nullok=structuringElement -[imaqSizeFilter] -nullok=structuringElement - -; Acquisition functions -[imaqCopyFromRing] -nullok=image,imageNumber -outparams=imageNumber -retref=image -[imaqExtractFromRing] -nullok=imageNumber -outparams=imageNumber -retunowned=True -[imaqGrab] -nullok=image -retref=image -[imaqSetupRing] -arraysize=images:numImages -inparams=images -[imaqSetupSequence] -arraysize=images:numImages -inparams=images -[imaqSnap] -nullok=image -retref=image - -; Caliper functions -[imaqCaliperTool] -retarraysize=numEdgePairs -arraysize=points:numPoints -[imaqDetectExtremes] -retarraysize=numExtremes -arraysize=pixels:numPixels -[imaqFindTransformRect2] -outparams=baseSystem,newSystem,axisReport -[imaqFindTransformRects2] -outparams=baseSystem,newSystem,axisReport -[imaqSimpleEdge] -retarraysize=numEdges -arraysize=points:numPoints - -; Spatial Filters functions -[imaqCannyEdgeFilter] -nullok=options -[imaqConvolve2] -inparams=kernel -exclude=True -[imaqEdgeFilter] -nullok=mask -[imaqLowPass] -nullok=mask -[imaqMedianFilter] -nullok=mask -[imaqNthOrderFilter] -nullok=mask - -; Drawing functions -[imaqDrawTextOnImage] -nullok=options,fontNameUsed - -; Interlacing functions -[imaqInterlaceSeparate] -nullok=odd,even - -; Image Information functions -[imaqEnumerateCustomKeys] -retarraysize=size -[imaqGetImageSize] -nullok=width,height -[imaqGetPixelAddress] -underscored=True -exclude=True -[imaqReadCustomData] -retsize=size -retunowned=True -[imaqWriteCustomData] -size=data:size - -; Display functions -[imaqGetLastKey] -nullok=keyPressed,windowNumber,modifiers -[imaqGetSystemWindowHandle] -exclude=True -[imaqGetWindowCenterPos] -outparams=centerPosition - -; Image Manipulation functions -[imaqCast] -nullok=lookup -exclude=True -[imaqFlatten] -retsize=size -[imaqRotate2] -# TODO because of PixelValue -exclude=True -[imaqShift] -# TODO because of PixelValue -exclude=True -[imaqUnflatten] -size=data:size - -; File I/O functions -[imaqGetAVIInfo] -outparams=info -[imaqGetFileInfo] -nullok=calibrationUnit,calibrationX,calibrationY,width,height,imageType -[imaqGetFilterNames] -retarraysize=numFilters -[imaqLoadImagePopup] -retarraysize=numPaths -[imaqReadAVIFrame] -size=data:dataSize -# unclear whether dataSize is input or output parameter -exclude=True -[imaqReadFile] -;nullok=colorTable,numColors -;arraysize=colorTable:numColors -[imaqWriteAVIFrame] -size=data:dataLength -[imaqWriteBMPFile] -nullok=colorTable -defaults=colorTable:null -[imaqWriteFile] -nullok=colorTable -defaults=colorTable:null -[imaqWriteJPEGFile] -nullok=colorTable -defaults=colorTable:null -inparams=colorTable -[imaqWritePNGFile2] -nullok=colorTable -defaults=colorTable:null -[imaqWriteTIFFFile] -nullok=options,colorTable -defaults=options:null,colorTable:null - -; Analytic Geometry functions -[imaqBuildCoordinateSystem] -outparams=system -[imaqFitCircle2] -arraysize=points:numPoints -[imaqFitEllipse2] -arraysize=points:numPoints -[imaqFitLine] -arraysize=points:numPoints -[imaqGetBisectingLine] -outparams=bisectStart,bisectEnd -[imaqGetIntersection] -outparams=intersection -[imaqGetMidLine] -outparams=midLineStart,midLineEnd -[imaqGetPerpendicularLine] -outparams=perpLineStart,perpLineEnd -[imaqGetPointsOnContour] -retarraysize=numSegments -[imaqGetPointsOnLine] -retarraysize=numPoints -[imaqInterpolatePoints] -retarraysize=interpCount -arraysize=points:numPoints - -; Clipboard functions -[imaqClipboardToImage] -nullok=palette -[imaqImageToClipboard] -nullok=palette - -; Image Management functions -[imaqCreateImage] -defaults=borderSize:0 -[imaqImageToArray] -nullok=columns,rows -underscored=True -exclude=True - -; Color Processing functions -[imaqChangeColorSpace2] -# TODO because of Color2 -exclude=True -[imaqColorBCGTransform] -nullok=redOptions,greenOptions,blueOptions,mask -[imaqColorHistogram2] -nullok=mask -[imaqColorLookup] -nullok=mask,plane1,plane2,plane3 -exclude=True -[imaqColorThreshold] -nullok=plane1Range,plane2Range,plane3Range - -; Transform functions -[imaqBCGTransform] -nullok=mask -[imaqEqualize] -nullok=mask -[imaqInverse] -nullok=mask -[imaqMathTransform] -nullok=mask -[imaqLookup2] -nullok=mask -exclude=True - -; Window Management functions -[imaqGetMousePos] -nullok=position,windowNumber -[imaqGetWindowBackground] -outparams=backgroundColor -[imaqGetWindowDisplayMapping] -outparams=mapping -[imaqGetWindowGrid] -nullok=xResolution,yResolution -[imaqGetWindowPos] -outparams=position -[imaqGetWindowSize] -nullok=width,height -[imaqSetWindowPalette] -arraysize=palette:numColors -nullok=palette - -; Utilities functions -; Many Make* functions are faster in native Python -[imaqGetKernel] -exclude=True -[imaqMakeAnnulus] -exclude=True -[imaqMakePoint] -exclude=True -[imaqMakePointFloat] -exclude=True -[imaqMakeRect] -exclude=True -[imaqMakeRectFromRotatedRect] -exclude=True -[imaqMakeRotatedRect] -exclude=True -[imaqMakeRotatedRectFromRect] -exclude=True -[imaqMulticoreOptions] -underscored=True - -; Tool Window functions -[imaqGetLastEvent] -nullok=windowNumber,tool,rect -outparams=type,tool,rect -[imaqGetToolWindowHandle] -exclude=True -[imaqGetToolWindowPos] -outparams=position -[imaqSetEventCallback] -exclude=True -[imaqSetupToolWindow] -nullok=options - -; Meter functions -[imaqReadMeter] -outparams=endOfNeedle - -; Calibration functions -[imaqCorrectCalibratedImage] -# TODO because of PixelValue -exclude=True -[imaqTransformPixelToRealWorld] -arraysize=pixelCoordinates:numCoordinates -[imaqTransformRealWorldToPixel] -arraysize=realWorldCoordinates:numCoordinates - -; Pixel Manipulation functions -[imaqArrayToComplexPlane] -exclude=True -[imaqComplexPlaneToArray] -nullok=columns,rows -underscored=True -exclude=True -[imaqExtractColorPlanes] -nullok=plane1,plane2,plane3 -[imaqFillImage] -nullok=mask -# TODO because of PixelValue -exclude=True -[imaqGetLine] -nullok=numPoints -underscored=True -exclude=True -[imaqGetPixel] -outparams=value -# TODO because of PixelValue -exclude=True -[imaqReplaceColorPlanes] -nullok=plane1,plane2,plane3 -[imaqSetLine] -underscored=True -exclude=True -[imaqSetPixel] -# TODO because of PixelValue -exclude=True - -; Color Matching functions -[imaqLearnColor] -nullok=roi -[imaqMatchColor] -retarraysize=numScores -nullok=roi - -; Barcode I/O functions -[imaqGradeDataMatrixBarcodeAIM] -outparams=report -[imaqReadBarcode] -nullok=roi -[imaqReadPDF417Barcode] -retarraysize=numBarcodes -[imaqReadQRCode] -defaults=reserved:IMAQ_QR_NO_GRADING - -; LCD functions -[imaqFindLCDSegments] -nullok=options -[imaqReadLCD] -nullok=options - -; Shape Matching functions -[imaqMatchShape] -retarraysize=numMatches - -; Contours functions -[imaqAddClosedContour] -arraysize=points:numPoints -[imaqAddOpenContour] -arraysize=points:numPoints -[imaqGetContourColor] -outparams=contourColor - -; Regions of Interest functions -[imaqGetROIBoundingBox] -outparams=boundingBox -[imaqGetROIColor] -outparams=roiColor -[imaqSetWindowROI] -nullok=roi - -; Image Analysis functions -[imaqExtractCurves] -retarraysize=numCurves -[imaqHistogram] -nullok=mask -[imaqQuantify] -nullok=mask - -; Error Management functions -[imaqClearError] -exclude=True -[imaqGetErrorText] -exclude=True -[imaqGetLastError] -exclude=True -[imaqGetLastErrorFunc] -exclude=True -[imaqSetError] -nullok=function -exclude=True - -; Threshold functions -[imaqMultithreshold] -arraysize=ranges:numRanges - -; Memory Management functions -[imaqDispose] -# This is done as a full-custom function -exclude=True - -; Pattern Matching functions -[imaqDetectCircles] -retarraysize=numMatchesReturned -[imaqDetectEllipses] -retarraysize=numMatchesReturned -[imaqDetectLines] -retarraysize=numMatchesReturned -[imaqDetectRectangles] -retarraysize=numMatchesReturned -[imaqGetGeometricFeaturesFromCurves] -retarraysize=numFeatures -arraysize=curves:numCurves,featureTypes:numFeatureTypes -[imaqGetGeometricTemplateFeatureInfo] -retarraysize=numFeatures -[imaqLearnMultipleGeometricPatterns] -arraysize=patterns:numberOfPatterns -exclude=True -[imaqMatchColorPattern] -retarraysize=numMatches -[imaqMatchGeometricPattern2] -retarraysize=numMatches -[imaqMatchMultipleGeometricPatterns] -retarraysize=numMatches -[imaqReadMultipleGeometricPatternFile] -underscored=True -[imaqRefineMatches] -retarraysize=numCandidatesOut -arraysize=candidatesIn:numCandidatesIn -[imaqMatchGeometricPattern3] -retarraysize=numMatches -[imaqMatchPattern3] -retarraysize=numMatches -nullok=options - -; Overlay functions -[imaqGetOverlayProperties] -outparams=transformBehaviors -[imaqMergeOverlay] -arraysize=palette:numColors -[imaqOverlayBitmap] -underscored=True -[imaqOverlayClosedContour] -arraysize=points:numPoints -[imaqOverlayOpenContour] -arraysize=points:numPoints -[imaqOverlayPoints] -arraysize=points:numPoints,colors:numColors - -; OCR functions -[imaqVerifyPatterns] -arraysize=expectedPatterns:patternCount -retarraysize=numScores -[imaqVerifyText] -retarraysize=numScores - -; Geometric Matching functions -[imaqContourClassifyCurvature] -arraysize=curvatureClasses:numCurvatureClasses -[imaqContourClassifyDistances] -arraysize=distanceRanges:numDistanceRanges -[imaqContourSetupMatchPattern] -arraysize=rangeSettings:numRangeSettings -[imaqContourAdvancedSetupMatchPattern] -arraysize=geometricOptions:numGeometricOptions - -; Morphology Reconstruction functions -[imaqGrayMorphologyReconstruct] -arraysize=points:numOfPoints -[imaqMorphologyReconstruct] -arraysize=points:numOfPoints - -; Texture functions -[imaqClassificationTextureDefectOptions] -exclude=True -[imaqCooccurrenceMatrix] -exclude=True -[imaqExtractTextureFeatures] -inparams=waveletBands -exclude=True -[imaqExtractWaveletBands] -inparams=waveletBands -exclude=True - -; Regions of Interest Manipulation functions -[imaqMaskToROI] -nullok=withinLimit -[imaqROIToMask] -nullok=imageModel,inSpace -[imaqLabelToROI] -arraysize=labelsIn:numLabelsIn - -; Morphology functions -[imaqGrayMorphology] -nullok=structuringElement - -; Classification functions -[imaqAddClassifierSample] -arraysize=featureVector:vectorSize -[imaqAdvanceClassify] -arraysize=featureVector:vectorSize -[imaqClassify] -arraysize=featureVector:vectorSize -[imaqGetColorClassifierOptions] -outparams=options -[imaqGetNearestNeighborOptions] -outparams=options -;[imaqReadClassifierFile] -;[imaqWriteClassifierFile] - -; Obsolete functions -[imaqWritePNGFile] -nullok=colorTable -defaults=colorTable:null -[imaqRotate] -# TODO because of PixelValue -exclude=True -[imaqSelectParticles] -retarraysize=selectedCount -[imaqGetParticleInfo] -retarraysize=reportCount -[imaqEdgeTool] -retarraysize=numEdges -[imaqCircles] -retarraysize=numCircles -[imaqFitEllipse] -arraysize=points:numPoints -outparams=ellipse -[imaqFitCircle] -arraysize=points:numPoints -outparams=circle -[imaqChangeColorSpace] -# TODO because of Color -exclude=True -[imaqMatchPattern] -retarraysize=numMatches -nullok=options -[imaqLineGaugeTool] -nullok=reference -[imaqBestCircle] -arraysize=points:numPoints -outparams=center -[imaqCoordinateReference] -outparams=origin -[imaqSetWindowOverlay] -nullok=overlay -[imaqGetCalibrationInfo] -outparams=unit,xDistance,yDistance -nullok=unit,xDistance,yDistance -[imaqGetParticleClassifierOptions] -outparams=preprocessingOptions,options -[imaqConvolve] -nullok=mask -inparams=kernel -exclude=True -[imaqDivideConstant] -# TODO because of PixelValue -exclude=True -[imaqLookup] -nullok=mask -exclude=True -[imaqMatchPattern2] -retarraysize=numMatches -nullok=options -[imaqMaxConstant] -# TODO because of PixelValue -exclude=True -[imaqParticleFilter2] -arraysize=criteria:criteriaCount -[imaqEdgeTool2] -retarraysize=numEdges -[imaqReadDataMatrixBarcode] -retarraysize=numBarcodes -[imaqMatchGeometricPattern] -retarraysize=numMatches -[imaqColorHistogram] -nullok=mask -[Priv_ReadJPEGString_C] -arraysize=string:stringLength -inparams=image,string - -; block comment exclusion list -[Block Comment] -exclude= - Includes - Control Defines - Macros - This accomplishes said task. - If using Visual C++, force startup & shutdown code to run. - Error Management functions - Callback Function Type - Backwards Compatibility - Error Codes diff --git a/wpilibj/src/athena/cpp/nivision/nivision_parse.py b/wpilibj/src/athena/cpp/nivision/nivision_parse.py deleted file mode 100644 index 52ffca5be3..0000000000 --- a/wpilibj/src/athena/cpp/nivision/nivision_parse.py +++ /dev/null @@ -1,242 +0,0 @@ -from __future__ import print_function - -import re -import traceback - -__all__ = ["define_after_struct", "defined", "forward_structs", "opaque_structs", "enums", - "structs", "prescan_file", "parse_file", "number_re", "constant_re"] - -# parser regular expressions -number_re = re.compile(r'-?[0-9]+') -constant_re = re.compile(r'[A-Z0-9_]+') -define_re = re.compile(r'^#define\s+(?P(IMAQ|ERR)[A-Z0-9_]+)\s+(?P.*)') -enum_re = re.compile(r'^typedef\s+enum\s+(?P[A-Za-z0-9]+)_enum\s*{') -enum_value_re = re.compile(r'^\s*(?P[A-Za-z0-9_]+)\s*(=\s*(?P-?[0-9A-Fx]+))?\s*,?') -struct_re = re.compile(r'^typedef\s+struct\s+(?P[A-Za-z0-9]+)_struct\s*{') -union_re = re.compile(r'^typedef\s+union\s+(?P[A-Za-z0-9]+)_union\s*{') -func_pointer_re = re.compile( - r'\s*(?P[A-Za-z0-9_*]+)\s*\(\s*[A-Za-z0-9_]*\s*[*]\s*(?P[A-Za-z0-9_]+)\s*\)\s*\((?P[^)]*)\)') -static_const_re = re.compile( - r'^static\s+const\s+(?P[A-Za-z0-9_]+)\s+(?P[A-Za-z0-9_]+)\s*=\s*(?P[^;]+);') -function_re = re.compile( - r'^((IMAQ|NI)_FUNC\s+)?(?P(const\s+)?[A-Za-z0-9_*]+)\s+((IMAQ_STDCALL|NI_FUNC[C]?)\s+)?(?P[A-Za-z0-9_]+)\s*\((?P[^)]*)\);') - -# defines deferred until after structures -define_after_struct = [] -defined = set() -forward_structs = set() -opaque_structs = set() -enums = set() -structs = set() - - -def parse_cdecl(decl): - decl = " ".join(decl.split()) - ctype, sep, name = decl.rpartition(' ') - # look for array[] - name, bracket, arr = name.partition('[') - if arr: - arr = arr[:-1] - else: - arr = None - return name, ctype, arr - - -def split_comment(line): - if line.startswith('/*'): - return "", "" - parts = line.split('//', 1) - code = parts[0].strip() - comment = parts[1].strip() if len(parts) > 1 else None - return code, comment - - -def prescan_file(f): - for line in f: - code, comment = split_comment(line) - if not code and not comment: - continue - - # typedef struct { - m = struct_re.match(code) - if m is not None: - structs.add(m.group('name')) - continue - - # other typedef - if code.startswith("typedef"): - if '(' in code: - continue - name, typedef, arr = parse_cdecl(code[8:-1]) - if typedef.startswith("struct"): - forward_structs.add(name) - continue - - opaque_structs.update(forward_structs - structs) - - -def parse_file(emit, f, block_comment_exclude): - in_block_comment = False - cur_block = "" - in_enum = None - in_struct = None - in_union = None - - for lineno, line in enumerate(f): - code, comment = split_comment(line) - if not code and not comment: - continue - # print(comment) - - # in block comment - if in_block_comment: - if not code and comment is not None and comment[0] == '=': - # closing block comment; emit if not excluded - if cur_block not in block_comment_exclude: - try: - emit.block_comment(cur_block) - except Exception as e: - print("%d: exception in block_comment():\n%s" % ( - lineno + 1, traceback.format_exc())) - in_block_comment = False - # emit "after struct" constants in Globals - if cur_block == "Globals": - for dname, dtext in define_after_struct: - try: - emit.text(dtext) - except Exception as e: - print("%d: exception in text():\n%s" % ( - lineno + 1, traceback.format_exc())) - defined.add(dname) - continue - if not code and comment is not None: - # remember current block - cur_block = comment - continue - - # inside enum - if in_enum is not None: - if code[0] == '}': - # closing - try: - emit.enum(*in_enum) - except Exception as e: - print("%d: exception in enum():\n%s" % (lineno + 1, traceback.format_exc())) - in_enum = None - continue - m = enum_value_re.match(code) - if m is not None: - in_enum[1].append((m.group('name'), m.group('value'), comment)) - continue - - # inside struct/union - if in_struct is not None or in_union is not None: - if code[0] == '}': - # closing - if in_struct is not None: - try: - emit.struct(*in_struct) - except Exception as e: - print("%d: exception in struct(\"%s\"):\n%s" % ( - lineno + 1, in_struct[0], traceback.format_exc())) - in_struct = None - if in_union is not None: - try: - emit.union(*in_union) - except Exception as e: - print("%d: exception in union(\"%s\"):\n%s" % ( - lineno + 1, in_union[0], traceback.format_exc())) - in_union = None - continue - name, ctype, arr = parse_cdecl(code[:-1]) - # add to fields - if in_struct is not None: - in_struct[1].append((name, ctype, arr, comment)) - if in_union is not None: - in_union[1].append((name, ctype, arr, comment)) - continue - - # block comment - if not code and comment is not None and comment[0] == '=': - in_block_comment = True - - # #define - m = define_re.match(code) - if m is not None: - try: - emit.define(m.group('name'), m.group('value').strip(), comment) - except Exception as e: - print("%d: exception in define():\n%s" % (lineno + 1, traceback.format_exc())) - continue - - # typedef enum { - m = enum_re.match(code) - if m is not None: - in_enum = (m.group('name'), []) - continue - - # typedef struct { - m = struct_re.match(code) - if m is not None: - in_struct = (m.group('name'), []) - continue - - # typedef union { - m = union_re.match(code) - if m is not None: - in_union = (m.group('name'), []) - continue - - # other typedef - if code.startswith("typedef"): - # typedef function? - m = func_pointer_re.match(code[8:-1]) - if m is not None: - params = [parse_cdecl(param.strip()) for param in - m.group('params').strip().split(',') if param.strip()] - try: - emit.typedef_function(m.group('name'), m.group('restype'), params) - except Exception as e: - print("%d: exception in typedef_function():\n%s" % ( - lineno + 1, traceback.format_exc())) - continue - if '(' in code: - print("Invalid typedef: %s" % code) - continue - emit.typedef(*parse_cdecl(code[8:-1])) - continue - - # function - m = function_re.match(code) - if m is not None: - params = [parse_cdecl(param.strip()) for param in m.group('params').strip().split(',') - if param.strip()] - try: - emit.function(m.group('name'), m.group('restype'), params) - except Exception as e: - print("%d: exception in function(\"%s\"):\n%s" % ( - lineno + 1, m.group('name'), traceback.format_exc())) - continue - - # static const - m = static_const_re.match(code) - if m is not None: - value = m.group('value') - if value[0] == '{': - value = [v.strip() for v in value[1:-1].strip().split(',') if v.strip()] - try: - emit.static_const(m.group('name'), m.group('type'), value) - except Exception as e: - print("%d: exception in static_const():\n%s" % (lineno + 1, traceback.format_exc())) - continue - - if not code or code[0] == '#': - continue - - if not code or code[0] == '#': - continue - - if code == 'extern "C" {' or code == "}": - continue - - print("%d: Unrecognized: %s" % (lineno + 1, code)) diff --git a/wpilibj/src/athena/java/com/ni/vision/NIVision.java b/wpilibj/src/athena/java/com/ni/vision/NIVision.java deleted file mode 100644 index 6188eebb6b..0000000000 --- a/wpilibj/src/athena/java/com/ni/vision/NIVision.java +++ /dev/null @@ -1,31117 +0,0 @@ -// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -package com.ni.vision; - -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -@SuppressWarnings("all") -public class NIVision { - private NIVision() {} - - private static native void imaqDispose(long addr); - - private static Constructor constructDirectByteBuffer; - private static Field bufferAddressField; - - static { - try { - Class[] cArg = new Class[2]; - cArg[0] = long.class; - cArg[1] = int.class; - constructDirectByteBuffer = - Class.forName("java.nio.DirectByteBuffer").getDeclaredConstructor(cArg); - constructDirectByteBuffer.setAccessible(true); - - bufferAddressField = Buffer.class.getDeclaredField("address"); - bufferAddressField.setAccessible(true); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - - private static ByteBuffer newDirectByteBuffer(long addr, int cap) { - try { - return ((ByteBuffer) (constructDirectByteBuffer.newInstance(addr, cap))).order(ByteOrder - .nativeOrder()); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - - private static long getByteBufferAddress(ByteBuffer bb) { - try { - return bufferAddressField.getLong(bb); - } catch (IllegalAccessException e) { - return 0; - } - } - - public static ByteBuffer sliceByteBuffer(ByteBuffer bb, int offset, int size) { - int pos = bb.position(); - int lim = bb.limit(); - bb.position(offset); - bb.limit(offset + size); - ByteBuffer new_bb = bb.slice().order(ByteOrder.nativeOrder()); - bb.position(pos); - bb.limit(lim); - return new_bb; - } - - public static ByteBuffer getBytes(ByteBuffer bb, byte[] dst, int offset, int size) { - int pos = bb.position(); - bb.position(offset); - bb.get(dst, 0, size); - bb.position(pos); - return bb; - } - - public static ByteBuffer putBytes(ByteBuffer bb, byte[] src, int offset, int size) { - int pos = bb.position(); - bb.position(offset); - bb.put(src, 0, size); - bb.position(pos); - return bb; - } - - private static abstract class DisposedStruct { - protected ByteBuffer backing; - private boolean owned; - - protected DisposedStruct(int size) { - backing = ByteBuffer.allocateDirect(size); - backing.order(ByteOrder.nativeOrder()); - owned = false; - } - - protected DisposedStruct(ByteBuffer backing, int offset, int size) { - this.backing = sliceByteBuffer(backing, offset, size); - owned = false; - } - - private DisposedStruct(long nativeObj, boolean owned, int size) { - backing = newDirectByteBuffer(nativeObj, size); - this.owned = owned; - } - - public void free() { - if (owned) { - imaqDispose(getByteBufferAddress(backing)); - owned = false; - backing = null; - } - } - - @Override - protected void finalize() throws Throwable { - if (owned) - imaqDispose(getByteBufferAddress(backing)); - super.finalize(); - } - - public long getAddress() { - if (backing == null) - return 0; - write(); - return getByteBufferAddress(backing); - } - - protected void setBuffer(ByteBuffer backing, int offset, int size) { - this.backing = sliceByteBuffer(backing, offset, size); - } - - abstract public void read(); - - abstract public void write(); - - abstract public int size(); - } - - private static abstract class OpaqueStruct { - private long nativeObj; - private boolean owned; - - protected OpaqueStruct() { - nativeObj = 0; - owned = false; - } - - protected OpaqueStruct(long nativeObj, boolean owned) { - this.nativeObj = nativeObj; - this.owned = owned; - } - - public void free() { - if (owned && nativeObj != 0) { - imaqDispose(nativeObj); - owned = false; - nativeObj = 0; - } - } - - @Override - protected void finalize() throws Throwable { - if (owned && nativeObj != 0) - imaqDispose(nativeObj); - super.finalize(); - } - - public long getAddress() { - return nativeObj; - } - } - - public static class RawData { - private ByteBuffer buf; - private boolean owned; - - public RawData() { - owned = false; - } - - public RawData(ByteBuffer buf) { - this.buf = buf; - owned = false; - } - - private RawData(long nativeObj, boolean owned, int size) { - buf = newDirectByteBuffer(nativeObj, size); - this.owned = owned; - } - - public void free() { - if (owned) { - imaqDispose(getByteBufferAddress(buf)); - owned = false; - buf = null; - } - } - - @Override - protected void finalize() throws Throwable { - if (owned) - imaqDispose(getByteBufferAddress(buf)); - super.finalize(); - } - - public long getAddress() { - if (buf == null) - return 0; - return getByteBufferAddress(buf); - } - - public ByteBuffer getBuffer() { - return buf; - } - - public void setBuffer(ByteBuffer buf) { - if (owned) - free(); - this.buf = buf; - } - } - - private static long getPointer(ByteBuffer bb, int offset) { - return (long) bb.getInt(offset); - } - - private static void putPointer(ByteBuffer bb, int offset, long address) { - bb.putInt(offset, (int) address); - } - - private static void putPointer(ByteBuffer bb, int offset, ByteBuffer buf) { - if (buf == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int) getByteBufferAddress(buf)); - } - - private static void putPointer(ByteBuffer bb, int offset, DisposedStruct struct) { - if (struct == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int) struct.getAddress()); - } - - private static void putPointer(ByteBuffer bb, int offset, OpaqueStruct struct) { - if (struct == null) - bb.putInt(offset, 0); - else - bb.putInt(offset, (int) struct.getAddress()); - } - - /** - * Opaque Structures - */ - - public static class CharSet extends OpaqueStruct { - private CharSet() {} - - private CharSet(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - public static class ClassifierSession extends OpaqueStruct { - private ClassifierSession() {} - - private ClassifierSession(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - public static class Image extends OpaqueStruct { - private Image() {} - - private Image(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - public static class MultipleGeometricPattern extends OpaqueStruct { - private MultipleGeometricPattern() {} - - private MultipleGeometricPattern(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - public static class Overlay extends OpaqueStruct { - private Overlay() {} - - private Overlay(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - public static class ROI extends OpaqueStruct { - private ROI() {} - - private ROI(long nativeObj, boolean owned) { - super(nativeObj, owned); - } - } - - /** - * Manifest Constants - */ - public static final boolean DEFAULT_SHOW_COORDINATES = true; - public static final int DEFAULT_MAX_ICONS_PER_LINE = 4; - public static final boolean DEFAULT_BMP_COMPRESS = false; - public static final int DEFAULT_PNG_QUALITY = 750; - public static final int DEFAULT_JPEG_QUALITY = 750; - public static final int ALL_CONTOURS = -1; - public static final int ALL_WINDOWS = -1; - public static final int SHIFT = 1; - public static final int ALT = 2; - public static final int CTRL = 4; - public static final int CAPS_LOCK = 8; - public static final int MODAL_DIALOG = -1; - public static final int USE_DEFAULT_QUALITY = -1; - public static final int ALL_SAMPLES = -1; - public static final int ALL_OBJECTS = -1; - public static final int ALL_CHARACTERS = -1; - - /** - * Predefined Valid Characters - */ - public static final byte[] ANY_CHARACTER = {0}; - public static final byte[] ALPHABETIC = {0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, - 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0}; - public static final byte[] ALPHANUMERIC = {0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, - 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, - 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0}; - public static final byte[] UPPERCASE_LETTERS = {0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0}; - public static final byte[] LOWERCASE_LETTERS = {0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0}; - public static final byte[] DECIMAL_DIGITS = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0}; - public static final byte[] HEXADECIMAL_DIGITS = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0}; - public static final byte[] PATTERN = {0x5c, 0x78, 0x46, 0x46, 0}; - public static final byte[] FORCE_SPACE = {0x20, 0}; - - /** - * Enumerated Types - */ - - public static enum PointSymbol { - POINT_AS_PIXEL(0), // A single pixel represents a point in the overlay. - POINT_AS_CROSS(1), // A cross represents a point in the overlay. - POINT_USER_DEFINED(2), // The pattern supplied by the user represents a - // point in the overlay. - ; - private final int value; - - private PointSymbol(int value) { - this.value = value; - } - - public static PointSymbol fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MeasurementValue { - AREA(0), // Surface area of the particle in pixels. - AREA_CALIBRATED(1), // Surface area of the particle in calibrated units. - NUM_HOLES(2), // Number of holes in the particle. - AREA_OF_HOLES(3), // Surface area of the holes in calibrated units. - TOTAL_AREA(4), // Total surface area (holes and particle) in calibrated - // units. - IMAGE_AREA(5), // Surface area of the entire image in calibrated units. - PARTICLE_TO_IMAGE(6), // Ratio, expressed as a percentage, of the surface - // area of a particle in relation to the total area of - // the particle. - PARTICLE_TO_TOTAL(7), // Ratio, expressed as a percentage, of the surface - // area of a particle in relation to the total area of - // the particle. - CENTER_MASS_X(8), // X-coordinate of the center of mass. - CENTER_MASS_Y(9), // Y-coordinate of the center of mass. - LEFT_COLUMN(10), // Left edge of the bounding rectangle. - TOP_ROW(11), // Top edge of the bounding rectangle. - RIGHT_COLUMN(12), // Right edge of the bounding rectangle. - BOTTOM_ROW(13), // Bottom edge of bounding rectangle. - WIDTH(14), // Width of bounding rectangle in calibrated units. - HEIGHT(15), // Height of bounding rectangle in calibrated units. - MAX_SEGMENT_LENGTH(16), // Length of longest horizontal line segment. - MAX_SEGMENT_LEFT_COLUMN(17), // Leftmost x-coordinate of longest horizontal - // line segment. - MAX_SEGMENT_TOP_ROW(18), // Y-coordinate of longest horizontal line segment. - PERIMETER(19), // Outer perimeter of the particle. - PERIMETER_OF_HOLES(20), // Perimeter of all holes within the particle. - SIGMA_X(21), // Sum of the particle pixels on the x-axis. - SIGMA_Y(22), // Sum of the particle pixels on the y-axis. - SIGMA_XX(23), // Sum of the particle pixels on the x-axis squared. - SIGMA_YY(24), // Sum of the particle pixels on the y-axis squared. - SIGMA_XY(25), // Sum of the particle pixels on the x-axis and y-axis. - PROJ_X(26), // Projection corrected in X. - PROJ_Y(27), // Projection corrected in Y. - INERTIA_XX(28), // Inertia matrix coefficient in XX. - INERTIA_YY(29), // Inertia matrix coefficient in YY. - INERTIA_XY(30), // Inertia matrix coefficient in XY. - MEAN_H(31), // Mean length of horizontal segments. - MEAN_V(32), // Mean length of vertical segments. - MAX_INTERCEPT(33), // Length of longest segment of the convex hull. - MEAN_INTERCEPT(34), // Mean length of the chords in an object perpendicular - // to its max intercept. - ORIENTATION(35), // The orientation based on the inertia of the pixels in - // the particle. - EQUIV_ELLIPSE_MINOR(36), // Total length of the axis of the ellipse having - // the same area as the particle and a major axis - // equal to half the max intercept. - ELLIPSE_MAJOR(37), // Total length of major axis having the same area and - // perimeter as the particle in calibrated units. - ELLIPSE_MINOR(38), // Total length of minor axis having the same area and - // perimeter as the particle in calibrated units. - ELLIPSE_RATIO(39), // Fraction of major axis to minor axis. - RECT_LONG_SIDE(40), // Length of the long side of a rectangle having the - // same area and perimeter as the particle in calibrated - // units. - RECT_SHORT_SIDE(41), // Length of the short side of a rectangle having the - // same area and perimeter as the particle in - // calibrated units. - RECT_RATIO(42), // Ratio of rectangle long side to rectangle short side. - ELONGATION(43), // Max intercept/mean perpendicular intercept. - COMPACTNESS(44), // Particle area/(height x width). - HEYWOOD(45), // Particle perimeter/perimeter of the circle having the same - // area as the particle. - TYPE_FACTOR(46), // A complex factor relating the surface area to the moment - // of inertia. - HYDRAULIC(47), // Particle area/particle perimeter. - WADDLE_DISK(48), // Diameter of the disk having the same area as the - // particle in user units. - DIAGONAL(49), // Diagonal of an equivalent rectangle in user units. - ; - private final int value; - - private MeasurementValue(int value) { - this.value = value; - } - - public static MeasurementValue fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ScalingMode { - SCALE_LARGER(0), // The function duplicates pixels to make the image larger. - SCALE_SMALLER(1), // The function subsamples pixels to make the image - // smaller. - ; - private final int value; - - private ScalingMode(int value) { - this.value = value; - } - - public static ScalingMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ScalingMethod { - SCALE_TO_PRESERVE_AREA(0), // Correction functions scale the image such that - // the features in the corrected image have the - // same area as the features in the input image. - SCALE_TO_FIT(1), // Correction functions scale the image such that the - // corrected image is the same size as the input image. - ; - private final int value; - - private ScalingMethod(int value) { - this.value = value; - } - - public static ScalingMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ReferenceMode { - COORD_X_Y(0), // This method requires three elements in the points array. - COORD_ORIGIN_X(1), // This method requires two elements in the points array. - ; - private final int value; - - private ReferenceMode(int value) { - this.value = value; - } - - public static ReferenceMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum RectOrientation { - BASE_INSIDE(0), // Specifies that the base of the rectangular image lies - // along the inside edge of the annulus. - BASE_OUTSIDE(1), // Specifies that the base of the rectangular image lies - // along the outside edge of the annulus. - ; - private final int value; - - private RectOrientation(int value) { - this.value = value; - } - - public static RectOrientation fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ShapeMode { - SHAPE_RECT(1), // The function draws a rectangle. - SHAPE_OVAL(2), // The function draws an oval. - ; - private final int value; - - private ShapeMode(int value) { - this.value = value; - } - - public static ShapeMode fromValue(int val) { - for (ShapeMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum PolarityType { - EDGE_RISING(1), // The edge is a rising edge. - EDGE_FALLING(-1), // The edge is a falling edge. - ; - private final int value; - - private PolarityType(int value) { - this.value = value; - } - - public static PolarityType fromValue(int val) { - for (PolarityType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum SizeType { - KEEP_LARGE(0), // The function keeps large particles remaining after the - // erosion. - KEEP_SMALL(1), // The function keeps small particles eliminated by the - // erosion. - ; - private final int value; - - private SizeType(int value) { - this.value = value; - } - - public static SizeType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Plane3D { - C3D_REAL(0), // The function shows the real part of complex images. - C3D_IMAGINARY(1), // The function shows the imaginary part of complex - // images. - C3D_MAGNITUDE(2), // The function shows the magnitude part of complex - // images. - C3D_PHASE(3), // The function shows the phase part of complex images. - ; - private final int value; - - private Plane3D(int value) { - this.value = value; - } - - public static Plane3D fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum PhotometricMode { - WHITE_IS_ZERO(0), // The function interprets zero-value pixels as white. - BLACK_IS_ZERO(1), // The function interprets zero-value pixels as black. - ; - private final int value; - - private PhotometricMode(int value) { - this.value = value; - } - - public static PhotometricMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ParticleInfoMode { - BASIC_INFO(0), // The function returns only the following elements of each - // report: area, calibratedArea, boundingRect. - ALL_INFO(1), // The function returns all the information about each - // particle. - ; - private final int value; - - private ParticleInfoMode(int value) { - this.value = value; - } - - public static ParticleInfoMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum OutlineMethod { - EDGE_DIFFERENCE(0), // The function uses a method that produces continuous - // contours by highlighting each pixel where an - // intensity variation occurs between itself and its - // three upper-left neighbors. - EDGE_GRADIENT(1), // The function uses a method that outlines contours where - // an intensity variation occurs along the vertical axis. - EDGE_PREWITT(2), // The function uses a method that extracts the outer - // contours of objects. - EDGE_ROBERTS(3), // The function uses a method that outlines the contours - // that highlight pixels where an intensity variation - // occurs along the diagonal axes. - EDGE_SIGMA(4), // The function uses a method that outlines contours and - // details by setting pixels to the mean value found in their - // neighborhood, if their deviation from this value is not - // significant. - EDGE_SOBEL(5), // The function uses a method that extracts the outer - // contours of objects. - ; - private final int value; - - private OutlineMethod(int value) { - this.value = value; - } - - public static OutlineMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MorphologyMethod { - AUTOM(0), // The function uses a transformation that generates simpler - // particles that contain fewer details. - CLOSE(1), // The function uses a transformation that fills tiny holes and - // smooths boundaries. - DILATE(2), // The function uses a transformation that eliminates tiny holes - // isolated in particles and expands the contour of the particles - // according to the template defined by the structuring element. - ERODE(3), // The function uses a transformation that eliminates pixels - // isolated in the background and erodes the contour of particles - // according to the template defined by the structuring element. - GRADIENT(4), // The function uses a transformation that leaves only the - // pixels that would be added by the dilation process or - // eliminated by the erosion process. - GRADIENTOUT(5), // The function uses a transformation that leaves only the - // pixels that would be added by the dilation process. - GRADIENTIN(6), // The function uses a transformation that leaves only the - // pixels that would be eliminated by the erosion process. - HITMISS(7), // The function uses a transformation that extracts each pixel - // located in a neighborhood exactly matching the template - // defined by the structuring element. - OPEN(8), // The function uses a transformation that removes small particles - // and smooths boundaries. - PCLOSE(9), // The function uses a transformation that fills tiny holes and - // smooths the inner contour of particles according to the - // template defined by the structuring element. - POPEN(10), // The function uses a transformation that removes small - // particles and smooths the contour of particles according to - // the template defined by the structuring element. - THICK(11), // The function uses a transformation that adds to an image those - // pixels located in a neighborhood that matches a template - // specified by the structuring element. - THIN(12), // The function uses a transformation that eliminates pixels that - // are located in a neighborhood matching a template specified by - // the structuring element. - ; - private final int value; - - private MorphologyMethod(int value) { - this.value = value; - } - - public static MorphologyMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MeterArcMode { - METER_ARC_ROI(0), // The function uses the roi parameter and ignores the - // base, start, and end parameters. - METER_ARC_POINTS(1), // The function uses the base,start, and end parameters - // and ignores the roi parameter. - ; - private final int value; - - private MeterArcMode(int value) { - this.value = value; - } - - public static MeterArcMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum RakeDirection { - LEFT_TO_RIGHT(0), // The function searches from the left side of the search - // area to the right side of the search area. - RIGHT_TO_LEFT(1), // The function searches from the right side of the search - // area to the left side of the search area. - TOP_TO_BOTTOM(2), // The function searches from the top side of the search - // area to the bottom side of the search area. - BOTTOM_TO_TOP(3), // The function searches from the bottom side of the - // search area to the top side of the search area. - ; - private final int value; - - private RakeDirection(int value) { - this.value = value; - } - - public static RakeDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum TruncateMode { - TRUNCATE_LOW(0), // The function truncates low frequencies. - TRUNCATE_HIGH(1), // The function truncates high frequencies. - ; - private final int value; - - private TruncateMode(int value) { - this.value = value; - } - - public static TruncateMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum AttenuateMode { - ATTENUATE_LOW(0), // The function attenuates low frequencies. - ATTENUATE_HIGH(1), // The function attenuates high frequencies. - ; - private final int value; - - private AttenuateMode(int value) { - this.value = value; - } - - public static AttenuateMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WindowThreadPolicy { - CALLING_THREAD(0), // Using this policy, NI Vision creates windows in the - // thread that makes the first display function call for - // a given window number. - SEPARATE_THREAD(1), // Using this policy, NI Vision creates windows in a - // separate thread and processes messages for the - // windows automatically. - ; - private final int value; - - private WindowThreadPolicy(int value) { - this.value = value; - } - - public static WindowThreadPolicy fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WindowOptions { - WIND_RESIZABLE(1), // When present, the user may resize the window - // interactively. - WIND_TITLEBAR(2), // When present, the title bar on the window is visible. - WIND_CLOSEABLE(4), // When present, the close box is available. - WIND_TOPMOST(8), // When present, the window is always on top. - ; - private final int value; - - private WindowOptions(int value) { - this.value = value; - } - - public static WindowOptions fromValue(int val) { - for (WindowOptions v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum WindowEventType { - NO_EVENT(0), // No event occurred since the last call to imaqGetLastEvent(). - CLICK_EVENT(1), // The user clicked on a window. - DRAW_EVENT(2), // The user drew an ROI in a window. - MOVE_EVENT(3), // The user moved a window. - SIZE_EVENT(4), // The user sized a window. - SCROLL_EVENT(5), // The user scrolled a window. - ACTIVATE_EVENT(6), // The user activated a window. - CLOSE_EVENT(7), // The user closed a window. - DOUBLE_CLICK_EVENT(8), // The user double-clicked in a window. - ; - private final int value; - - private WindowEventType(int value) { - this.value = value; - } - - public static WindowEventType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum VisionInfoType { - ANY_VISION_INFO(0), // The function checks if any extra vision information - // is associated with the image. - PATTERN_MATCHING_INFO(1), // The function checks if any pattern matching - // template information is associated with the - // image. - CALIBRATION_INFO(2), // The function checks if any calibration information - // is associated with the image. - OVERLAY_INFO(3), // The function checks if any overlay information is - // associated with the image. - ; - private final int value; - - private VisionInfoType(int value) { - this.value = value; - } - - public static VisionInfoType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SearchStrategy { - CONSERVATIVE(1), // Instructs the pattern matching algorithm to use the - // largest possible amount of information from the image at - // the expense of slowing down the speed of the algorithm. - BALANCED(2), // Instructs the pattern matching algorithm to balance the - // amount of information from the image it uses with the speed - // of the algorithm. - AGGRESSIVE(3), // Instructs the pattern matching algorithm to use a lower - // amount of information from the image, which allows the - // algorithm to run quickly but at the expense of accuracy. - VERY_AGGRESSIVE(4), // Instructs the pattern matching algorithm to use the - // smallest possible amount of information from the - // image, which allows the algorithm to run at the - // highest speed possible but at the expense of - // accuracy. - ; - private final int value; - - private SearchStrategy(int value) { - this.value = value; - } - - public static SearchStrategy fromValue(int val) { - for (SearchStrategy v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum TwoEdgePolarityType { - NONE(0), // The function ignores the polarity of the edges. - RISING_FALLING(1), // The polarity of the first edge is rising (dark to - // light) and the polarity of the second edge is falling - // (light to dark). - FALLING_RISING(2), // The polarity of the first edge is falling (light to - // dark) and the polarity of the second edge is rising - // (dark to light). - RISING_RISING(3), // The polarity of the first edge is rising (dark to - // light) and the polarity of the second edge is rising - // (dark to light). - FALLING_FALLING(4), // The polarity of the first edge is falling (light to - // dark) and the polarity of the second edge is falling - // (light to dark). - ; - private final int value; - - private TwoEdgePolarityType(int value) { - this.value = value; - } - - public static TwoEdgePolarityType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ObjectType { - BRIGHT_OBJECTS(0), // The function detects bright objects. - DARK_OBJECTS(1), // The function detects dark objects. - ; - private final int value; - - private ObjectType(int value) { - this.value = value; - } - - public static ObjectType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Tool { - NO_TOOL(-1), // No tool is in the selected state. - SELECTION_TOOL(0), // The selection tool selects an existing ROI in an - // image. - POINT_TOOL(1), // The point tool draws a point on the image. - LINE_TOOL(2), // The line tool draws a line on the image. - RECTANGLE_TOOL(3), // The rectangle tool draws a rectangle on the image. - OVAL_TOOL(4), // The oval tool draws an oval on the image. - POLYGON_TOOL(5), // The polygon tool draws a polygon on the image. - CLOSED_FREEHAND_TOOL(6), // The closed freehand tool draws closed freehand - // shapes on the image. - ANNULUS_TOOL(7), // The annulus tool draws annuluses on the image. - ZOOM_TOOL(8), // The zoom tool controls the zoom of an image. - PAN_TOOL(9), // The pan tool shifts the view of the image. - POLYLINE_TOOL(10), // The polyline tool draws a series of connected straight - // lines on the image. - FREEHAND_TOOL(11), // The freehand tool draws freehand lines on the image. - ROTATED_RECT_TOOL(12), // The rotated rectangle tool draws rotated - // rectangles on the image. - ZOOM_OUT_TOOL(13), // The zoom out tool controls the zoom of an image. - ; - private final int value; - - private Tool(int value) { - this.value = value; - } - - public static Tool fromValue(int val) { - for (Tool v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum TIFFCompressionType { - NO_COMPRESSION(0), // The function does not compress the TIFF file. - JPEG(1), // The function uses the JPEG compression algorithm to compress the - // TIFF file. - RUN_LENGTH(2), // The function uses a run length compression algorithm to - // compress the TIFF file. - ZIP(3), // The function uses the ZIP compression algorithm to compress the - // TIFF file. - ; - private final int value; - - private TIFFCompressionType(int value) { - this.value = value; - } - - public static TIFFCompressionType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ThresholdMethod { - THRESH_CLUSTERING(0), // The function uses a method that sorts the histogram - // of the image within a discrete number of classes - // corresponding to the number of phases perceived in - // an image. - THRESH_ENTROPY(1), // The function uses a method that is best for detecting - // particles that are present in minuscule proportions on - // the image. - THRESH_METRIC(2), // The function uses a method that is well-suited for - // images in which classes are not too disproportionate. - THRESH_MOMENTS(3), // The function uses a method that is suited for images - // that have poor contrast. - THRESH_INTERCLASS(4), // The function uses a method that is well-suited for - // images in which classes have well separated pixel - // value distributions. - ; - private final int value; - - private ThresholdMethod(int value) { - this.value = value; - } - - public static ThresholdMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum TextAlignment { - LEFT(0), // Left aligns the text at the reference point. - CENTER(1), // Centers the text around the reference point. - RIGHT(2), // Right aligns the text at the reference point. - ; - private final int value; - - private TextAlignment(int value) { - this.value = value; - } - - public static TextAlignment fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SpokeDirection { - OUTSIDE_TO_INSIDE(0), // The function searches from the outside of the - // search area to the inside of the search area. - INSIDE_TO_OUTSIDE(1), // The function searches from the inside of the search - // area to the outside of the search area. - ; - private final int value; - - private SpokeDirection(int value) { - this.value = value; - } - - public static SpokeDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SkeletonMethod { - SKELETON_L(0), // Uses an L-shaped structuring element in the skeleton - // function. - SKELETON_M(1), // Uses an M-shaped structuring element in the skeleton - // function. - SKELETON_INVERSE(2), // Uses an L-shaped structuring element on an inverse - // of the image in the skeleton function. - ; - private final int value; - - private SkeletonMethod(int value) { - this.value = value; - } - - public static SkeletonMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum VerticalTextAlignment { - BOTTOM(0), // Aligns the bottom of the text at the reference point. - TOP(1), // Aligns the top of the text at the reference point. - BASELINE(2), // Aligns the baseline of the text at the reference point. - ; - private final int value; - - private VerticalTextAlignment(int value) { - this.value = value; - } - - public static VerticalTextAlignment fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum CalibrationROI { - FULL_IMAGE(0), // The correction function corrects the whole image, - // regardless of the user-defined or calibration-defined - // ROIs. - CALIBRATION_ROI(1), // The correction function corrects the area defined by - // the calibration ROI. - USER_ROI(2), // The correction function corrects the area defined by the - // user-defined ROI. - CALIBRATION_AND_USER_ROI(3), // The correction function corrects the area - // defined by the intersection of the - // user-defined ROI and the calibration ROI. - CALIBRATION_OR_USER_ROI(4), // The correction function corrects the area - // defined by the union of the user-defined ROI - // and the calibration ROI. - ; - private final int value; - - private CalibrationROI(int value) { - this.value = value; - } - - public static CalibrationROI fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ContourType { - EMPTY_CONTOUR(0), // The contour is empty. - POINT(1), // The contour represents a point. - LINE(2), // The contour represents a line. - RECT(3), // The contour represents a rectangle. - OVAL(4), // The contour represents an oval. - CLOSED_CONTOUR(5), // The contour represents a series of connected points - // where the last point connects to the first. - OPEN_CONTOUR(6), // The contour represents a series of connected points - // where the last point does not connect to the first. - ANNULUS(7), // The contour represents an annulus. - ROTATED_RECT(8), // The contour represents a rotated rectangle. - ; - private final int value; - - private ContourType(int value) { - this.value = value; - } - - public static ContourType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MathTransformMethod { - TRANSFORM_LINEAR(0), // The function uses linear remapping. - TRANSFORM_LOG(1), // The function uses logarithmic remapping. - TRANSFORM_EXP(2), // The function uses exponential remapping. - TRANSFORM_SQR(3), // The function uses square remapping. - TRANSFORM_SQRT(4), // The function uses square root remapping. - TRANSFORM_POWX(5), // The function uses power X remapping. - TRANSFORM_POW1X(6), // The function uses power 1/X remapping. - ; - private final int value; - - private MathTransformMethod(int value) { - this.value = value; - } - - public static MathTransformMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ComplexPlane { - REAL(0), // The function operates on the real plane of the complex image. - IMAGINARY(1), // The function operates on the imaginary plane of the complex - // image. - MAGNITUDE(2), // The function operates on the magnitude plane of the complex - // image. - PHASE(3), // The function operates on the phase plane of the complex image. - ; - private final int value; - - private ComplexPlane(int value) { - this.value = value; - } - - public static ComplexPlane fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum PaletteType { - PALETTE_GRAY(0), // The function uses a palette that has a gradual - // gray-level variation from black to white. - PALETTE_BINARY(1), // The function uses a palette of 16 cycles of 16 - // different colors that is useful with binary images. - PALETTE_GRADIENT(2), // The function uses a palette that has a gradation - // from red to white with a prominent range of light - // blue in the upper value range. - PALETTE_RAINBOW(3), // The function uses a palette that has a gradation from - // blue to red with a prominent range of greens in the - // middle value range. - PALETTE_TEMPERATURE(4), // The function uses a palette that has a gradation - // from light brown to dark brown. - PALETTE_USER(5), // The function uses a palette defined by the user. - ; - private final int value; - - private PaletteType(int value) { - this.value = value; - } - - public static PaletteType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ColorSensitivity { - SENSITIVITY_LOW(0), // Instructs the algorithm to divide the hue plane into - // a low number of sectors, allowing for simple color - // analysis. - SENSITIVITY_MED(1), // Instructs the algorithm to divide the hue plane into - // a medium number of sectors, allowing for color - // analysis that balances sensitivity and complexity. - SENSITIVITY_HIGH(2), // Instructs the algorithm to divide the hue plane into - // a high number of sectors, allowing for complex, - // sensitive color analysis. - ; - private final int value; - - private ColorSensitivity(int value) { - this.value = value; - } - - public static ColorSensitivity fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ColorMode { - RGB(0), // The function operates in the RGB (Red, Blue, Green) color space. - HSL(1), // The function operates in the HSL (Hue, Saturation, Luminance) - // color space. - HSV(2), // The function operates in the HSV (Hue, Saturation, Value) color - // space. - HSI(3), // The function operates in the HSI (Hue, Saturation, Intensity) - // color space. - CIE(4), // The function operates in the CIE L*a*b* color space. - CIEXYZ(5), // The function operates in the CIE XYZ color space. - ; - private final int value; - - private ColorMode(int value) { - this.value = value; - } - - public static ColorMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DetectionMode { - DETECT_PEAKS(0), // The function detects peaks. - DETECT_VALLEYS(1), // The function detects valleys. - ; - private final int value; - - private DetectionMode(int value) { - this.value = value; - } - - public static DetectionMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum CalibrationUnit { - UNDEFINED(0), // The image does not have a defined unit of measurement. - ANGSTROM(1), // The unit of measure for the image is angstroms. - MICROMETER(2), // The unit of measure for the image is micrometers. - MILLIMETER(3), // The unit of measure for the image is millimeters. - CENTIMETER(4), // The unit of measure for the image is centimeters. - METER(5), // The unit of measure for the image is meters. - KILOMETER(6), // The unit of measure for the image is kilometers. - MICROINCH(7), // The unit of measure for the image is microinches. - INCH(8), // The unit of measure for the image is inches. - FOOT(9), // The unit of measure for the image is feet. - NAUTICMILE(10), // The unit of measure for the image is nautical miles. - GROUNDMILE(11), // The unit of measure for the image is ground miles. - STEP(12), // The unit of measure for the image is steps. - ; - private final int value; - - private CalibrationUnit(int value) { - this.value = value; - } - - public static CalibrationUnit fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ConcentricRakeDirection { - COUNTER_CLOCKWISE(0), // The function searches the search area in a - // counter-clockwise direction. - CLOCKWISE(1), // The function searches the search area in a clockwise - // direction. - ; - private final int value; - - private ConcentricRakeDirection(int value) { - this.value = value; - } - - public static ConcentricRakeDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum CalibrationMode { - PERSPECTIVE(0), // Functions correct for distortion caused by the camera's - // perspective. - NONLINEAR(1), // Functions correct for distortion caused by the camera's - // lens. - SIMPLE_CALIBRATION(2), // Functions do not correct for distortion. - CORRECTED_IMAGE(3), // The image is already corrected. - ; - private final int value; - - private CalibrationMode(int value) { - this.value = value; - } - - public static CalibrationMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum BrowserLocation { - INSERT_FIRST_FREE(0), // Inserts the thumbnail in the first available cell. - INSERT_END(1), // Inserts the thumbnail after the last occupied cell. - ; - private final int value; - - private BrowserLocation(int value) { - this.value = value; - } - - public static BrowserLocation fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum BrowserFrameStyle { - RAISED_FRAME(0), // Each thumbnail has a raised frame. - BEVELLED_FRAME(1), // Each thumbnail has a beveled frame. - OUTLINE_FRAME(2), // Each thumbnail has an outlined frame. - HIDDEN_FRAME(3), // Each thumbnail has a hidden frame. - STEP_FRAME(4), // Each thumbnail has a stepped frame. - RAISED_OUTLINE_FRAME(5), // Each thumbnail has a raised, outlined frame. - ; - private final int value; - - private BrowserFrameStyle(int value) { - this.value = value; - } - - public static BrowserFrameStyle fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum BorderMethod { - BORDER_MIRROR(0), // Symmetrically copies pixel values from the image into - // the border. - BORDER_COPY(1), // Copies the value of the pixel closest to the edge of the - // image into the border. - BORDER_CLEAR(2), // Sets all pixels in the border to 0. - ; - private final int value; - - private BorderMethod(int value) { - this.value = value; - } - - public static BorderMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum BarcodeType { - INVALID(-1), // The barcode is not of a type known by NI Vision. - CODABAR(1), // The barcode is of type Codabar. - CODE39(2), // The barcode is of type Code 39. - CODE93(4), // The barcode is of type Code 93. - CODE128(8), // The barcode is of type Code 128. - EAN8(16), // The barcode is of type EAN 8. - EAN13(32), // The barcode is of type EAN 13. - I2_OF_5(64), // The barcode is of type Code 25. - MSI(128), // The barcode is of type MSI code. - UPCA(256), // The barcode is of type UPC A. - PHARMACODE(512), // The barcode is of type Pharmacode. - RSS_LIMITED(1024), // The barcode is of type RSS Limited. - ; - private final int value; - - private BarcodeType(int value) { - this.value = value; - } - - public static BarcodeType fromValue(int val) { - for (BarcodeType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum AxisOrientation { - DIRECT(0), // The y-axis direction corresponds to the y-axis direction of - // the Cartesian coordinate system. - INDIRECT(1), // The y-axis direction corresponds to the y-axis direction of - // an image. - ; - private final int value; - - private AxisOrientation(int value) { - this.value = value; - } - - public static AxisOrientation fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ColorIgnoreMode { - IGNORE_NONE(0), // Specifies that the function does not ignore any pixels. - IGNORE_BLACK(1), // Specifies that the function ignores black pixels. - IGNORE_WHITE(2), // Specifies that the function ignores white pixels. - IGNORE_BLACK_AND_WHITE(3), // Specifies that the function ignores black - // pixels and white pixels. - ; - private final int value; - - private ColorIgnoreMode(int value) { - this.value = value; - } - - public static ColorIgnoreMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum LevelType { - ABSOLUTE(0), // The function evaluates the threshold and hysteresis values - // as absolute values. - RELATIVE(1), // The function evaluates the threshold and hysteresis values - // relative to the dynamic range of the given path. - ; - private final int value; - - private LevelType(int value) { - this.value = value; - } - - public static LevelType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MatchingMode { - MATCH_SHIFT_INVARIANT(1), // Searches for occurrences of the template image - // anywhere in the searchRect, assuming that the - // pattern is not rotated more than plus or minus - // 4 degrees. - MATCH_ROTATION_INVARIANT(2), // Searches for occurrences of the pattern in - // the image with no restriction on the - // rotation of the pattern. - ; - private final int value; - - private MatchingMode(int value) { - this.value = value; - } - - public static MatchingMode fromValue(int val) { - for (MatchingMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum MappingMethod { - FULL_DYNAMIC(0), // (Obsolete) When the image bit depth is 0, the function - // maps the full dynamic range of the 16-bit image to an - // 8-bit scale. - DOWNSHIFT(1), // (Obsolete) When the image bit depth is 0, the function - // shifts the 16-bit image pixels to the right the number of - // times specified by the shiftCount element of the - // DisplayMapping structure. - RANGE(2), // (Obsolete) When the image bit depth is 0, the function maps the - // pixel values in the range specified by the minimumValue and - // maximumValue elements of the DisplayMapping structure to an - // 8-bit scale. - C90_PCT_DYNAMIC(3), // (Obsolete) When the image bit depth to 0, the - // function maps the dynamic range containing the middle - // 90 percent of the cumulated histogram of the image to - // an 8-bit (256 grayscale values) scale. - PERCENT_RANGE(4), // (Obsolete) When the image bit depth is 0, the function - // maps the pixel values in the relative percentage range - // (0 to 100) of the cumulated histogram specified by - // minimumValue and maximumValue to an 8-bit scale. - DEFAULT_MAPPING(10), // If the bit depth is 0, the function maps the 16-bit - // image to 8 bits by following the - // IMAQ_FULL_DYNAMIC_ALWAYS behavior; otherwise, the - // function shifts the image data to the right - // according to the IMAQ_MOST_SIGNIFICANT behavior. - MOST_SIGNIFICANT(11), // The function shifts the 16-bit image pixels to the - // right until the 8 most significant bits of the - // image data are remaining. - FULL_DYNAMIC_ALWAYS(12), // The function maps the full dynamic range of the - // 16-bit image to an 8-bit scale. - DOWNSHIFT_ALWAYS(13), // The function shifts the 16-bit image pixels to the - // right the number of times specified by the - // shiftCount element of the DisplayMapping structure. - RANGE_ALWAYS(14), // The function maps the pixel values in the range - // specified by the minimumValue and maximumValue elements - // of the DisplayMapping structure to an 8-bit scale. - C90_PCT_DYNAMIC_ALWAYS(15), // The function maps the dynamic range - // containing the middle 90 percent of the - // cumulated histogram of the image to an 8-bit - // (256 grayscale values) scale. - PERCENT_RANGE_ALWAYS(16), // The function maps the pixel values in the - // relative percentage range (0 to 100) of the - // cumulated histogram specified by minimumValue - // and maximumValue to an 8-bit scale. - ; - private final int value; - - private MappingMethod(int value) { - this.value = value; - } - - public static MappingMethod fromValue(int val) { - for (MappingMethod v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ComparisonFunction { - CLEAR_LESS(0), // The comparison is true if the source pixel value is less - // than the comparison image pixel value. - CLEAR_LESS_OR_EQUAL(1), // The comparison is true if the source pixel value - // is less than or equal to the comparison image - // pixel value. - CLEAR_EQUAL(2), // The comparison is true if the source pixel value is equal - // to the comparison image pixel value. - CLEAR_GREATER_OR_EQUAL(3), // The comparison is true if the source pixel - // value is greater than or equal to the - // comparison image pixel value. - CLEAR_GREATER(4), // The comparison is true if the source pixel value is - // greater than the comparison image pixel value. - ; - private final int value; - - private ComparisonFunction(int value) { - this.value = value; - } - - public static ComparisonFunction fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum LineGaugeMethod { - EDGE_TO_EDGE(0), // Measures from the first edge on the line to the last - // edge on the line. - EDGE_TO_POINT(1), // Measures from the first edge on the line to the end - // point of the line. - POINT_TO_EDGE(2), // Measures from the start point of the line to the first - // edge on the line. - POINT_TO_POINT(3), // Measures from the start point of the line to the end - // point of the line. - ; - private final int value; - - private LineGaugeMethod(int value) { - this.value = value; - } - - public static LineGaugeMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Direction3D { - C3D_NW(0), // The viewing angle for the 3D image is from the northwest. - C3D_SW(1), // The viewing angle for the 3D image is from the southwest. - C3D_SE(2), // The viewing angle for the 3D image is from the southeast. - C3D_NE(3), // The viewing angle for the 3D image is from the northeast. - ; - private final int value; - - private Direction3D(int value) { - this.value = value; - } - - public static Direction3D fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum LearningMode { - LEARN_ALL(0), // The function extracts information for shift- and - // rotation-invariant matching. - LEARN_SHIFT_INFORMATION(1), // The function extracts information for - // shift-invariant matching. - LEARN_ROTATION_INFORMATION(2), // The function extracts information for - // rotation-invariant matching. - ; - private final int value; - - private LearningMode(int value) { - this.value = value; - } - - public static LearningMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum KernelFamily { - GRADIENT_FAMILY(0), // The kernel is in the gradient family. - LAPLACIAN_FAMILY(1), // The kernel is in the Laplacian family. - SMOOTHING_FAMILY(2), // The kernel is in the smoothing family. - GAUSSIAN_FAMILY(3), // The kernel is in the Gaussian family. - ; - private final int value; - - private KernelFamily(int value) { - this.value = value; - } - - public static KernelFamily fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum InterpolationMethod { - ZERO_ORDER(0), // The function uses an interpolation method that - // interpolates new pixel values using the nearest valid - // neighboring pixel. - BILINEAR(1), // The function uses an interpolation method that interpolates - // new pixel values using a bidirectional average of the - // neighboring pixels. - QUADRATIC(2), // The function uses an interpolation method that interpolates - // new pixel values using a quadratic approximating - // polynomial. - CUBIC_SPLINE(3), // The function uses an interpolation method that - // interpolates new pixel values by fitting them to a cubic - // spline curve, where the curve is based on known pixel - // values from the image. - BILINEAR_FIXED(4), // The function uses an interpolation method that - // interpolates new pixel values using a bidirectional - // average of the neighboring pixels. - ; - private final int value; - - private InterpolationMethod(int value) { - this.value = value; - } - - public static InterpolationMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ImageType { - IMAGE_U8(0), // The image type is 8-bit unsigned integer grayscale. - IMAGE_U16(7), // The image type is 16-bit unsigned integer grayscale. - IMAGE_I16(1), // The image type is 16-bit signed integer grayscale. - IMAGE_SGL(2), // The image type is 32-bit floating-point grayscale. - IMAGE_COMPLEX(3), // The image type is complex. - IMAGE_RGB(4), // The image type is RGB color. - IMAGE_HSL(5), // The image type is HSL color. - IMAGE_RGB_U64(6), // The image type is 64-bit unsigned RGB color. - ; - private final int value; - - private ImageType(int value) { - this.value = value; - } - - public static ImageType fromValue(int val) { - for (ImageType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ImageFeatureMode { - COLOR_AND_SHAPE_FEATURES(0), // Instructs the function to use the color and - // the shape features of the color pattern. - COLOR_FEATURES(1), // Instructs the function to use the color features of - // the color pattern. - SHAPE_FEATURES(2), // Instructs the function to use the shape features of - // the color pattern. - ; - private final int value; - - private ImageFeatureMode(int value) { - this.value = value; - } - - public static ImageFeatureMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FontColor { - WHITE(0), // Draws text in white. - BLACK(1), // Draws text in black. - INVERT(2), // Inverts the text pixels. - BLACK_ON_WHITE(3), // Draws text in black with a white background. - WHITE_ON_BLACK(4), // Draws text in white with a black background. - ; - private final int value; - - private FontColor(int value) { - this.value = value; - } - - public static FontColor fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FlipAxis { - HORIZONTAL_AXIS(0), // Flips the image over the central horizontal axis. - VERTICAL_AXIS(1), // Flips the image over the central vertical axis. - CENTER_AXIS(2), // Flips the image over both the central vertical and - // horizontal axes. - DIAG_L_TO_R_AXIS(3), // Flips the image over an axis from the upper left - // corner to lower right corner. - DIAG_R_TO_L_AXIS(4), // Flips the image over an axis from the upper right - // corner to lower left corner. - ; - private final int value; - - private FlipAxis(int value) { - this.value = value; - } - - public static FlipAxis fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum EdgeProcess { - FIRST(0), // The function looks for the first edge. - FIRST_AND_LAST(1), // The function looks for the first and last edge. - ALL(2), // The function looks for all edges. - BEST(3), // The function looks for the best edge. - ; - private final int value; - - private EdgeProcess(int value) { - this.value = value; - } - - public static EdgeProcess fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DrawMode { - DRAW_VALUE(0), // Draws the boundary of the object with the specified pixel - // value. - DRAW_INVERT(2), // Inverts the pixel values of the boundary of the object. - PAINT_VALUE(1), // Fills the object with the given pixel value. - PAINT_INVERT(3), // Inverts the pixel values of the object. - HIGHLIGHT_VALUE(4), // The function fills the object by highlighting the - // enclosed pixels with the color of the object. - ; - private final int value; - - private DrawMode(int value) { - this.value = value; - } - - public static DrawMode fromValue(int val) { - for (DrawMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum NearestNeighborMetric { - METRIC_MAXIMUM(0), // The maximum metric. - METRIC_SUM(1), // The sum metric. - METRIC_EUCLIDEAN(2), // The Euclidean metric. - ; - private final int value; - - private NearestNeighborMetric(int value) { - this.value = value; - } - - public static NearestNeighborMetric fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ReadResolution { - LOW_RESOLUTION(0), // Configures NI Vision to use low resolution during the - // read process. - MEDIUM_RESOLUTION(1), // Configures NI Vision to use medium resolution - // during the read process. - HIGH_RESOLUTION(2), // Configures NI Vision to use high resolution during - // the read process. - ; - private final int value; - - private ReadResolution(int value) { - this.value = value; - } - - public static ReadResolution fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ThresholdMode { - FIXED_RANGE(0), // Performs thresholding using the values you provide in the - // lowThreshold and highThreshold elements of - // OCRProcessingOptions. - COMPUTED_UNIFORM(1), // Calculates a single threshold value for the entire - // ROI. - COMPUTED_LINEAR(2), // Calculates a value on the left side of the ROI, - // calculates a value on the right side of the ROI, and - // linearly fills the middle values from left to right. - COMPUTED_NONLINEAR(3), // Divides the ROI into the number of blocks - // specified by the blockCount element of - // OCRProcessingOptions and calculates a threshold - // value for each block. - ; - private final int value; - - private ThresholdMode(int value) { - this.value = value; - } - - public static ThresholdMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ReadStrategy { - READ_AGGRESSIVE(0), // Configures NI Vision to perform fewer checks when - // analyzing objects to determine if they match trained - // characters. - READ_CONSERVATIVE(1), // Configures NI Vision to perform more checks to - // determine if an object matches a trained character. - ; - private final int value; - - private ReadStrategy(int value) { - this.value = value; - } - - public static ReadStrategy fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MeasurementType { - MT_CENTER_OF_MASS_X(0), // X-coordinate of the point representing the - // average position of the total particle mass, - // assuming every point in the particle has a - // constant density. - MT_CENTER_OF_MASS_Y(1), // Y-coordinate of the point representing the - // average position of the total particle mass, - // assuming every point in the particle has a - // constant density. - MT_FIRST_PIXEL_X(2), // X-coordinate of the highest, leftmost particle - // pixel. - MT_FIRST_PIXEL_Y(3), // Y-coordinate of the highest, leftmost particle - // pixel. - MT_BOUNDING_RECT_LEFT(4), // X-coordinate of the leftmost particle point. - MT_BOUNDING_RECT_TOP(5), // Y-coordinate of highest particle point. - MT_BOUNDING_RECT_RIGHT(6), // X-coordinate of the rightmost particle point. - MT_BOUNDING_RECT_BOTTOM(7), // Y-coordinate of the lowest particle point. - MT_MAX_FERET_DIAMETER_START_X(8), // X-coordinate of the start of the line - // segment connecting the two perimeter - // points that are the furthest apart. - MT_MAX_FERET_DIAMETER_START_Y(9), // Y-coordinate of the start of the line - // segment connecting the two perimeter - // points that are the furthest apart. - MT_MAX_FERET_DIAMETER_END_X(10), // X-coordinate of the end of the line - // segment connecting the two perimeter - // points that are the furthest apart. - MT_MAX_FERET_DIAMETER_END_Y(11), // Y-coordinate of the end of the line - // segment connecting the two perimeter - // points that are the furthest apart. - MT_MAX_HORIZ_SEGMENT_LENGTH_LEFT(12), // X-coordinate of the leftmost pixel - // in the longest row of contiguous - // pixels in the particle. - MT_MAX_HORIZ_SEGMENT_LENGTH_RIGHT(13), // X-coordinate of the rightmost - // pixel in the longest row of - // contiguous pixels in the particle. - MT_MAX_HORIZ_SEGMENT_LENGTH_ROW(14), // Y-coordinate of all of the pixels in - // the longest row of contiguous pixels - // in the particle. - MT_BOUNDING_RECT_WIDTH(16), // Distance between the x-coordinate of the - // leftmost particle point and the x-coordinate - // of the rightmost particle point. - MT_BOUNDING_RECT_HEIGHT(17), // Distance between the y-coordinate of highest - // particle point and the y-coordinate of the - // lowest particle point. - MT_BOUNDING_RECT_DIAGONAL(18), // Distance between opposite corners of the - // bounding rectangle. - MT_PERIMETER(19), // Length of the outer boundary of the particle. - MT_CONVEX_HULL_PERIMETER(20), // Perimeter of the smallest convex polygon - // containing all points in the particle. - MT_HOLES_PERIMETER(21), // Sum of the perimeters of each hole in the - // particle. - MT_MAX_FERET_DIAMETER(22), // Distance between the start and end of the line - // segment connecting the two perimeter points - // that are the furthest apart. - MT_EQUIVALENT_ELLIPSE_MAJOR_AXIS(23), // Length of the major axis of the - // ellipse with the same perimeter and - // area as the particle. - MT_EQUIVALENT_ELLIPSE_MINOR_AXIS(24), // Length of the minor axis of the - // ellipse with the same perimeter and - // area as the particle. - MT_EQUIVALENT_ELLIPSE_MINOR_AXIS_FERET(25), // Length of the minor axis of - // the ellipse with the same - // area as the particle, and - // Major Axis equal in length to - // the Max Feret Diameter. - MT_EQUIVALENT_RECT_LONG_SIDE(26), // Longest side of the rectangle with the - // same perimeter and area as the - // particle. - MT_EQUIVALENT_RECT_SHORT_SIDE(27), // Shortest side of the rectangle with - // the same perimeter and area as the - // particle. - MT_EQUIVALENT_RECT_DIAGONAL(28), // Distance between opposite corners of the - // rectangle with the same perimeter and - // area as the particle. - MT_EQUIVALENT_RECT_SHORT_SIDE_FERET(29), // Shortest side of the rectangle - // with the same area as the - // particle, and longest side equal - // in length to the Max Feret - // Diameter. - MT_AVERAGE_HORIZ_SEGMENT_LENGTH(30), // Average length of a horizontal - // segment in the particle. - MT_AVERAGE_VERT_SEGMENT_LENGTH(31), // Average length of a vertical segment - // in the particle. - MT_HYDRAULIC_RADIUS(32), // The particle area divided by the particle - // perimeter. - MT_WADDEL_DISK_DIAMETER(33), // Diameter of a disk with the same area as the - // particle. - MT_AREA(35), // Area of the particle. - MT_HOLES_AREA(36), // Sum of the areas of each hole in the particle. - MT_PARTICLE_AND_HOLES_AREA(37), // Area of a particle that completely covers - // the image. - MT_CONVEX_HULL_AREA(38), // Area of the smallest convex polygon containing - // all points in the particle. - MT_IMAGE_AREA(39), // Area of the image. - MT_NUMBER_OF_HOLES(41), // Number of holes in the particle. - MT_NUMBER_OF_HORIZ_SEGMENTS(42), // Number of horizontal segments in the - // particle. - MT_NUMBER_OF_VERT_SEGMENTS(43), // Number of vertical segments in the - // particle. - MT_ORIENTATION(45), // The angle of the line that passes through the - // particle Center of Mass about which the particle has - // the lowest moment of inertia. - MT_MAX_FERET_DIAMETER_ORIENTATION(46), // The angle of the line segment - // connecting the two perimeter - // points that are the furthest - // apart. - MT_AREA_BY_IMAGE_AREA(48), // Percentage of the particle Area covering the - // Image Area. - MT_AREA_BY_PARTICLE_AND_HOLES_AREA(49), // Percentage of the particle Area - // in relation to its Particle and - // Holes Area. - MT_RATIO_OF_EQUIVALENT_ELLIPSE_AXES(50), // Equivalent Ellipse Major Axis - // divided by Equivalent Ellipse - // Minor Axis. - MT_RATIO_OF_EQUIVALENT_RECT_SIDES(51), // Equivalent Rect Long Side divided - // by Equivalent Rect Short Side. - MT_ELONGATION_FACTOR(53), // Max Feret Diameter divided by Equivalent Rect - // Short Side (Feret). - MT_COMPACTNESS_FACTOR(54), // Area divided by the product of Bounding Rect - // Width and Bounding Rect Height. - MT_HEYWOOD_CIRCULARITY_FACTOR(55), // Perimeter divided by the circumference - // of a circle with the same area. - MT_TYPE_FACTOR(56), // Factor relating area to moment of inertia. - MT_SUM_X(58), // The sum of all x-coordinates in the particle. - MT_SUM_Y(59), // The sum of all y-coordinates in the particle. - MT_SUM_XX(60), // The sum of all x-coordinates squared in the particle. - MT_SUM_XY(61), // The sum of all x-coordinates times y-coordinates in the - // particle. - MT_SUM_YY(62), // The sum of all y-coordinates squared in the particle. - MT_SUM_XXX(63), // The sum of all x-coordinates cubed in the particle. - MT_SUM_XXY(64), // The sum of all x-coordinates squared times y-coordinates - // in the particle. - MT_SUM_XYY(65), // The sum of all x-coordinates times y-coordinates squared - // in the particle. - MT_SUM_YYY(66), // The sum of all y-coordinates cubed in the particle. - MT_MOMENT_OF_INERTIA_XX(68), // The moment of inertia in the x-direction - // twice. - MT_MOMENT_OF_INERTIA_XY(69), // The moment of inertia in the x and y - // directions. - MT_MOMENT_OF_INERTIA_YY(70), // The moment of inertia in the y-direction - // twice. - MT_MOMENT_OF_INERTIA_XXX(71), // The moment of inertia in the x-direction - // three times. - MT_MOMENT_OF_INERTIA_XXY(72), // The moment of inertia in the x-direction - // twice and the y-direction once. - MT_MOMENT_OF_INERTIA_XYY(73), // The moment of inertia in the x-direction - // once and the y-direction twice. - MT_MOMENT_OF_INERTIA_YYY(74), // The moment of inertia in the y-direction - // three times. - MT_NORM_MOMENT_OF_INERTIA_XX(75), // The normalized moment of inertia in the - // x-direction twice. - MT_NORM_MOMENT_OF_INERTIA_XY(76), // The normalized moment of inertia in the - // x- and y-directions. - MT_NORM_MOMENT_OF_INERTIA_YY(77), // The normalized moment of inertia in the - // y-direction twice. - MT_NORM_MOMENT_OF_INERTIA_XXX(78), // The normalized moment of inertia in - // the x-direction three times. - MT_NORM_MOMENT_OF_INERTIA_XXY(79), // The normalized moment of inertia in - // the x-direction twice and the - // y-direction once. - MT_NORM_MOMENT_OF_INERTIA_XYY(80), // The normalized moment of inertia in - // the x-direction once and the - // y-direction twice. - MT_NORM_MOMENT_OF_INERTIA_YYY(81), // The normalized moment of inertia in - // the y-direction three times. - MT_HU_MOMENT_1(82), // The first Hu moment. - MT_HU_MOMENT_2(83), // The second Hu moment. - MT_HU_MOMENT_3(84), // The third Hu moment. - MT_HU_MOMENT_4(85), // The fourth Hu moment. - MT_HU_MOMENT_5(86), // The fifth Hu moment. - MT_HU_MOMENT_6(87), // The sixth Hu moment. - MT_HU_MOMENT_7(88), // The seventh Hu moment. - ; - private final int value; - - private MeasurementType(int value) { - this.value = value; - } - - public static MeasurementType fromValue(int val) { - for (MeasurementType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum GeometricMatchingMode { - GEOMETRIC_MATCH_SHIFT_INVARIANT(0), // Searches for occurrences of the - // pattern in the image, assuming that - // the pattern is not rotated more than - // plus or minus 5 degrees. - GEOMETRIC_MATCH_ROTATION_INVARIANT(1), // Searches for occurrences of the - // pattern in the image with reduced - // restriction on the rotation of the - // pattern. - GEOMETRIC_MATCH_SCALE_INVARIANT(2), // Searches for occurrences of the - // pattern in the image with reduced - // restriction on the size of the - // pattern. - GEOMETRIC_MATCH_OCCLUSION_INVARIANT(4), // Searches for occurrences of the - // pattern in the image, allowing - // for a specified percentage of the - // pattern to be occluded. - ; - private final int value; - - private GeometricMatchingMode(int value) { - this.value = value; - } - - public static GeometricMatchingMode fromValue(int val) { - for (GeometricMatchingMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ButtonLabel { - BUTTON_OK(0), // The label "OK". - BUTTON_SAVE(1), // The label "Save". - BUTTON_SELECT(2), // The label "Select". - BUTTON_LOAD(3), // The label "Load". - ; - private final int value; - - private ButtonLabel(int value) { - this.value = value; - } - - public static ButtonLabel fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum NearestNeighborMethod { - MINIMUM_MEAN_DISTANCE(0), // The minimum mean distance method. - K_NEAREST_NEIGHBOR(1), // The k-nearest neighbor method. - NEAREST_PROTOTYPE(2), // The nearest prototype method. - ; - private final int value; - - private NearestNeighborMethod(int value) { - this.value = value; - } - - public static NearestNeighborMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRMirrorMode { - QR_MIRROR_MODE_AUTO_DETECT(-2), // The function should determine if the QR - // code is mirrored. - QR_MIRROR_MODE_MIRRORED(1), // The function should expect the QR code to - // appear mirrored. - QR_MIRROR_MODE_NORMAL(0), // The function should expect the QR code to - // appear normal. - ; - private final int value; - - private QRMirrorMode(int value) { - this.value = value; - } - - public static QRMirrorMode fromValue(int val) { - for (QRMirrorMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ColumnProcessingMode { - AVERAGE_COLUMNS(0), // Averages the data extracted for edge detection. - MEDIAN_COLUMNS(1), // Takes the median of the data extracted for edge - // detection. - ; - private final int value; - - private ColumnProcessingMode(int value) { - this.value = value; - } - - public static ColumnProcessingMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FindReferenceDirection { - LEFT_TO_RIGHT_DIRECT(0), // Searches from the left side of the search area - // to the right side of the search area for a - // direct axis. - LEFT_TO_RIGHT_INDIRECT(1), // Searches from the left side of the search area - // to the right side of the search area for an - // indirect axis. - TOP_TO_BOTTOM_DIRECT(2), // Searches from the top of the search area to the - // bottom of the search area for a direct axis. - TOP_TO_BOTTOM_INDIRECT(3), // Searches from the top of the search area to - // the bottom of the search area for an indirect - // axis. - RIGHT_TO_LEFT_DIRECT(4), // Searches from the right side of the search area - // to the left side of the search area for a direct - // axis. - RIGHT_TO_LEFT_INDIRECT(5), // Searches from the right side of the search - // area to the left side of the search area for - // an indirect axis. - BOTTOM_TO_TOP_DIRECT(6), // Searches from the bottom of the search area to - // the top of the search area for a direct axis. - BOTTOM_TO_TOP_INDIRECT(7), // Searches from the bottom of the search area to - // the top of the search area for an indirect - // axis. - ; - private final int value; - - private FindReferenceDirection(int value) { - this.value = value; - } - - public static FindReferenceDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MulticoreOperation { - GET_CORES(0), // The number of processor cores NI Vision is currently using. - SET_CORES(1), // The number of processor cores for NI Vision to use. - USE_MAX_AVAILABLE(2), // Use the maximum number of available processor - // cores. - ; - private final int value; - - private MulticoreOperation(int value) { - this.value = value; - } - - public static MulticoreOperation fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum GroupBehavior { - GROUP_CLEAR(0), // Sets the behavior of the overlay group to clear the - // current settings when an image is transformed. - GROUP_KEEP(1), // Sets the behavior of the overlay group to keep the current - // settings when an image is transformed. - GROUP_TRANSFORM(2), // Sets the behavior of the overlay group to transform - // with the image. - ; - private final int value; - - private GroupBehavior(int value) { - this.value = value; - } - - public static GroupBehavior fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRDimensions { - QR_DIMENSIONS_AUTO_DETECT(0), // The function will automatically determine - // the dimensions of the QR code. - QR_DIMENSIONS_11x11(11), // Specifies the dimensions of the QR code as 11 x - // 11. - QR_DIMENSIONS_13x13(13), // Specifies the dimensions of the QR code as 13 x - // 13. - QR_DIMENSIONS_15x15(15), // Specifies the dimensions of the QR code as 15 x - // 15. - QR_DIMENSIONS_17x17(17), // Specifies the dimensions of the QR code as 17 x - // 17. - QR_DIMENSIONS_21x21(21), // Specifies the dimensions of the QR code as 21 x - // 21. - QR_DIMENSIONS_25x25(25), // Specifies the dimensions of the QR code as 25 x - // 25. - QR_DIMENSIONS_29x29(29), // Specifies the dimensions of the QR code as 29 x - // 29. - QR_DIMENSIONS_33x33(33), // Specifies the dimensions of the QR code as 33 x - // 33. - QR_DIMENSIONS_37x37(37), // Specifies the dimensions of the QR code as 37 x - // 37. - QR_DIMENSIONS_41x41(41), // Specifies the dimensions of the QR code as 41 x - // 41. - QR_DIMENSIONS_45x45(45), // Specifies the dimensions of the QR code as 45 x - // 45. - QR_DIMENSIONS_49x49(49), // Specifies the dimensions of the QR code as 49 x - // 49. - QR_DIMENSIONS_53x53(53), // Specifies the dimensions of the QR code as 53 x - // 53. - QR_DIMENSIONS_57x57(57), // Specifies the dimensions of the QR code as 57 x - // 57. - QR_DIMENSIONS_61x61(61), // Specifies the dimensions of the QR code as 61 x - // 61. - QR_DIMENSIONS_65x65(65), // Specifies the dimensions of the QR code as 65 x - // 65. - QR_DIMENSIONS_69x69(69), // Specifies the dimensions of the QR code as 69 x - // 69. - QR_DIMENSIONS_73x73(73), // Specifies the dimensions of the QR code as 73 x - // 73. - QR_DIMENSIONS_77x77(77), // Specifies the dimensions of the QR code as 77 x - // 77. - QR_DIMENSIONS_81x81(81), // Specifies the dimensions of the QR code as 81 x - // 81. - QR_DIMENSIONS_85x85(85), // Specifies the dimensions of the QR code as 85 x - // 85. - QR_DIMENSIONS_89x89(89), // Specifies the dimensions of the QR code as 89 x - // 89. - QR_DIMENSIONS_93x93(93), // Specifies the dimensions of the QR code as 93 x - // 93. - QR_DIMENSIONS_97x97(97), // Specifies the dimensions of the QR code as 97 x - // 97. - QR_DIMENSIONS_101x101(101), // Specifies the dimensions of the QR code as - // 101 x 101. - QR_DIMENSIONS_105x105(105), // Specifies the dimensions of the QR code as - // 105 x 105. - QR_DIMENSIONS_109x109(109), // Specifies the dimensions of the QR code as - // 109 x 109. - QR_DIMENSIONS_113x113(113), // Specifies the dimensions of the QR code as - // 113 x 113. - QR_DIMENSIONS_117x117(117), // Specifies the dimensions of the QR code as - // 117 x 117. - QR_DIMENSIONS_121x121(121), // Specifies the dimensions of the QR code as - // 121 x 121. - QR_DIMENSIONS_125x125(125), // Specifies the dimensions of the QR code as - // 125 x 125. - QR_DIMENSIONS_129x129(129), // Specifies the dimensions of the QR code as - // 129 x 129. - QR_DIMENSIONS_133x133(133), // Specifies the dimensions of the QR code as - // 133 x 133. - QR_DIMENSIONS_137x137(137), // Specifies the dimensions of the QR code as - // 137 x 137. - QR_DIMENSIONS_141x141(141), // Specifies the dimensions of the QR code as - // 141 x 141. - QR_DIMENSIONS_145x145(145), // Specifies the dimensions of the QR code as - // 145 x 145. - QR_DIMENSIONS_149x149(149), // Specifies the dimensions of the QR code as - // 149 x 149. - QR_DIMENSIONS_153x153(153), // Specifies the dimensions of the QR code as - // 153 x 153. - QR_DIMENSIONS_157x157(157), // Specifies the dimensions of the QR code as - // 157 x 1537. - QR_DIMENSIONS_161x161(161), // Specifies the dimensions of the QR code as - // 161 x 161. - QR_DIMENSIONS_165x165(165), // Specifies the dimensions of the QR code as - // 165 x 165. - QR_DIMENSIONS_169x169(169), // Specifies the dimensions of the QR code as - // 169 x 169. - QR_DIMENSIONS_173x173(173), // Specifies the dimensions of the QR code as - // 173 x 173. - QR_DIMENSIONS_177x177(177), // Specifies the dimensions of the QR code as - // 177 x 177. - ; - private final int value; - - private QRDimensions(int value) { - this.value = value; - } - - public static QRDimensions fromValue(int val) { - for (QRDimensions v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum QRCellFilterMode { - QR_CELL_FILTER_MODE_AUTO_DETECT(-2), // The function will try all filter - // modes and uses the one that decodes - // the QR code within the fewest - // iterations and utilizing the least - // amount of error correction. - QR_CELL_FILTER_MODE_AVERAGE(0), // The function sets the pixel value for the - // cell to the average of the sampled - // pixels. - QR_CELL_FILTER_MODE_MEDIAN(1), // The function sets the pixel value for the - // cell to the median of the sampled pixels. - QR_CELL_FILTER_MODE_CENTRAL_AVERAGE(2), // The function sets the pixel value - // for the cell to the average of - // the pixels in the center of the - // cell sample. - QR_CELL_FILTER_MODE_HIGH_AVERAGE(3), // The function sets the pixel value - // for the cell to the average value of - // the half of the sampled pixels with - // the highest pixel values. - QR_CELL_FILTER_MODE_LOW_AVERAGE(4), // The function sets the pixel value for - // the cell to the average value of the - // half of the sampled pixels with the - // lowest pixel values. - QR_CELL_FILTER_MODE_VERY_HIGH_AVERAGE(5), // The function sets the pixel - // value for the cell to the - // average value of the ninth of - // the sampled pixels with the - // highest pixel values. - QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE(6), // The function sets the pixel - // value for the cell to the - // average value of the ninth of - // the sampled pixels with the - // lowest pixel values. - QR_CELL_FILTER_MODE_ALL(8), // The function tries each filter mode, starting - // with IMAQ_QR_CELL_FILTER_MODE_AVERAGE and - // ending with - // IMAQ_QR_CELL_FILTER_MODE_VERY_LOW_AVERAGE, - // stopping once a filter mode decodes - // correctly. - ; - private final int value; - - private QRCellFilterMode(int value) { - this.value = value; - } - - public static QRCellFilterMode fromValue(int val) { - for (QRCellFilterMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum RoundingMode { - ROUNDING_MODE_OPTIMIZE(0), // Rounds the result of a division using the best - // available method. - ROUNDING_MODE_TRUNCATE(1), // Truncates the result of a division. - ; - private final int value; - - private RoundingMode(int value) { - this.value = value; - } - - public static RoundingMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRDemodulationMode { - QR_DEMODULATION_MODE_AUTO_DETECT(-2), // The function will try each - // demodulation mode and use the one - // which decodes the QR code within - // the fewest iterations and utilizing - // the least amount of error - // correction. - QR_DEMODULATION_MODE_HISTOGRAM(0), // The function uses a histogram of all - // of the QR cells to calculate a - // threshold. - QR_DEMODULATION_MODE_LOCAL_CONTRAST(1), // The function examines each of the - // cell's neighbors to determine if - // the cell is on or off. - QR_DEMODULATION_MODE_COMBINED(2), // The function uses the histogram of the - // QR code to calculate a threshold. - QR_DEMODULATION_MODE_ALL(3), // The function tries - // IMAQ_QR_DEMODULATION_MODE_HISTOGRAM, then - // IMAQ_QR_DEMODULATION_MODE_LOCAL_CONTRAST and - // then IMAQ_QR_DEMODULATION_MODE_COMBINED, - // stopping once one mode is successful. - ; - private final int value; - - private QRDemodulationMode(int value) { - this.value = value; - } - - public static QRDemodulationMode fromValue(int val) { - for (QRDemodulationMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ContrastMode { - ORIGINAL_CONTRAST(0), // Instructs the geometric matching algorithm to find - // matches with the same contrast as the template. - REVERSED_CONTRAST(1), // Instructs the geometric matching algorithm to find - // matches with the inverted contrast of the template. - BOTH_CONTRASTS(2), // Instructs the geometric matching algorithm to find - // matches with the same and inverted contrast of the - // template. - ; - private final int value; - - private ContrastMode(int value) { - this.value = value; - } - - public static ContrastMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRPolarities { - QR_POLARITY_AUTO_DETECT(-2), // The function should determine the polarity - // of the QR code. - QR_POLARITY_BLACK_ON_WHITE(0), // The function should search for a QR code - // with dark data on a bright background. - QR_POLARITY_WHITE_ON_BLACK(1), // The function should search for a QR code - // with bright data on a dark background. - ; - private final int value; - - private QRPolarities(int value) { - this.value = value; - } - - public static QRPolarities fromValue(int val) { - for (QRPolarities v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum QRRotationMode { - QR_ROTATION_MODE_UNLIMITED(0), // The function allows for unlimited - // rotation. - QR_ROTATION_MODE_0_DEGREES(1), // The function allows for ??? 5 degrees of - // rotation. - QR_ROTATION_MODE_90_DEGREES(2), // The function allows for between 85 and 95 - // degrees of rotation. - QR_ROTATION_MODE_180_DEGREES(3), // The function allows for between 175 and - // 185 degrees of rotation. - QR_ROTATION_MODE_270_DEGREES(4), // The function allows for between 265 and - // 275 degrees of rotation. - ; - private final int value; - - private QRRotationMode(int value) { - this.value = value; - } - - public static QRRotationMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRGradingMode { - QR_NO_GRADING(0), // The function does not make any preparatory - // calculations. - ; - private final int value; - - private QRGradingMode(int value) { - this.value = value; - } - - public static QRGradingMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum StraightEdgeSearchMode { - USE_FIRST_RAKE_EDGES(0), // Fits a straight edge on the first points - // detected using a rake. - USE_BEST_RAKE_EDGES(1), // Fits a straight edge on the best points detected - // using a rake. - USE_BEST_HOUGH_LINE(2), // Finds the strongest straight edge using all - // points detected on a rake. - USE_FIRST_PROJECTION_EDGE(3), // Uses the location of the first projected - // edge as the straight edge. - USE_BEST_PROJECTION_EDGE(4), // Finds the strongest projected edge location - // to determine the straight edge. - ; - private final int value; - - private StraightEdgeSearchMode(int value) { - this.value = value; - } - - public static StraightEdgeSearchMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SearchDirection { - SEARCH_DIRECTION_LEFT_TO_RIGHT(0), // Searches from the left side of the - // search area to the right side of the - // search area. - SEARCH_DIRECTION_RIGHT_TO_LEFT(1), // Searches from the right side of the - // search area to the left side of the - // search area. - SEARCH_DIRECTION_TOP_TO_BOTTOM(2), // Searches from the top side of the - // search area to the bottom side of the - // search area. - SEARCH_DIRECTION_BOTTOM_TO_TOP(3), // Searches from the bottom side of the - // search area to the top side of the - // search area. - ; - private final int value; - - private SearchDirection(int value) { - this.value = value; - } - - public static SearchDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRStreamMode { - QR_MODE_NUMERIC(0), // Specifies that the data was encoded using numeric - // mode. - QR_MODE_ALPHANUMERIC(1), // Specifies that the data was encoded using - // alpha-numeric mode. - QR_MODE_RAW_BYTE(2), // Specifies that the data was not encoded but is only - // raw binary bytes, or encoded in JIS-8. - QR_MODE_EAN128_TOKEN(3), // Specifies that the data has a special meaning - // represented by the application ID. - QR_MODE_EAN128_DATA(4), // Specifies that the data has a special meaning - // represented by the application ID. - QR_MODE_ECI(5), // Specifies that the data was meant to be read using the - // language represented in the language ID. - QR_MODE_KANJI(6), // Specifies that the data was encoded in Shift-JIS16 - // Japanese. - ; - private final int value; - - private QRStreamMode(int value) { - this.value = value; - } - - public static QRStreamMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ParticleClassifierType { - PARTICLE_LARGEST(0), // Use only the largest particle in the image. - PARTICLE_ALL(1), // Use all particles in the image. - ; - private final int value; - - private ParticleClassifierType(int value) { - this.value = value; - } - - public static ParticleClassifierType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRCellSampleSize { - QR_CELL_SAMPLE_SIZE_AUTO_DETECT(-2), // The function will try each sample - // size and use the one which decodes - // the QR code within the fewest - // iterations and utilizing the least - // amount of error correction. - QR_CELL_SAMPLE_SIZE1X1(1), // The function will use a 1x1 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE2X2(2), // The function will use a 2x2 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE3X3(3), // The function will use a 3x3 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE4X4(4), // The function will use a 4x4 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE5X5(5), // The function will use a 5x5 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE6X6(6), // The function will use a 6x6 sized sample from - // each cell. - QR_CELL_SAMPLE_SIZE7X7(7), // The function will use a 7x7 sized sample from - // each cell. - ; - private final int value; - - private QRCellSampleSize(int value) { - this.value = value; - } - - public static QRCellSampleSize fromValue(int val) { - for (QRCellSampleSize v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum RakeProcessType { - GET_FIRST_EDGES(0), GET_FIRST_AND_LAST_EDGES(1), GET_ALL_EDGES(2), GET_BEST_EDGES(3), ; - private final int value; - - private RakeProcessType(int value) { - this.value = value; - } - - public static RakeProcessType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum GeometricSetupDataItem { - CURVE_EXTRACTION_MODE(0), // Specifies how the function identifies curves in - // the image. - CURVE_EDGE_THRSHOLD(1), // Specifies the minimum contrast an edge pixel must - // have for it to be considered part of a curve. - CURVE_EDGE_FILTER(2), // Specifies the width of the edge filter that the - // function uses to identify curves in the image. - MINIMUM_CURVE_LENGTH(3), // Specifies the length, in pixels, of the smallest - // curve that you want the function to identify. - CURVE_ROW_SEARCH_STEP_SIZE(4), // Specifies the distance, in the y - // direction, between the image rows that the - // algorithm inspects for curve seed points. - CURVE_COL_SEARCH_STEP_SIZE(5), // Specifies the distance, in the x - // direction, between the image columns that - // the algorithm inspects for curve seed - // points. - CURVE_MAX_END_POINT_GAP(6), // Specifies the maximum gap, in pixels, between - // the endpoints of a curve that the function - // identifies as a closed curve. - EXTRACT_CLOSED_CURVES(7), // Specifies whether to identify only closed - // curves in the image. - ENABLE_SUBPIXEL_CURVE_EXTRACTION(8), // The function ignores this option. - ENABLE_CORRELATION_SCORE(9), // Specifies that the function should calculate - // the Correlation Score and return it for each - // match result. - ENABLE_SUBPIXEL_ACCURACY(10), // Determines whether to return the match - // results with subpixel accuracy. - SUBPIXEL_ITERATIONS(11), // Specifies the maximum number of incremental - // improvements used to refine matches using - // subpixel information. - SUBPIXEL_TOLERANCE(12), // Specifies the maximum amount of change, in - // pixels, between consecutive incremental - // improvements in the match position before the - // function stops refining the match position. - INITIAL_MATCH_LIST_LENGTH(13), // Specifies the maximum size of the match - // list. - ENABLE_TARGET_TEMPLATE_CURVESCORE(14), // Specifies whether the function - // should calculate the match curve - // to template curve score and return - // it for each match result. - MINIMUM_MATCH_SEPARATION_DISTANCE(15), // Specifies the minimum separation - // distance, in pixels, between the - // origins of two matches that have - // unique positions. - MINIMUM_MATCH_SEPARATION_ANGLE(16), // Specifies the minimum angular - // difference, in degrees, between two - // matches that have unique angles. - MINIMUM_MATCH_SEPARATION_SCALE(17), // Specifies the minimum difference in - // scale, expressed as a percentage, - // between two matches that have unique - // scales. - MAXIMUM_MATCH_OVERLAP(18), // Specifies whether you want the algorithm to - // spend less time accurately estimating the - // location of a match. - ENABLE_COARSE_RESULT(19), // Specifies whether you want the algorithm to - // spend less time accurately estimating the - // location of a match. - ENABLE_CALIBRATION_SUPPORT(20), // Specifies whether or not the algorithm - // treat the inspection image as a - // calibrated image. - ENABLE_CONTRAST_REVERSAL(21), // Specifies the contrast of the matches to - // search for. - SEARCH_STRATEGY(22), // Specifies the aggressiveness of the strategy used to - // find matches in the image. - REFINEMENT_MATCH_FACTOR(23), // Specifies the factor applied to the number - // of matches requested to determine how many - // matches are refined in the pyramid stage. - SUBPIXEL_MATCH_FACTOR(24), // Specifies the factor applied to the number for - // matches requested to determine how many - // matches are used for the final (subpixel) - // stage. - MAX_REFINEMENT_ITERATIONS(25), // Specifies maximum refinement iteration. - ; - private final int value; - - private GeometricSetupDataItem(int value) { - this.value = value; - } - - public static GeometricSetupDataItem fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DistortionModel { - POLYNOMIAL_MODEL(0), // Polynomial model. - DIVISION_MODEL(1), // Division Model. - NO_DISTORTION_MODEL(-1), // Not a distortion model. - ; - private final int value; - - private DistortionModel(int value) { - this.value = value; - } - - public static DistortionModel fromValue(int val) { - for (DistortionModel v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum CalibrationThumbnailType { - CAMARA_MODEL_TYPE(0), // Camara model thumbnail type. - PERSPECTIVE_TYPE(1), // Perspective thumbnail type. - MICRO_PLANE_TYPE(2), // Micro Plane thumbnail type. - ; - private final int value; - - private CalibrationThumbnailType(int value) { - this.value = value; - } - - public static CalibrationThumbnailType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SettingType { - ROTATION_ANGLE_RANGE(0), // Set a range for this option to specify the - // angles at which you expect the Function to find - // template matches in the inspection image. - SCALE_RANGE(1), // Set a range for this option to specify the sizes at which - // you expect the Function to find template matches in the - // inspection image. - OCCLUSION_RANGE(2), // Set a range for this option to specify the amount of - // occlusion you expect for a match in the inspection - // image. - ; - private final int value; - - private SettingType(int value) { - this.value = value; - } - - public static SettingType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum SegmentationDistanceLevel { - SEGMENTATION_LEVEL_CONSERVATIVE(0), // Uses extensive criteria to determine - // the Maximum Distance. - SEGMENTATION_LEVEL_AGGRESSIVE(1), // Uses few criteria to determine the - // Maximum Distance. - ; - private final int value; - - private SegmentationDistanceLevel(int value) { - this.value = value; - } - - public static SegmentationDistanceLevel fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ExtractContourSelection { - CLOSEST(0), // Selects the curve closest to the ROI. - LONGEST(1), // Selects the longest curve. - STRONGEST(2), // Selects the curve with the highest edge strength averaged - // from each point on the curve. - ; - private final int value; - - private ExtractContourSelection(int value) { - this.value = value; - } - - public static ExtractContourSelection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FindTransformMode { - FIND_REFERENCE(0), // Update both parts of the coordinate system. - UPDATE_TRANSFORM(1), // Update only the new reference system. - ; - private final int value; - - private FindTransformMode(int value) { - this.value = value; - } - - public static FindTransformMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ExtractContourDirection { - RECT_LEFT_RIGHT(0), // Searches the ROI from left to right. - RECT_RIGHT_LEFT(1), // Searches the ROI from right to left. - RECT_TOP_BOTTOM(2), // Searches the ROI from top to bottom. - RECT_BOTTOM_TOP(3), // Searches the ROI from bottom to top. - ANNULUS_INNER_OUTER(4), // Searches the ROI from the inner radius to the - // outer radius. - ANNULUS_OUTER_INNER(5), // Searches the ROI from the outer radius to the - // inner radius. - ANNULUS_START_STOP(6), // Searches the ROI from start angle to end angle. - ANNULUS_STOP_START(7), // Searches the ROI from end angle to start angle. - ; - private final int value; - - private ExtractContourDirection(int value) { - this.value = value; - } - - public static ExtractContourDirection fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum EdgePolaritySearchMode { - SEARCH_FOR_ALL_EDGES(0), // Searches for all edges. - SEARCH_FOR_RISING_EDGES(1), // Searches for rising edges only. - SEARCH_FOR_FALLING_EDGES(2), // Searches for falling edges only. - ; - private final int value; - - private EdgePolaritySearchMode(int value) { - this.value = value; - } - - public static EdgePolaritySearchMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Connectivity { - FOUR_CONNECTED(0), // Morphological reconstruction is performed in - // connectivity mode 4. - EIGHT_CONNECTED(1), // Morphological reconstruction is performed in - // connectivity mode 8. - ; - private final int value; - - private Connectivity(int value) { - this.value = value; - } - - public static Connectivity fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MorphologyReconstructOperation { - DILATE_RECONSTRUCT(0), // Performs Reconstruction by dilation. - ERODE_RECONSTRUCT(1), // Performs Reconstruction by erosion. - ; - private final int value; - - private MorphologyReconstructOperation(int value) { - this.value = value; - } - - public static MorphologyReconstructOperation fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WaveletType { - DB02(0), DB03(1), DB04(2), // Specifies the Wavelet Type as DB02. - DB05(3), DB06(4), DB07(5), DB08(6), DB09(7), DB10(8), DB11(9), DB12(10), DB13(11), DB14(12), HAAR( - 13), BIOR1_3(14), BIOR1_5(15), BIOR2_2(16), BIOR2_4(17), BIOR2_6(18), BIOR2_8(19), BIOR3_1( - 20), BIOR3_3(21), BIOR3_5(22), BIOR3_7(23), BIOR3_9(24), BIOR4_4(25), COIF1(26), COIF2(27), COIF3( - 28), COIF4(29), COIF5(30), SYM2(31), SYM3(32), SYM4(33), SYM5(34), SYM6(35), SYM7(36), SYM8( - 37), BIOR5_5(38), BIOR6_8(39), ; - private final int value; - - private WaveletType(int value) { - this.value = value; - } - - public static WaveletType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ParticleClassifierThresholdType { - THRESHOLD_MANUAL(0), // The classifier performs a manual threshold on the - // image during preprocessing. - THRESHOLD_AUTO(1), // The classifier performs an auto threshold on the image - // during preprocessing. - THRESHOLD_LOCAL(2), // The classifier performs a local threshold on the - // image during preprocessing. - ; - private final int value; - - private ParticleClassifierThresholdType(int value) { - this.value = value; - } - - public static ParticleClassifierThresholdType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum MeasureParticlesCalibrationMode { - CALIBRATION_MODE_PIXEL(0), // The function takes only pixel measurements on - // the particles in the image. - CALIBRATION_MODE_CALIBRATED(1), // The function takes only calibrated - // measurements on the particles in the - // image. - CALIBRATION_MODE_BOTH(2), // The function takes both pixel and calibrated - // measurements on the particles in the image. - ; - private final int value; - - private MeasureParticlesCalibrationMode(int value) { - this.value = value; - } - - public static MeasureParticlesCalibrationMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum GeometricMatchingSearchStrategy { - GEOMETRIC_MATCHING_CONSERVATIVE(0), // Instructs the pattern matching - // algorithm to use the largest possible - // amount of information from the image - // at the expense of slowing down the - // speed of the algorithm. - GEOMETRIC_MATCHING_BALANCED(1), // Instructs the pattern matching algorithm - // to balance the amount of information from - // the image it uses with the speed of the - // algorithm. - GEOMETRIC_MATCHING_AGGRESSIVE(2), // Instructs the pattern matching - // algorithm to use a lower amount of - // information from the image, which - // allows the algorithm to run quickly but - // at the expense of accuracy. - ; - private final int value; - - private GeometricMatchingSearchStrategy(int value) { - this.value = value; - } - - public static GeometricMatchingSearchStrategy fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ColorClassificationResolution { - CLASSIFIER_LOW_RESOLUTION(0), // Low resolution version of the color - // classifier. - CLASSIFIER_MEDIUM_RESOLUTION(1), // Medium resolution version of the color - // classifier. - CLASSIFIER_HIGH_RESOLUTION(2), // High resolution version of the color - // classifier. - ; - private final int value; - - private ColorClassificationResolution(int value) { - this.value = value; - } - - public static ColorClassificationResolution fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ConnectionConstraintType { - DISTANCE_CONSTRAINT(0), // Specifies the distance, in pixels, within which - // the end points of two curves must lie in order to - // be considered part of a contour. - ANGLE_CONSTRAINT(1), // Specifies the range, in degrees, within which the - // difference between the angle of two curves, measured - // at the end points, must lie in order for the two - // curves to be considered part of a contour. - CONNECTIVITY_CONSTRAINT(2), // Specifies the distance, in pixels, within - // which a line extended from the end point of a - // curve must pass the end point of another - // curve in order for the two curves to be - // considered part of a contour. - GRADIENT_CONSTRAINT(3), // Specifies the range, in degrees, within which the - // gradient angles of two curves, measured at the - // end points, must lie in order for the two curves - // to be considered part of a contour. - NUM_CONNECTION_CONSTRAINT_TYPES(4), // . - ; - private final int value; - - private ConnectionConstraintType(int value) { - this.value = value; - } - - public static ConnectionConstraintType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Barcode2DContrast { - ALL_BARCODE_2D_CONTRASTS(0), // The function searches for barcodes of each - // contrast type. - BLACK_ON_WHITE_BARCODE_2D(1), // The function searches for 2D barcodes - // containing black data on a white - // background. - WHITE_ON_BLACK_BARCODE_2D(2), // The function searches for 2D barcodes - // containing white data on a black - // background. - ; - private final int value; - - private Barcode2DContrast(int value) { - this.value = value; - } - - public static Barcode2DContrast fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum QRModelType { - QR_MODELTYPE_AUTO_DETECT(0), // Specifies that the function will auto-detect - // the type of QR code. - QR_MODELTYPE_MICRO(1), // Specifies the QR code is of a micro type. - QR_MODELTYPE_MODEL1(2), // Specifies the QR code is of a model1 type. - QR_MODELTYPE_MODEL2(3), // Specifies the QR code is of a model2 type. - ; - private final int value; - - private QRModelType(int value) { - this.value = value; - } - - public static QRModelType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WindowBackgroundFillStyle { - FILL_STYLE_SOLID(0), // Fill the display window with a solid color. - FILL_STYLE_HATCH(2), // Fill the display window with a pattern defined by - // WindowBackgroundHatchStyle. - FILL_STYLE_DEFAULT(3), // Fill the display window with the NI Vision default - // pattern. - ; - private final int value; - - private WindowBackgroundFillStyle(int value) { - this.value = value; - } - - public static WindowBackgroundFillStyle fromValue(int val) { - for (WindowBackgroundFillStyle v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ExtractionMode { - NORMAL_IMAGE(0), // Specifies that the function makes no assumptions about - // the uniformity of objects in the image or the image - // background. - UNIFORM_REGIONS(1), // Specifies that the function assumes that either the - // objects in the image or the image background consists - // of uniform pixel values. - ; - private final int value; - - private ExtractionMode(int value) { - this.value = value; - } - - public static ExtractionMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum EdgeFilterSize { - FINE(0), // Specifies that the function uses a fine (narrow) edge filter. - NORMAL(1), // Specifies that the function uses a normal edge filter. - CONTOUR_TRACING(2), // Sets the Edge Filter Size to contour tracing, which - // provides the best results for contour extraction but - // increases the time required to process the image. - ; - private final int value; - - private EdgeFilterSize(int value) { - this.value = value; - } - - public static EdgeFilterSize fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Barcode2DSearchMode { - SEARCH_MULTIPLE(0), // The function searches for multiple 2D barcodes. - SEARCH_SINGLE_CONSERVATIVE(1), // The function searches for 2D barcodes - // using the same searching algorithm as - // IMAQ_SEARCH_MULTIPLE but stops searching - // after locating one valid barcode. - SEARCH_SINGLE_AGGRESSIVE(2), // The function searches for a single 2D - // barcode using a method that assumes the - // barcode occupies a majority of the search - // region. - ; - private final int value; - - private Barcode2DSearchMode(int value) { - this.value = value; - } - - public static Barcode2DSearchMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixSubtype { - ALL_DATA_MATRIX_SUBTYPES(0), // The function searches for Data Matrix - // barcodes of all subtypes. - DATA_MATRIX_SUBTYPES_ECC_000_ECC_140(1), // The function searches for Data - // Matrix barcodes of subtypes ECC - // 000, ECC 050, ECC 080, ECC 100 - // and ECC 140. - DATA_MATRIX_SUBTYPE_ECC_200(2), // The function searches for Data Matrix ECC - // 200 barcodes. - ; - private final int value; - - private DataMatrixSubtype(int value) { - this.value = value; - } - - public static DataMatrixSubtype fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FeatureType { - NOT_FOUND_FEATURE(0), // Specifies the feature is not found. - CIRCLE_FEATURE(1), // Specifies the feature is a circle. - ELLIPSE_FEATURE(2), // Specifies the feature is an ellipse. - CONST_CURVE_FEATURE(3), // Specifies the features is a constant curve. - RECTANGLE_FEATURE(4), // Specifies the feature is a rectangle. - LEG_FEATURE(5), // Specifies the feature is a leg. - CORNER_FEATURE(6), // Specifies the feature is a corner. - PARALLEL_LINE_PAIR_FEATURE(7), // Specifies the feature is a parallel line - // pair. - PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE(8), // Specifies the feature is a pair - // of parallel line pairs. - LINE_FEATURE(9), // Specifies the feature is a line. - CLOSED_CURVE_FEATURE(10), // Specifies the feature is a closed curve. - ; - private final int value; - - private FeatureType(int value) { - this.value = value; - } - - public static FeatureType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Barcode2DCellShape { - SQUARE_CELLS(0), // The function uses an algorithm for decoding the 2D - // barcode that works with square data cells. - ROUND_CELLS(1), // The function uses an algorithm for decoding the 2D - // barcode that works with round data cells. - ; - private final int value; - - private Barcode2DCellShape(int value) { - this.value = value; - } - - public static Barcode2DCellShape fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum LocalThresholdMethod { - NIBLACK(0), // The function computes thresholds for each pixel based on its - // local statistics using the Niblack local thresholding - // algorithm. - BACKGROUND_CORRECTION(1), // The function performs background correction - // first to eliminate non-uniform lighting - // effects, then performs thresholding using the - // Otsu thresholding algorithm. - ; - private final int value; - - private LocalThresholdMethod(int value) { - this.value = value; - } - - public static LocalThresholdMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Barcode2DType { - PDF417(0), // The 2D barcode is of type PDF417. - DATA_MATRIX_ECC_000(1), // The 2D barcode is of type Data Matrix ECC 000. - DATA_MATRIX_ECC_050(2), // The 2D barcode is of type Data Matrix ECC 050. - DATA_MATRIX_ECC_080(3), // The 2D barcode is of type Data Matrix ECC 080. - DATA_MATRIX_ECC_100(4), // The 2D barcode is of type Data Matrix ECC 100. - DATA_MATRIX_ECC_140(5), // The 2D barcode is of type Data Matrix ECC 140. - DATA_MATRIX_ECC_200(6), // The 2D barcode is of type Data Matrix ECC 200. - ; - private final int value; - - private Barcode2DType(int value) { - this.value = value; - } - - public static Barcode2DType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ClassifierEngineType { - ENGINE_NONE(0), // No engine has been set on this classifier session. - ENGINE_NEAREST_NEIGHBOR(1), // Nearest neighbor engine. - ENGINE_SUPPORT_VECTOR_MACHINE(2), ; - private final int value; - - private ClassifierEngineType(int value) { - this.value = value; - } - - public static ClassifierEngineType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ClassifierType { - CLASSIFIER_CUSTOM(0), // The classifier session classifies vectors of - // doubles. - CLASSIFIER_PARTICLE(1), // The classifier session classifies particles in - // binary images. - CLASSIFIER_COLOR(2), // The classifier session classifies an image based on - // its color. - CLASSIFIER_TEXTURE(3), // The classifier session classifies an image based - // on its texture. - ; - private final int value; - - private ClassifierType(int value) { - this.value = value; - } - - public static ClassifierType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum ParticleType { - PARTICLE_BRIGHT(0), // Bright particles. - PARTICLE_DARK(1), // Dark particles. - ; - private final int value; - - private ParticleType(int value) { - this.value = value; - } - - public static ParticleType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum VisionInfoType2 { - VISIONINFO_CALIBRATION(0x01), // Used to indicate interaction with the - // Calibration information in an image. - VISIONINFO_OVERLAY(0x02), // Used to indicate interaction with the Overlay - // information in an image. - VISIONINFO_GRAYTEMPLATE(0x04), // Used to indicate interaction with the - // grayscale template information in an - // image. - VISIONINFO_COLORTEMPLATE(0x08), // Used to indicate interaction with the - // color template information in an image. - VISIONINFO_GEOMETRICTEMPLATE(0x10), // Used to indicate interaction with the - // geometric template information in an - // image. - VISIONINFO_CUSTOMDATA(0x20), // Used to indicate interaction with the binary - // or text Custom Data in an image. - VISIONINFO_GOLDENTEMPLATE(0x40), // Used to indicate interaction with the - // golden template information in an image. - VISIONINFO_GEOMETRICTEMPLATE2(0x80), // Used to indicate interaction with - // the geometric template 2 information - // in an image. - VISIONINFO_ALL(0xFFFFFFFF), // Removes, checks for, or indicates the - // presence of all types of extra information in - // an image. - ; - private final int value; - - private VisionInfoType2(int value) { - this.value = value; - } - - public static VisionInfoType2 fromValue(int val) { - for (VisionInfoType2 v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum ReadClassifierFileMode { - CLASSIFIER_READ_ALL(0), // Read all information from the classifier file. - CLASSIFIER_READ_SAMPLES(1), // Read only the samples from the classifier - // file. - CLASSIFIER_READ_PROPERTIES(2), // Read only the properties from the - // classifier file. - ; - private final int value; - - private ReadClassifierFileMode(int value) { - this.value = value; - } - - public static ReadClassifierFileMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WriteClassifierFileMode { - CLASSIFIER_WRITE_ALL(0), // Writes all information to the classifier file. - CLASSIFIER_WRITE_CLASSIFY_ONLY(1), // Write only the information needed to - // classify to the classifier file. - ; - private final int value; - - private WriteClassifierFileMode(int value) { - this.value = value; - } - - public static WriteClassifierFileMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum Barcode2DShape { - SQUARE_BARCODE_2D(0), // The function searches for square 2D barcodes. - RECTANGULAR_BARCODE_2D(1), // The function searches for rectangular 2D - // barcodes. - ; - private final int value; - - private Barcode2DShape(int value) { - this.value = value; - } - - public static Barcode2DShape fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixRotationMode { - UNLIMITED_ROTATION(0), // The function allows for unlimited rotation. - C0_DEGREES(1), // The function allows for between -5 and 5 degrees of - // rotation. - C90_DEGREES(2), // The function allows for between 85 and 95 degrees of - // rotation. - C180_DEGREES(3), // The function allows for between 175 and 185 degrees of - // rotation. - C270_DEGREES(4), // The function allows for between 265 and 275 degrees of - // rotation. - ; - private final int value; - - private DataMatrixRotationMode(int value) { - this.value = value; - } - - public static DataMatrixRotationMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum AIMGrade { - AIM_GRADE_F(0), // The Data Matrix barcode received a grade of F. - AIM_GRADE_D(1), // The Data Matrix barcode received a grade of D. - AIM_GRADE_C(2), // The Data Matrix barcode received a grade of C. - AIM_GRADE_B(3), // The Data Matrix barcode received a grade of B. - AIM_GRADE_A(4), // The Data Matrix barcode received a grade of A. - ; - private final int value; - - private AIMGrade(int value) { - this.value = value; - } - - public static AIMGrade fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixCellFillMode { - AUTO_DETECT_CELL_FILL_MODE(-2), // Sets the function to determine the Data - // Matrix barcode cell fill percentage - // automatically. - LOW_FILL(0), // Sets the function to read Data Matrix barcodes with a cell - // fill percentage of less than 30 percent. - NORMAL_FILL(1), // Sets the function to read Data Matrix barcodes with a - // cell fill percentage greater than or equal to 30 percent. - ; - private final int value; - - private DataMatrixCellFillMode(int value) { - this.value = value; - } - - public static DataMatrixCellFillMode fromValue(int val) { - for (DataMatrixCellFillMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixDemodulationMode { - AUTO_DETECT_DEMODULATION_MODE(-2), // The function will try each - // demodulation mode and use the one - // which decodes the Data Matrix barcode - // within the fewest iterations and - // utilizing the least amount of error - // correction. - HISTOGRAM(0), // The function uses a histogram of all of the Data Matrix - // cells to calculate a threshold. - LOCAL_CONTRAST(1), // The function examines each of the cell's neighbors to - // determine if the cell is on or off. - COMBINED(2), // The function uses the histogram of the Data Matrix barcode - // to calculate a threshold. - ALL_DEMODULATION_MODES(3), // The function tries IMAQ_HISTOGRAM, then - // IMAQ_LOCAL_CONTRAST and then IMAQ_COMBINATION, - // stopping once one mode is successful. - ; - private final int value; - - private DataMatrixDemodulationMode(int value) { - this.value = value; - } - - public static DataMatrixDemodulationMode fromValue(int val) { - for (DataMatrixDemodulationMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixECC { - AUTO_DETECT_ECC(-2), // Sets the function to determine the Data Matrix - // barcode ECC automatically. - ECC_000(0), // Sets the function to read Data Matrix barcodes of ECC 000 - // only. - ECC_050(50), // Sets the function to read Data Matrix barcodes of ECC 050 - // only. - ECC_080(80), // Sets the function to read Data Matrix barcodes of ECC 080 - // only. - ECC_100(100), // Sets the function to read Data Matrix barcodes of ECC 100 - // only. - ECC_140(140), // Sets the function to read Data Matrix barcodes of ECC 140 - // only. - ECC_000_140(190), // Sets the function to read Data Matrix barcodes of ECC - // 000, ECC 050, ECC 080, ECC 100, and ECC 140 only. - ECC_200(200), // Sets the function to read Data Matrix barcodes of ECC 200 - // only. - ; - private final int value; - - private DataMatrixECC(int value) { - this.value = value; - } - - public static DataMatrixECC fromValue(int val) { - for (DataMatrixECC v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixPolarity { - AUTO_DETECT_POLARITY(-2), // Sets the function to determine the Data Matrix - // barcode polarity automatically. - BLACK_DATA_ON_WHITE_BACKGROUND(0), // Sets the function to read Data Matrix - // barcodes with dark data on a bright - // background. - WHITE_DATA_ON_BLACK_BACKGROUND(1), // Sets the function to read Data Matrix - // barcodes with bright data on a dark - // background. - ; - private final int value; - - private DataMatrixPolarity(int value) { - this.value = value; - } - - public static DataMatrixPolarity fromValue(int val) { - for (DataMatrixPolarity v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixCellFilterMode { - AUTO_DETECT_CELL_FILTER_MODE(-2), // The function will try all filter modes - // and uses the one that decodes the Data - // Matrix barcode within the fewest - // iterations and utilizing the least - // amount of error correction. - AVERAGE_FILTER(0), // The function sets the pixel value for the cell to the - // average of the sampled pixels. - MEDIAN_FILTER(1), // The function sets the pixel value for the cell to the - // median of the sampled pixels. - CENTRAL_AVERAGE_FILTER(2), // The function sets the pixel value for the cell - // to the average of the pixels in the center of - // the cell sample. - HIGH_AVERAGE_FILTER(3), // The function sets the pixel value for the cell to - // the average value of the half of the sampled - // pixels with the highest pixel values. - LOW_AVERAGE_FILTER(4), // The function sets the pixel value for the cell to - // the average value of the half of the sampled - // pixels with the lowest pixel values. - VERY_HIGH_AVERAGE_FILTER(5), // The function sets the pixel value for the - // cell to the average value of the ninth of - // the sampled pixels with the highest pixel - // values. - VERY_LOW_AVERAGE_FILTER(6), // The function sets the pixel value for the - // cell to the average value of the ninth of the - // sampled pixels with the lowest pixel values. - ALL_CELL_FILTERS(8), // The function tries each filter mode, starting with - // IMAQ_AVERAGE_FILTER and ending with - // IMAQ_VERY_LOW_AVERAGE_FILTER, stopping once a filter - // mode decodes correctly. - ; - private final int value; - - private DataMatrixCellFilterMode(int value) { - this.value = value; - } - - public static DataMatrixCellFilterMode fromValue(int val) { - for (DataMatrixCellFilterMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum WindowBackgroundHatchStyle { - HATCH_STYLE_HORIZONTAL(0), // The background of the display window will be - // horizontal bars. - HATCH_STYLE_VERTICAL(1), // The background of the display window will be - // vertical bars. - HATCH_STYLE_FORWARD_DIAGONAL(2), // The background of the display window - // will be diagonal bars. - HATCH_STYLE_BACKWARD_DIAGONAL(3), // The background of the display window - // will be diagonal bars. - HATCH_STYLE_CROSS(4), // The background of the display window will be - // intersecting horizontal and vertical bars. - HATCH_STYLE_CROSS_HATCH(5), // The background of the display window will be - // intersecting forward and backward diagonal - // bars. - ; - private final int value; - - private WindowBackgroundHatchStyle(int value) { - this.value = value; - } - - public static WindowBackgroundHatchStyle fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixMirrorMode { - AUTO_DETECT_MIRROR(-2), // Specifies that the function should determine if - // the Data Matrix barcode is mirrored. - APPEARS_NORMAL(0), // Specifies that the function should expect the Data - // Matrix barcode to appear normal. - APPEARS_MIRRORED(1), // Specifies that the function should expect the Data - // Matrix barcode to appear mirrored. - ; - private final int value; - - private DataMatrixMirrorMode(int value) { - this.value = value; - } - - public static DataMatrixMirrorMode fromValue(int val) { - for (DataMatrixMirrorMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum CalibrationMode2 { - PERSPECTIVE_MODE(0), // Functions correct for distortion caused by the - // camera's perspective. - MICROPLANE_MODE(1), // Functions correct for distortion caused by the - // camera's lens. - SIMPLE_CALIBRATION_MODE(2), // Functions do not correct for distortion. - CORRECTED_IMAGE_MODE(3), // The image is already corrected. - NO_CALIBRATION_MODE(4), // Image with No calibration. - ; - private final int value; - - private CalibrationMode2(int value) { - this.value = value; - } - - public static CalibrationMode2 fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixGradingMode { - NO_GRADING(0), // The function does not make any preparatory calculations. - PREPARE_FOR_AIM(1), // The function prepares the image for grading using the - // AIM Print Quality metrics. - ; - private final int value; - - private DataMatrixGradingMode(int value) { - this.value = value; - } - - public static DataMatrixGradingMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum WaveletTransformMode { - WAVELET_TRANSFORM_INTEGER(0), // Uses a 5-3 reversible integer transform. - WAVELET_TRANSFORM_FLOATING_POINT(1), // Performs a 9-7 irreversible - // floating-point transform. - ; - private final int value; - - private WaveletTransformMode(int value) { - this.value = value; - } - - public static WaveletTransformMode fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum NormalizationMethod { - NORMALIZATION_NONE(0), // No normalization. - NORMALIZATION_HISTOGRAM_MATCHING(1), // Adjust image so its histogram is - // similar to the golden template's - // histogram. - NORMALIZATION_AVERAGE_MATCHING(2), // Adjust image so its mean pixel value - // equals the golden template's mean - // pixel value. - ; - private final int value; - - private NormalizationMethod(int value) { - this.value = value; - } - - public static NormalizationMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum RegistrationMethod { - REGISTRATION_NONE(0), // No registration. - REGISTRATION_PERSPECTIVE(1), // Adjust image to correct for minor variations - // in alignment or perspective. - ; - private final int value; - - private RegistrationMethod(int value) { - this.value = value; - } - - public static RegistrationMethod fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum LinearAveragesMode { - COLUMN_AVERAGES(1), // Specifies that the function calculates the mean pixel - // value of each column. - ROW_AVERAGES(2), // Specifies that the function calculates the mean pixel - // value of each row. - RISING_DIAGONAL_AVERAGES(4), // Specifies that the function calculates the - // mean pixel value of each diagonal running - // from the lower left to the upper right of - // the inspected area of the image. - FALLING_DIAGONAL_AVERAGES(8), // Specifies that the function calculates the - // mean pixel value of each diagonal running - // from the upper left to the lower right of - // the inspected area of the image. - ALL_LINEAR_AVERAGES(15), // Specifies that the function calculates all four - // linear mean pixel values. - ; - private final int value; - - private LinearAveragesMode(int value) { - this.value = value; - } - - public static LinearAveragesMode fromValue(int val) { - for (LinearAveragesMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - public static enum CompressionType { - COMPRESSION_NONE(0), // Specifies that the function should not compress the - // image. - COMPRESSION_JPEG(1), // Specifies that the function should use lossy JPEG - // compression on the image. - COMPRESSION_PACKED_BINARY(2), // Specifies that the function should use - // lossless binary packing on the image. - ; - private final int value; - - private CompressionType(int value) { - this.value = value; - } - - public static CompressionType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum FlattenType { - FLATTEN_IMAGE(0), // Flattens just the image data. - FLATTEN_IMAGE_AND_VISION_INFO(1), // Flattens the image data and any Vision - // information associated with the image. - ; - private final int value; - - private FlattenType(int value) { - this.value = value; - } - - public static FlattenType fromValue(int val) { - try { - return values()[val]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public int getValue() { - return value; - } - } - - public static enum DataMatrixCellSampleSize { - AUTO_DETECT_CELL_SAMPLE_SIZE(-2), // The function will try each sample size - // and use the one which decodes the Data - // Matrix barcode within the fewest - // iterations and utilizing the least - // amount of error correction. - C1x1(1), // The function will use a 1x1 sized sample from each cell. - C2x2(2), // The function will use a 2x2 sized sample from each cell. - C3x3(3), // The function will use a 3x3 sized sample from each cell. - C4x4(4), // The function will use a 4x4 sized sample from each cell. - C5x5(5), // The function will use a 5x5 sized sample from each cell. - C6x6(6), // The function will use a 6x6 sized sample from each cell. - C7x7(7), // The function will use a 7x7 sized sample from each cell. - ; - private final int value; - - private DataMatrixCellSampleSize(int value) { - this.value = value; - } - - public static DataMatrixCellSampleSize fromValue(int val) { - for (DataMatrixCellSampleSize v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Forward Declare Data Structures - */ - - /** - * Data Structures - */ - - public static class DivisionModel extends DisposedStruct { - public float kappa; // The learned kappa coefficient of division model. - - private void init() { - - } - - public DivisionModel() { - super(4); - init(); - } - - public DivisionModel(double kappa) { - super(4); - this.kappa = (float) kappa; - } - - protected DivisionModel(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected DivisionModel(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - kappa = backing.getFloat(0); - } - - public void write() { - backing.putFloat(0, kappa); - } - - public int size() { - return 4; - } - } - - public static class FocalLength extends DisposedStruct { - public float fx; // Focal length in X direction. - public float fy; // Focal length in Y direction. - - private void init() { - - } - - public FocalLength() { - super(8); - init(); - } - - public FocalLength(double fx, double fy) { - super(8); - this.fx = (float) fx; - this.fy = (float) fy; - } - - protected FocalLength(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected FocalLength(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - fx = backing.getFloat(0); - fy = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, fx); - backing.putFloat(4, fy); - } - - public int size() { - return 8; - } - } - - public static class PolyModel extends DisposedStruct { - public float[] kCoeffs; // The learned radial coefficients of polynomial - // model. - public float p1; // The P1(learned tangential coefficients of polynomial - // model). - public float p2; // The P2(learned tangential coefficients of polynomial - // model). - private ByteBuffer kCoeffs_buf; - - private void init() { - kCoeffs = new float[0]; - } - - public PolyModel() { - super(16); - init(); - } - - public PolyModel(float[] kCoeffs, double p1, double p2) { - super(16); - this.kCoeffs = kCoeffs; - this.p1 = (float) p1; - this.p2 = (float) p2; - } - - protected PolyModel(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected PolyModel(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int kCoeffs_numKCoeffs = backing.getInt(4); - long kCoeffs_addr = getPointer(backing, 0); - kCoeffs = new float[kCoeffs_numKCoeffs]; - if (kCoeffs_numKCoeffs > 0 && kCoeffs_addr != 0) { - newDirectByteBuffer(kCoeffs_addr, kCoeffs_numKCoeffs * 4).asFloatBuffer().get(kCoeffs); - } - p1 = backing.getFloat(8); - p2 = backing.getFloat(12); - } - - public void write() { - kCoeffs_buf = ByteBuffer.allocateDirect(kCoeffs.length * 4).order(ByteOrder.nativeOrder()); - kCoeffs_buf.asFloatBuffer().put(kCoeffs).rewind(); - backing.putInt(4, kCoeffs.length); - putPointer(backing, 0, kCoeffs_buf); - backing.putFloat(8, p1); - backing.putFloat(12, p2); - } - - public int size() { - return 16; - } - } - - public static class DistortionModelParams extends DisposedStruct { - public DistortionModel distortionModel; // Type of learned distortion model. - public PolyModel polyModel; // The learned coefficients of polynomial model. - public DivisionModel divisionModel; // The learned coefficient of division - // model. - - private void init() { - polyModel = new PolyModel(backing, 4); - divisionModel = new DivisionModel(backing, 20); - } - - public DistortionModelParams() { - super(24); - init(); - } - - public DistortionModelParams(DistortionModel distortionModel, PolyModel polyModel, - DivisionModel divisionModel) { - super(24); - this.distortionModel = distortionModel; - this.polyModel = polyModel; - this.divisionModel = divisionModel; - } - - protected DistortionModelParams(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected DistortionModelParams(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - distortionModel = DistortionModel.fromValue(backing.getInt(0)); - polyModel.read(); - divisionModel.read(); - } - - public void write() { - if (distortionModel != null) - backing.putInt(0, distortionModel.getValue()); - polyModel.write(); - divisionModel.write(); - } - - public int size() { - return 24; - } - } - - public static class PointFloat extends DisposedStruct { - public float x; // The x-coordinate of the point. - public float y; // The y-coordinate of the point. - - private void init() { - - } - - public PointFloat() { - super(8); - init(); - } - - public PointFloat(double x, double y) { - super(8); - this.x = (float) x; - this.y = (float) y; - } - - protected PointFloat(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected PointFloat(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - x = backing.getFloat(0); - y = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, x); - backing.putFloat(4, y); - } - - public int size() { - return 8; - } - } - - public static class InternalParameters extends DisposedStruct { - public byte isInsufficientData; - public FocalLength focalLength; - public PointFloat opticalCenter; - - private void init() { - focalLength = new FocalLength(backing, 4); - opticalCenter = new PointFloat(backing, 12); - } - - public InternalParameters() { - super(20); - init(); - } - - public InternalParameters(byte isInsufficientData, FocalLength focalLength, - PointFloat opticalCenter) { - super(20); - this.isInsufficientData = isInsufficientData; - this.focalLength = focalLength; - this.opticalCenter = opticalCenter; - } - - protected InternalParameters(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected InternalParameters(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - isInsufficientData = backing.get(0); - focalLength.read(); - opticalCenter.read(); - } - - public void write() { - backing.put(0, isInsufficientData); - focalLength.write(); - opticalCenter.write(); - } - - public int size() { - return 20; - } - } - - public static class MaxGridSize extends DisposedStruct { - public int xMax; // Maximum x limit for the grid size. - public int yMax; // Maximum y limit for the grid size. - - private void init() { - - } - - public MaxGridSize() { - super(8); - init(); - } - - public MaxGridSize(int xMax, int yMax) { - super(8); - this.xMax = xMax; - this.yMax = yMax; - } - - protected MaxGridSize(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected MaxGridSize(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - xMax = backing.getInt(0); - yMax = backing.getInt(4); - } - - public void write() { - backing.putInt(0, xMax); - backing.putInt(4, yMax); - } - - public int size() { - return 8; - } - } - - public static class ImageSize extends DisposedStruct { - public int xRes; // X resolution of the image. - public int yRes; // Y resolution of the image. - - private void init() { - - } - - public ImageSize() { - super(8); - init(); - } - - public ImageSize(int xRes, int yRes) { - super(8); - this.xRes = xRes; - this.yRes = yRes; - } - - protected ImageSize(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ImageSize(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - xRes = backing.getInt(0); - yRes = backing.getInt(4); - } - - public void write() { - backing.putInt(0, xRes); - backing.putInt(4, yRes); - } - - public int size() { - return 8; - } - } - - public static class CalibrationReferencePoints extends DisposedStruct { - public PointDouble[] pixelCoords; // Specifies the coordinates of the pixel - // reference points. - public PointDouble[] realCoords; // Specifies the measuring unit associated - // with the image. - public CalibrationUnit units; // Specifies the units of X Step and Y Step. - public ImageSize imageSize; // Specifies the size of calibration template - // image. - private ByteBuffer pixelCoords_buf; - private ByteBuffer realCoords_buf; - - private void init() { - pixelCoords = new PointDouble[0]; - realCoords = new PointDouble[0]; - imageSize = new ImageSize(backing, 20); - } - - public CalibrationReferencePoints() { - super(28); - init(); - } - - public CalibrationReferencePoints(PointDouble[] pixelCoords, PointDouble[] realCoords, - CalibrationUnit units, ImageSize imageSize) { - super(28); - this.pixelCoords = pixelCoords; - this.realCoords = realCoords; - this.units = units; - this.imageSize = imageSize; - } - - protected CalibrationReferencePoints(ByteBuffer backing, int offset) { - super(backing, offset, 28); - init(); - } - - protected CalibrationReferencePoints(long nativeObj, boolean owned) { - super(nativeObj, owned, 28); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 28); - } - - public void read() { - int pixelCoords_numPixelCoords = backing.getInt(4); - long pixelCoords_addr = getPointer(backing, 0); - pixelCoords = new PointDouble[pixelCoords_numPixelCoords]; - if (pixelCoords_numPixelCoords > 0 && pixelCoords_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(pixelCoords_addr, pixelCoords_numPixelCoords * 16); - for (int i = 0, off = 0; i < pixelCoords_numPixelCoords; i++, off += 16) { - pixelCoords[i] = new PointDouble(bb, off); - pixelCoords[i].read(); - } - } - int realCoords_numRealCoords = backing.getInt(12); - long realCoords_addr = getPointer(backing, 8); - realCoords = new PointDouble[realCoords_numRealCoords]; - if (realCoords_numRealCoords > 0 && realCoords_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(realCoords_addr, realCoords_numRealCoords * 16); - for (int i = 0, off = 0; i < realCoords_numRealCoords; i++, off += 16) { - realCoords[i] = new PointDouble(bb, off); - realCoords[i].read(); - } - } - units = CalibrationUnit.fromValue(backing.getInt(16)); - imageSize.read(); - } - - public void write() { - pixelCoords_buf = - ByteBuffer.allocateDirect(pixelCoords.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < pixelCoords.length; i++, off += 16) { - pixelCoords[i].setBuffer(pixelCoords_buf, off); - pixelCoords[i].write(); - } - backing.putInt(4, pixelCoords.length); - putPointer(backing, 0, pixelCoords_buf); - realCoords_buf = - ByteBuffer.allocateDirect(realCoords.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < realCoords.length; i++, off += 16) { - realCoords[i].setBuffer(realCoords_buf, off); - realCoords[i].write(); - } - backing.putInt(12, realCoords.length); - putPointer(backing, 8, realCoords_buf); - if (units != null) - backing.putInt(16, units.getValue()); - imageSize.write(); - } - - public int size() { - return 28; - } - } - - public static class GetCameraParametersReport extends DisposedStruct { - public int projectionMatrixRows; // Number of rows in projection matrix. - public int projectionMatrixCols; // Number of columns in projection matrix. - public DistortionModelParams distortion; // Distortion model Coefficients. - public InternalParameters internalParams; // The learned internal paramters - // of camera model such as focal - // length and optical center. - - private void init() { - distortion = new DistortionModelParams(backing, 12); - internalParams = new InternalParameters(backing, 36); - } - - public GetCameraParametersReport() { - super(56); - init(); - } - - public GetCameraParametersReport(int projectionMatrixRows, int projectionMatrixCols, - DistortionModelParams distortion, InternalParameters internalParams) { - super(56); - this.projectionMatrixRows = projectionMatrixRows; - this.projectionMatrixCols = projectionMatrixCols; - this.distortion = distortion; - this.internalParams = internalParams; - } - - protected GetCameraParametersReport(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected GetCameraParametersReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - projectionMatrixRows = backing.getInt(4); - projectionMatrixCols = backing.getInt(8); - distortion.read(); - internalParams.read(); - } - - public void write() { - backing.putInt(4, projectionMatrixRows); - backing.putInt(8, projectionMatrixCols); - distortion.write(); - internalParams.write(); - } - - public int size() { - return 56; - } - } - - public static class CalibrationAxisInfo extends DisposedStruct { - public PointFloat center; // The origin of the reference coordinate system, - // expressed in pixel units. - public float rotationAngle; // The angle of the x-axis of the real-world - // coordinate system, in relation to the - // horizontal. - public AxisOrientation axisDirection; // Specifies the direction of the - // calibraiton axis which is either - // Direct or Indirect. - - private void init() { - center = new PointFloat(backing, 0); - } - - public CalibrationAxisInfo() { - super(16); - init(); - } - - public CalibrationAxisInfo(PointFloat center, double rotationAngle, - AxisOrientation axisDirection) { - super(16); - this.center = center; - this.rotationAngle = (float) rotationAngle; - this.axisDirection = axisDirection; - } - - protected CalibrationAxisInfo(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CalibrationAxisInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - center.read(); - rotationAngle = backing.getFloat(8); - axisDirection = AxisOrientation.fromValue(backing.getInt(12)); - } - - public void write() { - center.write(); - backing.putFloat(8, rotationAngle); - if (axisDirection != null) - backing.putInt(12, axisDirection.getValue()); - } - - public int size() { - return 16; - } - } - - public static class CalibrationLearnSetupInfo extends DisposedStruct { - public CalibrationMode2 calibrationMethod; // Type of calibration method - // used. - public DistortionModel distortionModel; // Type of learned distortion model. - public ScalingMethod scaleMode; // The aspect scaling to use when correcting - // an image. - public CalibrationROI roiMode; // The ROI to use when correcting an image. - public byte learnCorrectionTable; // Set this input to true value if you - // want the correction table to be - // determined and stored. - - private void init() { - - } - - public CalibrationLearnSetupInfo() { - super(20); - init(); - } - - public CalibrationLearnSetupInfo(CalibrationMode2 calibrationMethod, - DistortionModel distortionModel, ScalingMethod scaleMode, CalibrationROI roiMode, - byte learnCorrectionTable) { - super(20); - this.calibrationMethod = calibrationMethod; - this.distortionModel = distortionModel; - this.scaleMode = scaleMode; - this.roiMode = roiMode; - this.learnCorrectionTable = learnCorrectionTable; - } - - protected CalibrationLearnSetupInfo(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected CalibrationLearnSetupInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - calibrationMethod = CalibrationMode2.fromValue(backing.getInt(0)); - distortionModel = DistortionModel.fromValue(backing.getInt(4)); - scaleMode = ScalingMethod.fromValue(backing.getInt(8)); - roiMode = CalibrationROI.fromValue(backing.getInt(12)); - learnCorrectionTable = backing.get(16); - } - - public void write() { - if (calibrationMethod != null) - backing.putInt(0, calibrationMethod.getValue()); - if (distortionModel != null) - backing.putInt(4, distortionModel.getValue()); - if (scaleMode != null) - backing.putInt(8, scaleMode.getValue()); - if (roiMode != null) - backing.putInt(12, roiMode.getValue()); - backing.put(16, learnCorrectionTable); - } - - public int size() { - return 20; - } - } - - public static class GridDescriptor extends DisposedStruct { - public float xStep; // The distance in the x direction between two adjacent - // pixels in units specified by unit. - public float yStep; // The distance in the y direction between two adjacent - // pixels in units specified by unit. - public CalibrationUnit unit; // The unit of measure for the image. - - private void init() { - - } - - public GridDescriptor() { - super(12); - init(); - } - - public GridDescriptor(double xStep, double yStep, CalibrationUnit unit) { - super(12); - this.xStep = (float) xStep; - this.yStep = (float) yStep; - this.unit = unit; - } - - protected GridDescriptor(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected GridDescriptor(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - xStep = backing.getFloat(0); - yStep = backing.getFloat(4); - unit = CalibrationUnit.fromValue(backing.getInt(8)); - } - - public void write() { - backing.putFloat(0, xStep); - backing.putFloat(4, yStep); - if (unit != null) - backing.putInt(8, unit.getValue()); - } - - public int size() { - return 12; - } - } - - public static class ErrorStatistics extends DisposedStruct { - public double mean; // Mean error statistics value. - public double maximum; // Maximum value of error. - public double standardDeviation; // The standard deviation error statistiscs - // value. - public double distortion; // The distortion error statistics value. - - private void init() { - - } - - public ErrorStatistics() { - super(32); - init(); - } - - public ErrorStatistics(double mean, double maximum, double standardDeviation, double distortion) { - super(32); - this.mean = mean; - this.maximum = maximum; - this.standardDeviation = standardDeviation; - this.distortion = distortion; - } - - protected ErrorStatistics(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ErrorStatistics(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - mean = backing.getDouble(0); - maximum = backing.getDouble(8); - standardDeviation = backing.getDouble(16); - distortion = backing.getDouble(24); - } - - public void write() { - backing.putDouble(0, mean); - backing.putDouble(8, maximum); - backing.putDouble(16, standardDeviation); - backing.putDouble(24, distortion); - } - - public int size() { - return 32; - } - } - - public static class GetCalibrationInfoReport extends DisposedStruct { - public ROI userRoi; // Specifies the ROI the user provided when learning the - // calibration. - public ROI calibrationRoi; // Specifies the ROI that corresponds to the - // region of the image where the calibration - // information is accurate. - public CalibrationAxisInfo axisInfo; // Reference Coordinate System for the - // real-world coordinates. - public CalibrationLearnSetupInfo learnSetupInfo; // Calibration learn setup - // information. - public GridDescriptor gridDescriptor; // Specifies scaling constants used to - // calibrate the image. - public int errorMapRows; // Number of rows in error map. - public int errorMapCols; // Number of Columns in error map. - public ErrorStatistics errorStatistics; // Error statistics of the - // calibration. - - private void init() { - axisInfo = new CalibrationAxisInfo(backing, 8); - learnSetupInfo = new CalibrationLearnSetupInfo(backing, 24); - gridDescriptor = new GridDescriptor(backing, 44); - errorStatistics = new ErrorStatistics(backing, 72); - } - - public GetCalibrationInfoReport() { - super(104); - init(); - } - - public GetCalibrationInfoReport(ROI userRoi, ROI calibrationRoi, CalibrationAxisInfo axisInfo, - CalibrationLearnSetupInfo learnSetupInfo, GridDescriptor gridDescriptor, int errorMapRows, - int errorMapCols, ErrorStatistics errorStatistics) { - super(104); - this.userRoi = userRoi; - this.calibrationRoi = calibrationRoi; - this.axisInfo = axisInfo; - this.learnSetupInfo = learnSetupInfo; - this.gridDescriptor = gridDescriptor; - this.errorMapRows = errorMapRows; - this.errorMapCols = errorMapCols; - this.errorStatistics = errorStatistics; - } - - protected GetCalibrationInfoReport(ByteBuffer backing, int offset) { - super(backing, offset, 104); - init(); - } - - protected GetCalibrationInfoReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 104); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 104); - } - - public void read() { - long userRoi_addr = getPointer(backing, 0); - if (userRoi_addr == 0) - userRoi = null; - else - userRoi = new ROI(userRoi_addr, false); - long calibrationRoi_addr = getPointer(backing, 4); - if (calibrationRoi_addr == 0) - calibrationRoi = null; - else - calibrationRoi = new ROI(calibrationRoi_addr, false); - axisInfo.read(); - learnSetupInfo.read(); - gridDescriptor.read(); - errorMapRows = backing.getInt(60); - errorMapCols = backing.getInt(64); - errorStatistics.read(); - } - - public void write() { - putPointer(backing, 0, userRoi); - putPointer(backing, 4, calibrationRoi); - axisInfo.write(); - learnSetupInfo.write(); - gridDescriptor.write(); - backing.putInt(60, errorMapRows); - backing.putInt(64, errorMapCols); - errorStatistics.write(); - } - - public int size() { - return 104; - } - } - - public static class EdgePolarity extends DisposedStruct { - public EdgePolaritySearchMode start; - public EdgePolaritySearchMode end; - - private void init() { - - } - - public EdgePolarity() { - super(8); - init(); - } - - public EdgePolarity(EdgePolaritySearchMode start, EdgePolaritySearchMode end) { - super(8); - this.start = start; - this.end = end; - } - - protected EdgePolarity(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected EdgePolarity(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - start = EdgePolaritySearchMode.fromValue(backing.getInt(0)); - end = EdgePolaritySearchMode.fromValue(backing.getInt(4)); - } - - public void write() { - if (start != null) - backing.putInt(0, start.getValue()); - if (end != null) - backing.putInt(4, end.getValue()); - } - - public int size() { - return 8; - } - } - - public static class ClampSettings extends DisposedStruct { - public double angleRange; // Specifies the angle range. - public EdgePolarity edgePolarity; // Specifies the edge polarity. - - private void init() { - edgePolarity = new EdgePolarity(backing, 8); - } - - public ClampSettings() { - super(16); - init(); - } - - public ClampSettings(double angleRange, EdgePolarity edgePolarity) { - super(16); - this.angleRange = angleRange; - this.edgePolarity = edgePolarity; - } - - protected ClampSettings(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ClampSettings(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - angleRange = backing.getDouble(0); - edgePolarity.read(); - } - - public void write() { - backing.putDouble(0, angleRange); - edgePolarity.write(); - } - - public int size() { - return 16; - } - } - - public static class PointDouble extends DisposedStruct { - public double x; // The x-coordinate of the point. - public double y; // The y-coordinate of the point. - - private void init() { - - } - - public PointDouble() { - super(16); - init(); - } - - public PointDouble(double x, double y) { - super(16); - this.x = x; - this.y = y; - } - - protected PointDouble(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected PointDouble(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - x = backing.getDouble(0); - y = backing.getDouble(8); - } - - public void write() { - backing.putDouble(0, x); - backing.putDouble(8, y); - } - - public int size() { - return 16; - } - } - - public static class PointDoublePair extends DisposedStruct { - public PointDouble start; // The Start co-ordinate of the pair. - public PointDouble end; // The End co-ordinate of the pair. - - private void init() { - start = new PointDouble(backing, 0); - end = new PointDouble(backing, 16); - } - - public PointDoublePair() { - super(32); - init(); - } - - public PointDoublePair(PointDouble start, PointDouble end) { - super(32); - this.start = start; - this.end = end; - } - - protected PointDoublePair(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected PointDoublePair(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - start.read(); - end.read(); - } - - public void write() { - start.write(); - end.write(); - } - - public int size() { - return 32; - } - } - - public static class ClampResults extends DisposedStruct { - public double distancePix; // Defines the Pixel world distance. - public double distanceRealWorld; // Defines the real world distance. - public double angleAbs; // Defines the absolute angle. - public double angleRelative; // Defines the relative angle. - - private void init() { - - } - - public ClampResults() { - super(32); - init(); - } - - public ClampResults(double distancePix, double distanceRealWorld, double angleAbs, - double angleRelative) { - super(32); - this.distancePix = distancePix; - this.distanceRealWorld = distanceRealWorld; - this.angleAbs = angleAbs; - this.angleRelative = angleRelative; - } - - protected ClampResults(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ClampResults(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - distancePix = backing.getDouble(0); - distanceRealWorld = backing.getDouble(8); - angleAbs = backing.getDouble(16); - angleRelative = backing.getDouble(24); - } - - public void write() { - backing.putDouble(0, distancePix); - backing.putDouble(8, distanceRealWorld); - backing.putDouble(16, angleAbs); - backing.putDouble(24, angleRelative); - } - - public int size() { - return 32; - } - } - - public static class ClampPoints extends DisposedStruct { - public PointDoublePair pixel; // Specifies the pixel world point pair for - // clamp. - public PointDoublePair realWorld; // Specifies the real world point pair for - // clamp. - - private void init() { - pixel = new PointDoublePair(backing, 0); - realWorld = new PointDoublePair(backing, 32); - } - - public ClampPoints() { - super(64); - init(); - } - - public ClampPoints(PointDoublePair pixel, PointDoublePair realWorld) { - super(64); - this.pixel = pixel; - this.realWorld = realWorld; - } - - protected ClampPoints(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected ClampPoints(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - pixel.read(); - realWorld.read(); - } - - public void write() { - pixel.write(); - realWorld.write(); - } - - public int size() { - return 64; - } - } - - public static class RGBValue extends DisposedStruct { - public short B; // The blue value of the color. - public short G; // The green value of the color. - public short R; // The red value of the color. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public RGBValue() { - super(4); - init(); - } - - public RGBValue(int B, int G, int R, int alpha) { - super(4); - this.B = (short) B; - this.G = (short) G; - this.R = (short) R; - this.alpha = (short) alpha; - } - - protected RGBValue(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected RGBValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - B = (short) (backing.get(0) & 0xff); - G = (short) (backing.get(1) & 0xff); - R = (short) (backing.get(2) & 0xff); - alpha = (short) (backing.get(3) & 0xff); - } - - public void write() { - backing.put(0, (byte) (B & 0xff)); - backing.put(1, (byte) (G & 0xff)); - backing.put(2, (byte) (R & 0xff)); - backing.put(3, (byte) (alpha & 0xff)); - } - - public int size() { - return 4; - } - } - - public static class ClampOverlaySettings extends DisposedStruct { - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showCurves; // If TRUE, the function overlays the curves on the - // image. - public int showClampLocation; // If TRUE, the function overlays the clamp - // location on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue curvesColor; // Specifies the RGB color value to use to - // overlay the curves. - public RGBValue clampLocationsColor; // Specifies the RGB color value to use - // to overlay the clamp locations. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the group overlay name for the - // step overlays. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 16); - curvesColor = new RGBValue(backing, 20); - clampLocationsColor = new RGBValue(backing, 24); - resultColor = new RGBValue(backing, 28); - } - - public ClampOverlaySettings() { - super(36); - init(); - } - - public ClampOverlaySettings(int showSearchArea, int showCurves, int showClampLocation, - int showResult, RGBValue searchAreaColor, RGBValue curvesColor, - RGBValue clampLocationsColor, RGBValue resultColor, String overlayGroupName) { - super(36); - this.showSearchArea = showSearchArea; - this.showCurves = showCurves; - this.showClampLocation = showClampLocation; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.curvesColor = curvesColor; - this.clampLocationsColor = clampLocationsColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - } - - protected ClampOverlaySettings(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected ClampOverlaySettings(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - showSearchArea = backing.getInt(0); - showCurves = backing.getInt(4); - showClampLocation = backing.getInt(8); - showResult = backing.getInt(12); - searchAreaColor.read(); - curvesColor.read(); - clampLocationsColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 32); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - } - - public void write() { - backing.putInt(0, showSearchArea); - backing.putInt(4, showCurves); - backing.putInt(8, showClampLocation); - backing.putInt(12, showResult); - searchAreaColor.write(); - curvesColor.write(); - clampLocationsColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 32, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - } - - public int size() { - return 36; - } - } - - public static class ClampMax2Report extends DisposedStruct { - public ClampResults clampResults; // Specifies the Clamp results information - // returned by the function. - public ClampPoints clampPoints; // Specifies the clamp points information - // returned by the function. - public int calibrationValid; // Specifies if the calibration information is - // valid or not. - - private void init() { - clampResults = new ClampResults(backing, 0); - clampPoints = new ClampPoints(backing, 32); - } - - public ClampMax2Report() { - super(104); - init(); - } - - public ClampMax2Report(ClampResults clampResults, ClampPoints clampPoints, int calibrationValid) { - super(104); - this.clampResults = clampResults; - this.clampPoints = clampPoints; - this.calibrationValid = calibrationValid; - } - - protected ClampMax2Report(ByteBuffer backing, int offset) { - super(backing, offset, 104); - init(); - } - - protected ClampMax2Report(long nativeObj, boolean owned) { - super(nativeObj, owned, 104); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 104); - } - - public void read() { - clampResults.read(); - clampPoints.read(); - calibrationValid = backing.getInt(96); - } - - public void write() { - clampResults.write(); - clampPoints.write(); - backing.putInt(96, calibrationValid); - } - - public int size() { - return 104; - } - } - - public static class ContourFitSplineReport extends DisposedStruct { - public PointDouble[] points; // It returns the points of the best-fit - // B-spline curve. - private ByteBuffer points_buf; - - private void init() { - points = new PointDouble[0]; - } - - public ContourFitSplineReport() { - super(8); - init(); - } - - public ContourFitSplineReport(PointDouble[] points) { - super(8); - this.points = points; - } - - protected ContourFitSplineReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ContourFitSplineReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int points_numberOfPoints = backing.getInt(4); - long points_addr = getPointer(backing, 0); - points = new PointDouble[points_numberOfPoints]; - if (points_numberOfPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numberOfPoints * 16); - for (int i = 0, off = 0; i < points_numberOfPoints; i++, off += 16) { - points[i] = new PointDouble(bb, off); - points[i].read(); - } - } - } - - public void write() { - points_buf = ByteBuffer.allocateDirect(points.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 16) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(4, points.length); - putPointer(backing, 0, points_buf); - } - - public int size() { - return 8; - } - } - - public static class LineFloat extends DisposedStruct { - public PointFloat start; // The coordinate location of the start of the - // line. - public PointFloat end; // The coordinate location of the end of the line. - - private void init() { - start = new PointFloat(backing, 0); - end = new PointFloat(backing, 8); - } - - public LineFloat() { - super(16); - init(); - } - - public LineFloat(PointFloat start, PointFloat end) { - super(16); - this.start = start; - this.end = end; - } - - protected LineFloat(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected LineFloat(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - start.read(); - end.read(); - } - - public void write() { - start.write(); - end.write(); - } - - public int size() { - return 16; - } - } - - public static class LineEquation extends DisposedStruct { - public double a; // The a coefficient of the line equation. - public double b; // The b coefficient of the line equation. - public double c; // The c coefficient of the line equation. - - private void init() { - - } - - public LineEquation() { - super(24); - init(); - } - - public LineEquation(double a, double b, double c) { - super(24); - this.a = a; - this.b = b; - this.c = c; - } - - protected LineEquation(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected LineEquation(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - a = backing.getDouble(0); - b = backing.getDouble(8); - c = backing.getDouble(16); - } - - public void write() { - backing.putDouble(0, a); - backing.putDouble(8, b); - backing.putDouble(16, c); - } - - public int size() { - return 24; - } - } - - public static class ContourFitLineReport extends DisposedStruct { - public LineFloat lineSegment; // Line Segment represents the intersection of - // the line equation and the contour. - public LineEquation lineEquation; // Line Equation is a structure of three - // coefficients A, B, and C of the - // equation in the normal form (Ax + By + - // C=0) of the best fit line. - - private void init() { - lineSegment = new LineFloat(backing, 0); - lineEquation = new LineEquation(backing, 16); - } - - public ContourFitLineReport() { - super(40); - init(); - } - - public ContourFitLineReport(LineFloat lineSegment, LineEquation lineEquation) { - super(40); - this.lineSegment = lineSegment; - this.lineEquation = lineEquation; - } - - protected ContourFitLineReport(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected ContourFitLineReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - lineSegment.read(); - lineEquation.read(); - } - - public void write() { - lineSegment.write(); - lineEquation.write(); - } - - public int size() { - return 40; - } - } - - public static class ContourFitPolynomialReport extends DisposedStruct { - public PointDouble[] bestFit; // It returns the points of the best-fit - // polynomial. - public double[] polynomialCoefficients; // Polynomial Coefficients returns - // the coefficients of the - // polynomial equation. - private ByteBuffer bestFit_buf; - private ByteBuffer polynomialCoefficients_buf; - - private void init() { - bestFit = new PointDouble[0]; - polynomialCoefficients = new double[0]; - } - - public ContourFitPolynomialReport() { - super(16); - init(); - } - - public ContourFitPolynomialReport(PointDouble[] bestFit, double[] polynomialCoefficients) { - super(16); - this.bestFit = bestFit; - this.polynomialCoefficients = polynomialCoefficients; - } - - protected ContourFitPolynomialReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ContourFitPolynomialReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int bestFit_numberOfPoints = backing.getInt(4); - long bestFit_addr = getPointer(backing, 0); - bestFit = new PointDouble[bestFit_numberOfPoints]; - if (bestFit_numberOfPoints > 0 && bestFit_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(bestFit_addr, bestFit_numberOfPoints * 16); - for (int i = 0, off = 0; i < bestFit_numberOfPoints; i++, off += 16) { - bestFit[i] = new PointDouble(bb, off); - bestFit[i].read(); - } - } - int polynomialCoefficients_numberOfCoefficients = backing.getInt(12); - long polynomialCoefficients_addr = getPointer(backing, 8); - polynomialCoefficients = new double[polynomialCoefficients_numberOfCoefficients]; - if (polynomialCoefficients_numberOfCoefficients > 0 && polynomialCoefficients_addr != 0) { - newDirectByteBuffer(polynomialCoefficients_addr, - polynomialCoefficients_numberOfCoefficients * 8).asDoubleBuffer().get( - polynomialCoefficients); - } - } - - public void write() { - bestFit_buf = ByteBuffer.allocateDirect(bestFit.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < bestFit.length; i++, off += 16) { - bestFit[i].setBuffer(bestFit_buf, off); - bestFit[i].write(); - } - backing.putInt(4, bestFit.length); - putPointer(backing, 0, bestFit_buf); - polynomialCoefficients_buf = - ByteBuffer.allocateDirect(polynomialCoefficients.length * 8).order( - ByteOrder.nativeOrder()); - polynomialCoefficients_buf.asDoubleBuffer().put(polynomialCoefficients).rewind(); - backing.putInt(12, polynomialCoefficients.length); - putPointer(backing, 8, polynomialCoefficients_buf); - } - - public int size() { - return 16; - } - } - - public static class PartialCircle extends DisposedStruct { - public PointFloat center; // Center of the circle. - public double radius; // Radius of the circle. - public double startAngle; // Start angle of the fitted structure. - public double endAngle; // End angle of the fitted structure. - - private void init() { - center = new PointFloat(backing, 0); - } - - public PartialCircle() { - super(32); - init(); - } - - public PartialCircle(PointFloat center, double radius, double startAngle, double endAngle) { - super(32); - this.center = center; - this.radius = radius; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected PartialCircle(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected PartialCircle(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - center.read(); - radius = backing.getDouble(8); - startAngle = backing.getDouble(16); - endAngle = backing.getDouble(24); - } - - public void write() { - center.write(); - backing.putDouble(8, radius); - backing.putDouble(16, startAngle); - backing.putDouble(24, endAngle); - } - - public int size() { - return 32; - } - } - - public static class PartialEllipse extends DisposedStruct { - public PointFloat center; // Center of the Ellipse. - public double angle; // Angle of the ellipse. - public double majorRadius; // The length of the semi-major axis of the - // ellipse. - public double minorRadius; // The length of the semi-minor axis of the - // ellipse. - public double startAngle; // Start angle of the fitted structure. - public double endAngle; // End angle of the fitted structure. - - private void init() { - center = new PointFloat(backing, 0); - } - - public PartialEllipse() { - super(48); - init(); - } - - public PartialEllipse(PointFloat center, double angle, double majorRadius, double minorRadius, - double startAngle, double endAngle) { - super(48); - this.center = center; - this.angle = angle; - this.majorRadius = majorRadius; - this.minorRadius = minorRadius; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected PartialEllipse(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected PartialEllipse(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - center.read(); - angle = backing.getDouble(8); - majorRadius = backing.getDouble(16); - minorRadius = backing.getDouble(24); - startAngle = backing.getDouble(32); - endAngle = backing.getDouble(40); - } - - public void write() { - center.write(); - backing.putDouble(8, angle); - backing.putDouble(16, majorRadius); - backing.putDouble(24, minorRadius); - backing.putDouble(32, startAngle); - backing.putDouble(40, endAngle); - } - - public int size() { - return 48; - } - } - - public static class SetupMatchPatternData extends DisposedStruct { - public byte[] matchSetupData; // String containing the match setup data. - private ByteBuffer matchSetupData_buf; - - private void init() { - matchSetupData = new byte[0]; - } - - public SetupMatchPatternData() { - super(8); - init(); - } - - public SetupMatchPatternData(byte[] matchSetupData) { - super(8); - this.matchSetupData = matchSetupData; - } - - protected SetupMatchPatternData(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected SetupMatchPatternData(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int matchSetupData_numMatchSetupData = backing.getInt(4); - long matchSetupData_addr = getPointer(backing, 0); - matchSetupData = new byte[matchSetupData_numMatchSetupData]; - if (matchSetupData_numMatchSetupData > 0 && matchSetupData_addr != 0) { - getBytes(newDirectByteBuffer(matchSetupData_addr, matchSetupData_numMatchSetupData), - matchSetupData, 0, matchSetupData_numMatchSetupData); - } - } - - public void write() { - matchSetupData_buf = ByteBuffer.allocateDirect(matchSetupData.length); - putBytes(matchSetupData_buf, matchSetupData, 0, matchSetupData.length); - backing.putInt(4, matchSetupData.length); - putPointer(backing, 0, matchSetupData_buf); - } - - public int size() { - return 8; - } - } - - public static class RangeSettingDouble extends DisposedStruct { - public SettingType settingType; // Match Constraints specifies the match - // option whose values you want to constrain - // by the given range. - public double min; // Min is the minimum value of the range for a given - // Match Constraint. - public double max; // Max is the maximum value of the range for a given - // Match Constraint. - - private void init() { - - } - - public RangeSettingDouble() { - super(24); - init(); - } - - public RangeSettingDouble(SettingType settingType, double min, double max) { - super(24); - this.settingType = settingType; - this.min = min; - this.max = max; - } - - protected RangeSettingDouble(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected RangeSettingDouble(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - settingType = SettingType.fromValue(backing.getInt(0)); - min = backing.getDouble(8); - max = backing.getDouble(16); - } - - public void write() { - if (settingType != null) - backing.putInt(0, settingType.getValue()); - backing.putDouble(8, min); - backing.putDouble(16, max); - } - - public int size() { - return 24; - } - } - - public static class GeometricAdvancedSetupDataOption extends DisposedStruct { - public GeometricSetupDataItem type; // It determines the option you want to - // use during the matching phase. - public double value; // Value is the value for the option you want to use - // during the matching phase. - - private void init() { - - } - - public GeometricAdvancedSetupDataOption() { - super(16); - init(); - } - - public GeometricAdvancedSetupDataOption(GeometricSetupDataItem type, double value) { - super(16); - this.type = type; - this.value = value; - } - - protected GeometricAdvancedSetupDataOption(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected GeometricAdvancedSetupDataOption(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - type = GeometricSetupDataItem.fromValue(backing.getInt(0)); - value = backing.getDouble(8); - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - backing.putDouble(8, value); - } - - public int size() { - return 16; - } - } - - public static class ContourInfoReport extends DisposedStruct { - public PointDouble[] pointsPixel; // Points (pixel) specifies the location - // of every point detected on the curve, - // in pixels. - public PointDouble[] pointsReal; // Points (real) specifies the location of - // every point detected on the curve, in - // calibrated units. - public double[] curvaturePixel; // Curvature Pixel displays the curvature - // profile for the selected contour, in - // pixels. - public double[] curvatureReal; // Curvature Real displays the curvature - // profile for the selected contour, in - // calibrated units. - public double length; // Length (pixel) specifies the length, in pixels, of - // the curves in the image. - public double lengthReal; // Length (real) specifies the length, in - // calibrated units, of the curves within the - // curvature range. - public int hasEquation; // Has Equation specifies whether the contour has a - // fitted equation. - private ByteBuffer pointsPixel_buf; - private ByteBuffer pointsReal_buf; - private ByteBuffer curvaturePixel_buf; - private ByteBuffer curvatureReal_buf; - - private void init() { - pointsPixel = new PointDouble[0]; - pointsReal = new PointDouble[0]; - curvaturePixel = new double[0]; - curvatureReal = new double[0]; - } - - public ContourInfoReport() { - super(56); - init(); - } - - public ContourInfoReport(PointDouble[] pointsPixel, PointDouble[] pointsReal, - double[] curvaturePixel, double[] curvatureReal, double length, double lengthReal, - int hasEquation) { - super(56); - this.pointsPixel = pointsPixel; - this.pointsReal = pointsReal; - this.curvaturePixel = curvaturePixel; - this.curvatureReal = curvatureReal; - this.length = length; - this.lengthReal = lengthReal; - this.hasEquation = hasEquation; - } - - protected ContourInfoReport(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected ContourInfoReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - int pointsPixel_numPointsPixel = backing.getInt(4); - long pointsPixel_addr = getPointer(backing, 0); - pointsPixel = new PointDouble[pointsPixel_numPointsPixel]; - if (pointsPixel_numPointsPixel > 0 && pointsPixel_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(pointsPixel_addr, pointsPixel_numPointsPixel * 16); - for (int i = 0, off = 0; i < pointsPixel_numPointsPixel; i++, off += 16) { - pointsPixel[i] = new PointDouble(bb, off); - pointsPixel[i].read(); - } - } - int pointsReal_numPointsReal = backing.getInt(12); - long pointsReal_addr = getPointer(backing, 8); - pointsReal = new PointDouble[pointsReal_numPointsReal]; - if (pointsReal_numPointsReal > 0 && pointsReal_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(pointsReal_addr, pointsReal_numPointsReal * 16); - for (int i = 0, off = 0; i < pointsReal_numPointsReal; i++, off += 16) { - pointsReal[i] = new PointDouble(bb, off); - pointsReal[i].read(); - } - } - int curvaturePixel_numCurvaturePixel = backing.getInt(20); - long curvaturePixel_addr = getPointer(backing, 16); - curvaturePixel = new double[curvaturePixel_numCurvaturePixel]; - if (curvaturePixel_numCurvaturePixel > 0 && curvaturePixel_addr != 0) { - newDirectByteBuffer(curvaturePixel_addr, curvaturePixel_numCurvaturePixel * 8) - .asDoubleBuffer().get(curvaturePixel); - } - int curvatureReal_numCurvatureReal = backing.getInt(28); - long curvatureReal_addr = getPointer(backing, 24); - curvatureReal = new double[curvatureReal_numCurvatureReal]; - if (curvatureReal_numCurvatureReal > 0 && curvatureReal_addr != 0) { - newDirectByteBuffer(curvatureReal_addr, curvatureReal_numCurvatureReal * 8) - .asDoubleBuffer().get(curvatureReal); - } - length = backing.getDouble(32); - lengthReal = backing.getDouble(40); - hasEquation = backing.getInt(48); - } - - public void write() { - pointsPixel_buf = - ByteBuffer.allocateDirect(pointsPixel.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < pointsPixel.length; i++, off += 16) { - pointsPixel[i].setBuffer(pointsPixel_buf, off); - pointsPixel[i].write(); - } - backing.putInt(4, pointsPixel.length); - putPointer(backing, 0, pointsPixel_buf); - pointsReal_buf = - ByteBuffer.allocateDirect(pointsReal.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < pointsReal.length; i++, off += 16) { - pointsReal[i].setBuffer(pointsReal_buf, off); - pointsReal[i].write(); - } - backing.putInt(12, pointsReal.length); - putPointer(backing, 8, pointsReal_buf); - curvaturePixel_buf = - ByteBuffer.allocateDirect(curvaturePixel.length * 8).order(ByteOrder.nativeOrder()); - curvaturePixel_buf.asDoubleBuffer().put(curvaturePixel).rewind(); - backing.putInt(20, curvaturePixel.length); - putPointer(backing, 16, curvaturePixel_buf); - curvatureReal_buf = - ByteBuffer.allocateDirect(curvatureReal.length * 8).order(ByteOrder.nativeOrder()); - curvatureReal_buf.asDoubleBuffer().put(curvatureReal).rewind(); - backing.putInt(28, curvatureReal.length); - putPointer(backing, 24, curvatureReal_buf); - backing.putDouble(32, length); - backing.putDouble(40, lengthReal); - backing.putInt(48, hasEquation); - } - - public int size() { - return 56; - } - } - - public static class ROILabel extends DisposedStruct { - public String className; // Specifies the classname you want to segment. - public int label; // Label is the label number associated with the Class - // Name. - private ByteBuffer className_buf; - - private void init() { - - } - - public ROILabel() { - super(8); - init(); - } - - public ROILabel(String className, int label) { - super(8); - this.className = className; - this.label = label; - } - - protected ROILabel(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ROILabel(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - long className_addr = getPointer(backing, 0); - if (className_addr == 0) - className = null; - else { - ByteBuffer bb = newDirectByteBuffer(className_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - className = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - className = ""; - } - } - - label = backing.getInt(4); - } - - public void write() { - if (className != null) { - byte[] className_bytes; - try { - className_bytes = className.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - className_bytes = new byte[0]; - } - className_buf = ByteBuffer.allocateDirect(className_bytes.length + 1); - putBytes(className_buf, className_bytes, 0, className_bytes.length).put( - className_bytes.length, (byte) 0); - } - putPointer(backing, 0, className == null ? 0 : getByteBufferAddress(className_buf)); - backing.putInt(4, label); - } - - public int size() { - return 8; - } - } - - public static class SupervisedColorSegmentationReport extends DisposedStruct { - public ROILabel[] labelOut; // The Roi labels array. - private ByteBuffer labelOut_buf; - - private void init() { - labelOut = new ROILabel[0]; - } - - public SupervisedColorSegmentationReport() { - super(8); - init(); - } - - public SupervisedColorSegmentationReport(ROILabel[] labelOut) { - super(8); - this.labelOut = labelOut; - } - - protected SupervisedColorSegmentationReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected SupervisedColorSegmentationReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int labelOut_numLabelOut = backing.getInt(4); - long labelOut_addr = getPointer(backing, 0); - labelOut = new ROILabel[labelOut_numLabelOut]; - if (labelOut_numLabelOut > 0 && labelOut_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(labelOut_addr, labelOut_numLabelOut * 8); - for (int i = 0, off = 0; i < labelOut_numLabelOut; i++, off += 8) { - labelOut[i] = new ROILabel(bb, off); - labelOut[i].read(); - } - } - } - - public void write() { - labelOut_buf = ByteBuffer.allocateDirect(labelOut.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < labelOut.length; i++, off += 8) { - labelOut[i].setBuffer(labelOut_buf, off); - labelOut[i].write(); - } - backing.putInt(4, labelOut.length); - putPointer(backing, 0, labelOut_buf); - } - - public int size() { - return 8; - } - } - - public static class LabelToROIReport extends DisposedStruct { - public ROI[] roiArray; // Array of ROIs. - public int[] labelsOutArray; // Array of labels. - public int[] isTooManyVectorsArray; // isTooManyVectorsArray array. - private ByteBuffer roiArray_buf; - private ByteBuffer labelsOutArray_buf; - private ByteBuffer isTooManyVectorsArray_buf; - - private void init() { - roiArray = new ROI[0]; - labelsOutArray = new int[0]; - isTooManyVectorsArray = new int[0]; - } - - public LabelToROIReport() { - super(24); - init(); - } - - public LabelToROIReport(ROI[] roiArray, int[] labelsOutArray, int[] isTooManyVectorsArray) { - super(24); - this.roiArray = roiArray; - this.labelsOutArray = labelsOutArray; - this.isTooManyVectorsArray = isTooManyVectorsArray; - } - - protected LabelToROIReport(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected LabelToROIReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - int roiArray_numOfROIs = backing.getInt(4); - long roiArray_addr = getPointer(backing, 0); - roiArray = new ROI[roiArray_numOfROIs]; - if (roiArray_numOfROIs > 0 && roiArray_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(roiArray_addr, roiArray_numOfROIs * 4); - for (int i = 0, off = 0; i < roiArray_numOfROIs; i++, off += 4) { - roiArray[i] = new ROI(getPointer(bb, off), false); - } - } - int labelsOutArray_numOfLabels = backing.getInt(12); - long labelsOutArray_addr = getPointer(backing, 8); - labelsOutArray = new int[labelsOutArray_numOfLabels]; - if (labelsOutArray_numOfLabels > 0 && labelsOutArray_addr != 0) { - newDirectByteBuffer(labelsOutArray_addr, labelsOutArray_numOfLabels * 4).asIntBuffer().get( - labelsOutArray); - } - int isTooManyVectorsArray_isTooManyVectorsArraySize = backing.getInt(20); - long isTooManyVectorsArray_addr = getPointer(backing, 16); - isTooManyVectorsArray = new int[isTooManyVectorsArray_isTooManyVectorsArraySize]; - if (isTooManyVectorsArray_isTooManyVectorsArraySize > 0 && isTooManyVectorsArray_addr != 0) { - newDirectByteBuffer(isTooManyVectorsArray_addr, - isTooManyVectorsArray_isTooManyVectorsArraySize * 4).asIntBuffer().get( - isTooManyVectorsArray); - } - } - - public void write() { - roiArray_buf = ByteBuffer.allocateDirect(roiArray.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < roiArray.length; i++, off += 4) { - putPointer(roiArray_buf, off, roiArray[i]); - } - backing.putInt(4, roiArray.length); - putPointer(backing, 0, roiArray_buf); - labelsOutArray_buf = - ByteBuffer.allocateDirect(labelsOutArray.length * 4).order(ByteOrder.nativeOrder()); - labelsOutArray_buf.asIntBuffer().put(labelsOutArray).rewind(); - backing.putInt(12, labelsOutArray.length); - putPointer(backing, 8, labelsOutArray_buf); - isTooManyVectorsArray_buf = - ByteBuffer.allocateDirect(isTooManyVectorsArray.length * 4) - .order(ByteOrder.nativeOrder()); - isTooManyVectorsArray_buf.asIntBuffer().put(isTooManyVectorsArray).rewind(); - backing.putInt(20, isTooManyVectorsArray.length); - putPointer(backing, 16, isTooManyVectorsArray_buf); - } - - public int size() { - return 24; - } - } - - public static class ColorSegmenationOptions extends DisposedStruct { - public int windowX; // X is the window size in x direction. - public int windowY; // Y is the window size in y direction. - public int stepSize; // Step Size is the distance between two windows. - public int minParticleArea; // Min Particle Area is the minimum number of - // allowed pixels. - public int maxParticleArea; // Max Particle Area is the maximum number of - // allowed pixels. - public short isFineSegment; // When enabled, the step processes the boundary - // pixels of each segmentation cluster using a - // step size of 1. - - private void init() { - - } - - public ColorSegmenationOptions() { - super(24); - init(); - } - - public ColorSegmenationOptions(int windowX, int windowY, int stepSize, int minParticleArea, - int maxParticleArea, int isFineSegment) { - super(24); - this.windowX = windowX; - this.windowY = windowY; - this.stepSize = stepSize; - this.minParticleArea = minParticleArea; - this.maxParticleArea = maxParticleArea; - this.isFineSegment = (short) isFineSegment; - } - - protected ColorSegmenationOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ColorSegmenationOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - windowX = backing.getInt(0); - windowY = backing.getInt(4); - stepSize = backing.getInt(8); - minParticleArea = backing.getInt(12); - maxParticleArea = backing.getInt(16); - isFineSegment = backing.getShort(20); - } - - public void write() { - backing.putInt(0, windowX); - backing.putInt(4, windowY); - backing.putInt(8, stepSize); - backing.putInt(12, minParticleArea); - backing.putInt(16, maxParticleArea); - backing.putShort(20, isFineSegment); - } - - public int size() { - return 24; - } - } - - public static class ClassifiedCurve extends DisposedStruct { - public double length; // Specifies the length, in pixels, of the curves - // within the curvature range. - public double lengthReal; // specifies the length, in calibrated units, of - // the curves within the curvature range. - public double maxCurvature; // specifies the maximum curvature, in pixels, - // for the selected curvature range. - public double maxCurvatureReal; // specifies the maximum curvature, in - // calibrated units, for the selected - // curvature range. - public int label; // specifies the class to which the the sample belongs. - public PointDouble[] curvePoints; // Curve Points is a point-coordinate - // cluster that defines the points of the - // curve. - private ByteBuffer curvePoints_buf; - - private void init() { - curvePoints = new PointDouble[0]; - } - - public ClassifiedCurve() { - super(48); - init(); - } - - public ClassifiedCurve(double length, double lengthReal, double maxCurvature, - double maxCurvatureReal, int label, PointDouble[] curvePoints) { - super(48); - this.length = length; - this.lengthReal = lengthReal; - this.maxCurvature = maxCurvature; - this.maxCurvatureReal = maxCurvatureReal; - this.label = label; - this.curvePoints = curvePoints; - } - - protected ClassifiedCurve(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected ClassifiedCurve(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - length = backing.getDouble(0); - lengthReal = backing.getDouble(8); - maxCurvature = backing.getDouble(16); - maxCurvatureReal = backing.getDouble(24); - label = backing.getInt(32); - int curvePoints_numCurvePoints = backing.getInt(40); - long curvePoints_addr = getPointer(backing, 36); - curvePoints = new PointDouble[curvePoints_numCurvePoints]; - if (curvePoints_numCurvePoints > 0 && curvePoints_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(curvePoints_addr, curvePoints_numCurvePoints * 16); - for (int i = 0, off = 0; i < curvePoints_numCurvePoints; i++, off += 16) { - curvePoints[i] = new PointDouble(bb, off); - curvePoints[i].read(); - } - } - } - - public void write() { - backing.putDouble(0, length); - backing.putDouble(8, lengthReal); - backing.putDouble(16, maxCurvature); - backing.putDouble(24, maxCurvatureReal); - backing.putInt(32, label); - curvePoints_buf = - ByteBuffer.allocateDirect(curvePoints.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < curvePoints.length; i++, off += 16) { - curvePoints[i].setBuffer(curvePoints_buf, off); - curvePoints[i].write(); - } - backing.putInt(40, curvePoints.length); - putPointer(backing, 36, curvePoints_buf); - } - - public int size() { - return 48; - } - } - - public static class RangeDouble extends DisposedStruct { - public double minValue; // The minimum value of the range. - public double maxValue; // The maximum value of the range. - - private void init() { - - } - - public RangeDouble() { - super(16); - init(); - } - - public RangeDouble(double minValue, double maxValue) { - super(16); - this.minValue = minValue; - this.maxValue = maxValue; - } - - protected RangeDouble(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected RangeDouble(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - minValue = backing.getDouble(0); - maxValue = backing.getDouble(8); - } - - public void write() { - backing.putDouble(0, minValue); - backing.putDouble(8, maxValue); - } - - public int size() { - return 16; - } - } - - public static class RangeLabel extends DisposedStruct { - public RangeDouble range; // Specifies the range of curvature values. - public int label; // Class Label specifies the class to which the the sample - // belongs. - - private void init() { - range = new RangeDouble(backing, 0); - } - - public RangeLabel() { - super(24); - init(); - } - - public RangeLabel(RangeDouble range, int label) { - super(24); - this.range = range; - this.label = label; - } - - protected RangeLabel(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected RangeLabel(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - range.read(); - label = backing.getInt(16); - } - - public void write() { - range.write(); - backing.putInt(16, label); - } - - public int size() { - return 24; - } - } - - public static class CurvatureAnalysisReport extends DisposedStruct { - public ClassifiedCurve[] curves; - private ByteBuffer curves_buf; - - private void init() { - curves = new ClassifiedCurve[0]; - } - - public CurvatureAnalysisReport() { - super(8); - init(); - } - - public CurvatureAnalysisReport(ClassifiedCurve[] curves) { - super(8); - this.curves = curves; - } - - protected CurvatureAnalysisReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected CurvatureAnalysisReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int curves_numCurves = backing.getInt(4); - long curves_addr = getPointer(backing, 0); - curves = new ClassifiedCurve[curves_numCurves]; - if (curves_numCurves > 0 && curves_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(curves_addr, curves_numCurves * 48); - for (int i = 0, off = 0; i < curves_numCurves; i++, off += 48) { - curves[i] = new ClassifiedCurve(bb, off); - curves[i].read(); - } - } - } - - public void write() { - curves_buf = ByteBuffer.allocateDirect(curves.length * 48).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < curves.length; i++, off += 48) { - curves[i].setBuffer(curves_buf, off); - curves[i].write(); - } - backing.putInt(4, curves.length); - putPointer(backing, 0, curves_buf); - } - - public int size() { - return 8; - } - } - - public static class Disparity extends DisposedStruct { - public PointDouble current; // Current is a array of points that defines the - // target contour. - public PointDouble reference; // reference is a array of points that defines - // the template contour. - public double distance; // Specifies the distance, in pixels, between the - // template contour point and the target contour - // point. - - private void init() { - current = new PointDouble(backing, 0); - reference = new PointDouble(backing, 16); - } - - public Disparity() { - super(40); - init(); - } - - public Disparity(PointDouble current, PointDouble reference, double distance) { - super(40); - this.current = current; - this.reference = reference; - this.distance = distance; - } - - protected Disparity(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected Disparity(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - current.read(); - reference.read(); - distance = backing.getDouble(32); - } - - public void write() { - current.write(); - reference.write(); - backing.putDouble(32, distance); - } - - public int size() { - return 40; - } - } - - public static class ComputeDistancesReport extends DisposedStruct { - public Disparity[] distances; // Distances is an array containing the - // computed distances. - public Disparity[] distancesReal; // Distances Real is an array containing - // the computed distances in calibrated - // units. - private ByteBuffer distances_buf; - private ByteBuffer distancesReal_buf; - - private void init() { - distances = new Disparity[0]; - distancesReal = new Disparity[0]; - } - - public ComputeDistancesReport() { - super(16); - init(); - } - - public ComputeDistancesReport(Disparity[] distances, Disparity[] distancesReal) { - super(16); - this.distances = distances; - this.distancesReal = distancesReal; - } - - protected ComputeDistancesReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ComputeDistancesReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int distances_numDistances = backing.getInt(4); - long distances_addr = getPointer(backing, 0); - distances = new Disparity[distances_numDistances]; - if (distances_numDistances > 0 && distances_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(distances_addr, distances_numDistances * 40); - for (int i = 0, off = 0; i < distances_numDistances; i++, off += 40) { - distances[i] = new Disparity(bb, off); - distances[i].read(); - } - } - int distancesReal_numDistancesReal = backing.getInt(12); - long distancesReal_addr = getPointer(backing, 8); - distancesReal = new Disparity[distancesReal_numDistancesReal]; - if (distancesReal_numDistancesReal > 0 && distancesReal_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(distancesReal_addr, distancesReal_numDistancesReal * 40); - for (int i = 0, off = 0; i < distancesReal_numDistancesReal; i++, off += 40) { - distancesReal[i] = new Disparity(bb, off); - distancesReal[i].read(); - } - } - } - - public void write() { - distances_buf = - ByteBuffer.allocateDirect(distances.length * 40).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < distances.length; i++, off += 40) { - distances[i].setBuffer(distances_buf, off); - distances[i].write(); - } - backing.putInt(4, distances.length); - putPointer(backing, 0, distances_buf); - distancesReal_buf = - ByteBuffer.allocateDirect(distancesReal.length * 40).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < distancesReal.length; i++, off += 40) { - distancesReal[i].setBuffer(distancesReal_buf, off); - distancesReal[i].write(); - } - backing.putInt(12, distancesReal.length); - putPointer(backing, 8, distancesReal_buf); - } - - public int size() { - return 16; - } - } - - public static class MatchMode extends DisposedStruct { - public int rotation; // Rotation When enabled, the Function searches for - // occurrences of the template in the inspection image, - // allowing for template matches to be rotated. - public int scale; // Rotation When enabled, the Function searches for - // occurrences of the template in the inspection image, - // allowing for template matches to be rotated. - public int occlusion; // Occlusion specifies whether or not to search for - // occluded versions of the shape. - - private void init() { - - } - - public MatchMode() { - super(12); - init(); - } - - public MatchMode(int rotation, int scale, int occlusion) { - super(12); - this.rotation = rotation; - this.scale = scale; - this.occlusion = occlusion; - } - - protected MatchMode(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected MatchMode(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - rotation = backing.getInt(0); - scale = backing.getInt(4); - occlusion = backing.getInt(8); - } - - public void write() { - backing.putInt(0, rotation); - backing.putInt(4, scale); - backing.putInt(8, occlusion); - } - - public int size() { - return 12; - } - } - - public static class ClassifiedDisparity extends DisposedStruct { - public double length; // Length (pixel) specifies the length, in pixels, of - // the curves within the curvature range. - public double lengthReal; // Length (real) specifies the length, in - // calibrated units, of the curves within the - // curvature range. - public double maxDistance; // Maximum Distance (pixel) specifies the maximum - // distance, in pixels, between points along the - // selected contour and the template contour. - public double maxDistanceReal; // Maximum Distance (real) specifies the - // maximum distance, in calibrated units, - // between points along the selected contour - // and the template contour. - public int label; // Class Label specifies the class to which the the sample - // belongs. - public PointDouble[] templateSubsection; // Template subsection points is an - // array of points that defines the - // boundary of the template. - public PointDouble[] targetSubsection; // Current Points(Target subsection - // points) is an array of points that - // defines the boundary of the - // target. - private ByteBuffer templateSubsection_buf; - private ByteBuffer targetSubsection_buf; - - private void init() { - templateSubsection = new PointDouble[0]; - targetSubsection = new PointDouble[0]; - } - - public ClassifiedDisparity() { - super(56); - init(); - } - - public ClassifiedDisparity(double length, double lengthReal, double maxDistance, - double maxDistanceReal, int label, PointDouble[] templateSubsection, - PointDouble[] targetSubsection) { - super(56); - this.length = length; - this.lengthReal = lengthReal; - this.maxDistance = maxDistance; - this.maxDistanceReal = maxDistanceReal; - this.label = label; - this.templateSubsection = templateSubsection; - this.targetSubsection = targetSubsection; - } - - protected ClassifiedDisparity(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected ClassifiedDisparity(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - length = backing.getDouble(0); - lengthReal = backing.getDouble(8); - maxDistance = backing.getDouble(16); - maxDistanceReal = backing.getDouble(24); - label = backing.getInt(32); - int templateSubsection_numTemplateSubsection = backing.getInt(40); - long templateSubsection_addr = getPointer(backing, 36); - templateSubsection = new PointDouble[templateSubsection_numTemplateSubsection]; - if (templateSubsection_numTemplateSubsection > 0 && templateSubsection_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(templateSubsection_addr, - templateSubsection_numTemplateSubsection * 16); - for (int i = 0, off = 0; i < templateSubsection_numTemplateSubsection; i++, off += 16) { - templateSubsection[i] = new PointDouble(bb, off); - templateSubsection[i].read(); - } - } - int targetSubsection_numTargetSubsection = backing.getInt(48); - long targetSubsection_addr = getPointer(backing, 44); - targetSubsection = new PointDouble[targetSubsection_numTargetSubsection]; - if (targetSubsection_numTargetSubsection > 0 && targetSubsection_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(targetSubsection_addr, targetSubsection_numTargetSubsection * 16); - for (int i = 0, off = 0; i < targetSubsection_numTargetSubsection; i++, off += 16) { - targetSubsection[i] = new PointDouble(bb, off); - targetSubsection[i].read(); - } - } - } - - public void write() { - backing.putDouble(0, length); - backing.putDouble(8, lengthReal); - backing.putDouble(16, maxDistance); - backing.putDouble(24, maxDistanceReal); - backing.putInt(32, label); - templateSubsection_buf = - ByteBuffer.allocateDirect(templateSubsection.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < templateSubsection.length; i++, off += 16) { - templateSubsection[i].setBuffer(templateSubsection_buf, off); - templateSubsection[i].write(); - } - backing.putInt(40, templateSubsection.length); - putPointer(backing, 36, templateSubsection_buf); - targetSubsection_buf = - ByteBuffer.allocateDirect(targetSubsection.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < targetSubsection.length; i++, off += 16) { - targetSubsection[i].setBuffer(targetSubsection_buf, off); - targetSubsection[i].write(); - } - backing.putInt(48, targetSubsection.length); - putPointer(backing, 44, targetSubsection_buf); - } - - public int size() { - return 56; - } - } - - public static class ClassifyDistancesReport extends DisposedStruct { - public ClassifiedDisparity[] classifiedDistances; // Disparity array - // containing the - // classified distances. - private ByteBuffer classifiedDistances_buf; - - private void init() { - classifiedDistances = new ClassifiedDisparity[0]; - } - - public ClassifyDistancesReport() { - super(8); - init(); - } - - public ClassifyDistancesReport(ClassifiedDisparity[] classifiedDistances) { - super(8); - this.classifiedDistances = classifiedDistances; - } - - protected ClassifyDistancesReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ClassifyDistancesReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int classifiedDistances_numClassifiedDistances = backing.getInt(4); - long classifiedDistances_addr = getPointer(backing, 0); - classifiedDistances = new ClassifiedDisparity[classifiedDistances_numClassifiedDistances]; - if (classifiedDistances_numClassifiedDistances > 0 && classifiedDistances_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(classifiedDistances_addr, - classifiedDistances_numClassifiedDistances * 56); - for (int i = 0, off = 0; i < classifiedDistances_numClassifiedDistances; i++, off += 56) { - classifiedDistances[i] = new ClassifiedDisparity(bb, off); - classifiedDistances[i].read(); - } - } - } - - public void write() { - classifiedDistances_buf = - ByteBuffer.allocateDirect(classifiedDistances.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < classifiedDistances.length; i++, off += 56) { - classifiedDistances[i].setBuffer(classifiedDistances_buf, off); - classifiedDistances[i].write(); - } - backing.putInt(4, classifiedDistances.length); - putPointer(backing, 0, classifiedDistances_buf); - } - - public int size() { - return 8; - } - } - - public static class ContourComputeCurvatureReport extends DisposedStruct { - public double[] curvaturePixel; // Curvature Pixel displays the curvature - // profile for the selected contour, in - // pixels. - public double[] curvatureReal; // Curvature Real displays the curvature - // profile for the selected contour, in - // calibrated units. - private ByteBuffer curvaturePixel_buf; - private ByteBuffer curvatureReal_buf; - - private void init() { - curvaturePixel = new double[0]; - curvatureReal = new double[0]; - } - - public ContourComputeCurvatureReport() { - super(16); - init(); - } - - public ContourComputeCurvatureReport(double[] curvaturePixel, double[] curvatureReal) { - super(16); - this.curvaturePixel = curvaturePixel; - this.curvatureReal = curvatureReal; - } - - protected ContourComputeCurvatureReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ContourComputeCurvatureReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int curvaturePixel_numCurvaturePixel = backing.getInt(4); - long curvaturePixel_addr = getPointer(backing, 0); - curvaturePixel = new double[curvaturePixel_numCurvaturePixel]; - if (curvaturePixel_numCurvaturePixel > 0 && curvaturePixel_addr != 0) { - newDirectByteBuffer(curvaturePixel_addr, curvaturePixel_numCurvaturePixel * 8) - .asDoubleBuffer().get(curvaturePixel); - } - int curvatureReal_numCurvatureReal = backing.getInt(12); - long curvatureReal_addr = getPointer(backing, 8); - curvatureReal = new double[curvatureReal_numCurvatureReal]; - if (curvatureReal_numCurvatureReal > 0 && curvatureReal_addr != 0) { - newDirectByteBuffer(curvatureReal_addr, curvatureReal_numCurvatureReal * 8) - .asDoubleBuffer().get(curvatureReal); - } - } - - public void write() { - curvaturePixel_buf = - ByteBuffer.allocateDirect(curvaturePixel.length * 8).order(ByteOrder.nativeOrder()); - curvaturePixel_buf.asDoubleBuffer().put(curvaturePixel).rewind(); - backing.putInt(4, curvaturePixel.length); - putPointer(backing, 0, curvaturePixel_buf); - curvatureReal_buf = - ByteBuffer.allocateDirect(curvatureReal.length * 8).order(ByteOrder.nativeOrder()); - curvatureReal_buf.asDoubleBuffer().put(curvatureReal).rewind(); - backing.putInt(12, curvatureReal.length); - putPointer(backing, 8, curvatureReal_buf); - } - - public int size() { - return 16; - } - } - - public static class ContourOverlaySettings extends DisposedStruct { - public int overlay; // Overlay specifies whether to display the overlay on - // the image. - public RGBValue color; // Color is the color of the overlay. - public int width; // Width specifies the width of the overlay in pixels. - public int maintainWidth; // Maintain Width? specifies whether you want the - // overlay measured in screen pixels or image - // pixels. - - private void init() { - color = new RGBValue(backing, 4); - } - - public ContourOverlaySettings() { - super(16); - init(); - } - - public ContourOverlaySettings(int overlay, RGBValue color, int width, int maintainWidth) { - super(16); - this.overlay = overlay; - this.color = color; - this.width = width; - this.maintainWidth = maintainWidth; - } - - protected ContourOverlaySettings(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ContourOverlaySettings(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - overlay = backing.getInt(0); - color.read(); - width = backing.getInt(8); - maintainWidth = backing.getInt(12); - } - - public void write() { - backing.putInt(0, overlay); - color.write(); - backing.putInt(8, width); - backing.putInt(12, maintainWidth); - } - - public int size() { - return 16; - } - } - - public static class CurveParameters extends DisposedStruct { - public ExtractionMode extractionMode; // Specifies the method the function - // uses to identify curves in the - // image. - public int threshold; // Specifies the minimum contrast a seed point must - // have in order to begin a curve. - public EdgeFilterSize filterSize; // Specifies the width of the edge filter - // the function uses to identify curves in - // the image. - public int minLength; // Specifies the length, in pixels, of the smallest - // curve the function will extract. - public int searchStep; // Search Step Size specifies the distance, in the y - // direction, between the image rows that the - // algorithm inspects for curve seed points. - public int maxEndPointGap; // Specifies the maximum gap, in pixels, between - // the endpoints of a curve that the function - // identifies as a closed curve. - public int subpixel; // Subpixel specifies whether to detect curve points - // with subpixel accuracy. - - private void init() { - - } - - public CurveParameters() { - super(28); - init(); - } - - public CurveParameters(ExtractionMode extractionMode, int threshold, EdgeFilterSize filterSize, - int minLength, int searchStep, int maxEndPointGap, int subpixel) { - super(28); - this.extractionMode = extractionMode; - this.threshold = threshold; - this.filterSize = filterSize; - this.minLength = minLength; - this.searchStep = searchStep; - this.maxEndPointGap = maxEndPointGap; - this.subpixel = subpixel; - } - - protected CurveParameters(ByteBuffer backing, int offset) { - super(backing, offset, 28); - init(); - } - - protected CurveParameters(long nativeObj, boolean owned) { - super(nativeObj, owned, 28); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 28); - } - - public void read() { - extractionMode = ExtractionMode.fromValue(backing.getInt(0)); - threshold = backing.getInt(4); - filterSize = EdgeFilterSize.fromValue(backing.getInt(8)); - minLength = backing.getInt(12); - searchStep = backing.getInt(16); - maxEndPointGap = backing.getInt(20); - subpixel = backing.getInt(24); - } - - public void write() { - if (extractionMode != null) - backing.putInt(0, extractionMode.getValue()); - backing.putInt(4, threshold); - if (filterSize != null) - backing.putInt(8, filterSize.getValue()); - backing.putInt(12, minLength); - backing.putInt(16, searchStep); - backing.putInt(20, maxEndPointGap); - backing.putInt(24, subpixel); - } - - public int size() { - return 28; - } - } - - public static class ExtractContourReport extends DisposedStruct { - public PointDouble[] contourPoints; // Contour Points specifies every point - // found on the contour. - public PointDouble[] sourcePoints; // Source Image Points specifies every - // point found on the contour in the - // source image. - private ByteBuffer contourPoints_buf; - private ByteBuffer sourcePoints_buf; - - private void init() { - contourPoints = new PointDouble[0]; - sourcePoints = new PointDouble[0]; - } - - public ExtractContourReport() { - super(16); - init(); - } - - public ExtractContourReport(PointDouble[] contourPoints, PointDouble[] sourcePoints) { - super(16); - this.contourPoints = contourPoints; - this.sourcePoints = sourcePoints; - } - - protected ExtractContourReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ExtractContourReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int contourPoints_numContourPoints = backing.getInt(4); - long contourPoints_addr = getPointer(backing, 0); - contourPoints = new PointDouble[contourPoints_numContourPoints]; - if (contourPoints_numContourPoints > 0 && contourPoints_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(contourPoints_addr, contourPoints_numContourPoints * 16); - for (int i = 0, off = 0; i < contourPoints_numContourPoints; i++, off += 16) { - contourPoints[i] = new PointDouble(bb, off); - contourPoints[i].read(); - } - } - int sourcePoints_numSourcePoints = backing.getInt(12); - long sourcePoints_addr = getPointer(backing, 8); - sourcePoints = new PointDouble[sourcePoints_numSourcePoints]; - if (sourcePoints_numSourcePoints > 0 && sourcePoints_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(sourcePoints_addr, sourcePoints_numSourcePoints * 16); - for (int i = 0, off = 0; i < sourcePoints_numSourcePoints; i++, off += 16) { - sourcePoints[i] = new PointDouble(bb, off); - sourcePoints[i].read(); - } - } - } - - public void write() { - contourPoints_buf = - ByteBuffer.allocateDirect(contourPoints.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < contourPoints.length; i++, off += 16) { - contourPoints[i].setBuffer(contourPoints_buf, off); - contourPoints[i].write(); - } - backing.putInt(4, contourPoints.length); - putPointer(backing, 0, contourPoints_buf); - sourcePoints_buf = - ByteBuffer.allocateDirect(sourcePoints.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < sourcePoints.length; i++, off += 16) { - sourcePoints[i].setBuffer(sourcePoints_buf, off); - sourcePoints[i].write(); - } - backing.putInt(12, sourcePoints.length); - putPointer(backing, 8, sourcePoints_buf); - } - - public int size() { - return 16; - } - } - - public static class ConnectionConstraint extends DisposedStruct { - public ConnectionConstraintType constraintType; // Constraint Type specifies - // what criteria to use to - // consider two curves part - // of a contour. - public RangeDouble range; // Specifies range for a given Match Constraint. - - private void init() { - range = new RangeDouble(backing, 8); - } - - public ConnectionConstraint() { - super(24); - init(); - } - - public ConnectionConstraint(ConnectionConstraintType constraintType, RangeDouble range) { - super(24); - this.constraintType = constraintType; - this.range = range; - } - - protected ConnectionConstraint(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ConnectionConstraint(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - constraintType = ConnectionConstraintType.fromValue(backing.getInt(0)); - range.read(); - } - - public void write() { - if (constraintType != null) - backing.putInt(0, constraintType.getValue()); - range.write(); - } - - public int size() { - return 24; - } - } - - public static class ExtractTextureFeaturesReport extends DisposedStruct { - public int[] waveletBands; // The array having all the Wavelet Banks used - // for extraction. - public int textureFeaturesRows; // Number of Rows in the Texture Features - // array. - public int textureFeaturesCols; // Number of Cols in Texture Features array. - private ByteBuffer waveletBands_buf; - - private void init() { - waveletBands = new int[0]; - } - - public ExtractTextureFeaturesReport() { - super(20); - init(); - } - - public ExtractTextureFeaturesReport(int[] waveletBands, int textureFeaturesRows, - int textureFeaturesCols) { - super(20); - this.waveletBands = waveletBands; - this.textureFeaturesRows = textureFeaturesRows; - this.textureFeaturesCols = textureFeaturesCols; - } - - protected ExtractTextureFeaturesReport(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected ExtractTextureFeaturesReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - int waveletBands_numWaveletBands = backing.getInt(4); - long waveletBands_addr = getPointer(backing, 0); - waveletBands = new int[waveletBands_numWaveletBands]; - if (waveletBands_numWaveletBands > 0 && waveletBands_addr != 0) { - newDirectByteBuffer(waveletBands_addr, waveletBands_numWaveletBands * 4).asIntBuffer().get( - waveletBands); - } - textureFeaturesRows = backing.getInt(12); - textureFeaturesCols = backing.getInt(16); - } - - public void write() { - waveletBands_buf = - ByteBuffer.allocateDirect(waveletBands.length * 4).order(ByteOrder.nativeOrder()); - waveletBands_buf.asIntBuffer().put(waveletBands).rewind(); - backing.putInt(4, waveletBands.length); - putPointer(backing, 0, waveletBands_buf); - backing.putInt(12, textureFeaturesRows); - backing.putInt(16, textureFeaturesCols); - } - - public int size() { - return 20; - } - } - - public static class WaveletBandsReport extends DisposedStruct { - public float LHLBand; // 2-D array for LHL Band. - public int rows; // Number of Rows for each of the 2-D arrays. - public int cols; // Number of Columns for each of the 2-D arrays. - - private void init() { - - } - - public WaveletBandsReport() { - super(40); - init(); - } - - public WaveletBandsReport(double LHLBand, int rows, int cols) { - super(40); - this.LHLBand = (float) LHLBand; - this.rows = rows; - this.cols = cols; - } - - protected WaveletBandsReport(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected WaveletBandsReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - LHLBand = backing.getFloat(24); - rows = backing.getInt(32); - cols = backing.getInt(36); - } - - public void write() { - backing.putFloat(24, LHLBand); - backing.putInt(32, rows); - backing.putInt(36, cols); - } - - public int size() { - return 40; - } - } - - public static class CircleFitOptions extends DisposedStruct { - public int maxRadius; // Specifies the acceptable distance, in pixels, that - // a point determined to belong to the circle can be - // from the perimeter of the circle. - public double stepSize; // Step Size is the angle, in degrees, between each - // radial line in the annular region. - public RakeProcessType processType; // Method used to process the data - // extracted for edge detection. - - private void init() { - - } - - public CircleFitOptions() { - super(24); - init(); - } - - public CircleFitOptions(int maxRadius, double stepSize, RakeProcessType processType) { - super(24); - this.maxRadius = maxRadius; - this.stepSize = stepSize; - this.processType = processType; - } - - protected CircleFitOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected CircleFitOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - maxRadius = backing.getInt(0); - stepSize = backing.getDouble(8); - processType = RakeProcessType.fromValue(backing.getInt(16)); - } - - public void write() { - backing.putInt(0, maxRadius); - backing.putDouble(8, stepSize); - if (processType != null) - backing.putInt(16, processType.getValue()); - } - - public int size() { - return 24; - } - } - - public static class EdgeOptions2 extends DisposedStruct { - public EdgePolaritySearchMode polarity; // Specifies the polarity of the - // edges to be found. - public int kernelSize; // Specifies the size of the edge detection kernel. - public int width; // Specifies the number of pixels averaged perpendicular - // to the search direction to compute the edge profile - // strength at each point along the search ROI. - public float minThreshold; // Specifies the minimum edge strength (gradient - // magnitude) required for a detected edge. - public InterpolationMethod interpolationType; // Specifies the interpolation - // method used to locate the - // edge position. - public ColumnProcessingMode columnProcessingMode; // Specifies the method - // used to find the - // straight edge. - - private void init() { - - } - - public EdgeOptions2() { - super(24); - init(); - } - - public EdgeOptions2(EdgePolaritySearchMode polarity, int kernelSize, int width, - double minThreshold, InterpolationMethod interpolationType, - ColumnProcessingMode columnProcessingMode) { - super(24); - this.polarity = polarity; - this.kernelSize = kernelSize; - this.width = width; - this.minThreshold = (float) minThreshold; - this.interpolationType = interpolationType; - this.columnProcessingMode = columnProcessingMode; - } - - protected EdgeOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected EdgeOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - polarity = EdgePolaritySearchMode.fromValue(backing.getInt(0)); - kernelSize = backing.getInt(4); - width = backing.getInt(8); - minThreshold = backing.getFloat(12); - interpolationType = InterpolationMethod.fromValue(backing.getInt(16)); - columnProcessingMode = ColumnProcessingMode.fromValue(backing.getInt(20)); - } - - public void write() { - if (polarity != null) - backing.putInt(0, polarity.getValue()); - backing.putInt(4, kernelSize); - backing.putInt(8, width); - backing.putFloat(12, minThreshold); - if (interpolationType != null) - backing.putInt(16, interpolationType.getValue()); - if (columnProcessingMode != null) - backing.putInt(20, columnProcessingMode.getValue()); - } - - public int size() { - return 24; - } - } - - public static class FindCircularEdgeOptions extends DisposedStruct { - public SpokeDirection direction; // Specifies the Spoke direction to search - // in the ROI. - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showSearchLines; // If TRUE, the function overlays the search - // lines used to locate the edges on the image. - public int showEdgesFound; // If TRUE, the function overlays the locations - // of the edges found on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue searchLinesColor; // Specifies the RGB color value to use to - // overlay the search lines. - public RGBValue searchEdgesColor; // Specifies the RGB color value to use to - // overlay the search edges. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the overlay group name to - // assign to the overlays. - public EdgeOptions2 edgeOptions; // Specifies the edge detection options - // along a single search line. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 20); - searchLinesColor = new RGBValue(backing, 24); - searchEdgesColor = new RGBValue(backing, 28); - resultColor = new RGBValue(backing, 32); - edgeOptions = new EdgeOptions2(backing, 40); - } - - public FindCircularEdgeOptions() { - super(64); - init(); - } - - public FindCircularEdgeOptions(SpokeDirection direction, int showSearchArea, - int showSearchLines, int showEdgesFound, int showResult, RGBValue searchAreaColor, - RGBValue searchLinesColor, RGBValue searchEdgesColor, RGBValue resultColor, - String overlayGroupName, EdgeOptions2 edgeOptions) { - super(64); - this.direction = direction; - this.showSearchArea = showSearchArea; - this.showSearchLines = showSearchLines; - this.showEdgesFound = showEdgesFound; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.searchLinesColor = searchLinesColor; - this.searchEdgesColor = searchEdgesColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - this.edgeOptions = edgeOptions; - } - - protected FindCircularEdgeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected FindCircularEdgeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - direction = SpokeDirection.fromValue(backing.getInt(0)); - showSearchArea = backing.getInt(4); - showSearchLines = backing.getInt(8); - showEdgesFound = backing.getInt(12); - showResult = backing.getInt(16); - searchAreaColor.read(); - searchLinesColor.read(); - searchEdgesColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 36); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - edgeOptions.read(); - } - - public void write() { - if (direction != null) - backing.putInt(0, direction.getValue()); - backing.putInt(4, showSearchArea); - backing.putInt(8, showSearchLines); - backing.putInt(12, showEdgesFound); - backing.putInt(16, showResult); - searchAreaColor.write(); - searchLinesColor.write(); - searchEdgesColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 36, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - edgeOptions.write(); - } - - public int size() { - return 64; - } - } - - public static class FindConcentricEdgeOptions extends DisposedStruct { - public ConcentricRakeDirection direction; // Specifies the Concentric Rake - // direction. - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showSearchLines; // If TRUE, the function overlays the search - // lines used to locate the edges on the image. - public int showEdgesFound; // If TRUE, the function overlays the locations - // of the edges found on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue searchLinesColor; // Specifies the RGB color value to use to - // overlay the search lines. - public RGBValue searchEdgesColor; // Specifies the RGB color value to use to - // overlay the search edges. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the overlay group name to - // assign to the overlays. - public EdgeOptions2 edgeOptions; // Specifies the edge detection options - // along a single search line. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 20); - searchLinesColor = new RGBValue(backing, 24); - searchEdgesColor = new RGBValue(backing, 28); - resultColor = new RGBValue(backing, 32); - edgeOptions = new EdgeOptions2(backing, 40); - } - - public FindConcentricEdgeOptions() { - super(64); - init(); - } - - public FindConcentricEdgeOptions(ConcentricRakeDirection direction, int showSearchArea, - int showSearchLines, int showEdgesFound, int showResult, RGBValue searchAreaColor, - RGBValue searchLinesColor, RGBValue searchEdgesColor, RGBValue resultColor, - String overlayGroupName, EdgeOptions2 edgeOptions) { - super(64); - this.direction = direction; - this.showSearchArea = showSearchArea; - this.showSearchLines = showSearchLines; - this.showEdgesFound = showEdgesFound; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.searchLinesColor = searchLinesColor; - this.searchEdgesColor = searchEdgesColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - this.edgeOptions = edgeOptions; - } - - protected FindConcentricEdgeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected FindConcentricEdgeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - direction = ConcentricRakeDirection.fromValue(backing.getInt(0)); - showSearchArea = backing.getInt(4); - showSearchLines = backing.getInt(8); - showEdgesFound = backing.getInt(12); - showResult = backing.getInt(16); - searchAreaColor.read(); - searchLinesColor.read(); - searchEdgesColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 36); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - edgeOptions.read(); - } - - public void write() { - if (direction != null) - backing.putInt(0, direction.getValue()); - backing.putInt(4, showSearchArea); - backing.putInt(8, showSearchLines); - backing.putInt(12, showEdgesFound); - backing.putInt(16, showResult); - searchAreaColor.write(); - searchLinesColor.write(); - searchEdgesColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 36, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - edgeOptions.write(); - } - - public int size() { - return 64; - } - } - - public static class ConcentricEdgeFitOptions extends DisposedStruct { - public int maxRadius; // Specifies the acceptable distance, in pixels, that - // a point determined to belong to the circle can be - // from the perimeter of the circle. - public double stepSize; // The sampling factor that determines the gap - // between the rake lines. - public RakeProcessType processType; // Method used to process the data - // extracted for edge detection. - - private void init() { - - } - - public ConcentricEdgeFitOptions() { - super(24); - init(); - } - - public ConcentricEdgeFitOptions(int maxRadius, double stepSize, RakeProcessType processType) { - super(24); - this.maxRadius = maxRadius; - this.stepSize = stepSize; - this.processType = processType; - } - - protected ConcentricEdgeFitOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ConcentricEdgeFitOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - maxRadius = backing.getInt(0); - stepSize = backing.getDouble(8); - processType = RakeProcessType.fromValue(backing.getInt(16)); - } - - public void write() { - backing.putInt(0, maxRadius); - backing.putDouble(8, stepSize); - if (processType != null) - backing.putInt(16, processType.getValue()); - } - - public int size() { - return 24; - } - } - - public static class FindConcentricEdgeReport extends DisposedStruct { - public PointFloat startPt; // Pixel Coordinates for starting point of the - // edge. - public PointFloat endPt; // Pixel Coordinates for end point of the edge. - public PointFloat startPtCalibrated; // Real world Coordinates for starting - // point of the edge. - public PointFloat endPtCalibrated; // Real world Coordinates for end point - // of the edge. - public double angle; // Angle of the edge found. - public double angleCalibrated; // Calibrated angle of the edge found. - public double straightness; // The straightness value of the detected - // straight edge. - public double avgStrength; // Average strength of the egde found. - public double avgSNR; // Average SNR(Signal to Noise Ratio) for the edge - // found. - public int lineFound; // If the edge is found or not. - - private void init() { - startPt = new PointFloat(backing, 0); - endPt = new PointFloat(backing, 8); - startPtCalibrated = new PointFloat(backing, 16); - endPtCalibrated = new PointFloat(backing, 24); - } - - public FindConcentricEdgeReport() { - super(80); - init(); - } - - public FindConcentricEdgeReport(PointFloat startPt, PointFloat endPt, - PointFloat startPtCalibrated, PointFloat endPtCalibrated, double angle, - double angleCalibrated, double straightness, double avgStrength, double avgSNR, - int lineFound) { - super(80); - this.startPt = startPt; - this.endPt = endPt; - this.startPtCalibrated = startPtCalibrated; - this.endPtCalibrated = endPtCalibrated; - this.angle = angle; - this.angleCalibrated = angleCalibrated; - this.straightness = straightness; - this.avgStrength = avgStrength; - this.avgSNR = avgSNR; - this.lineFound = lineFound; - } - - protected FindConcentricEdgeReport(ByteBuffer backing, int offset) { - super(backing, offset, 80); - init(); - } - - protected FindConcentricEdgeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 80); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 80); - } - - public void read() { - startPt.read(); - endPt.read(); - startPtCalibrated.read(); - endPtCalibrated.read(); - angle = backing.getDouble(32); - angleCalibrated = backing.getDouble(40); - straightness = backing.getDouble(48); - avgStrength = backing.getDouble(56); - avgSNR = backing.getDouble(64); - lineFound = backing.getInt(72); - } - - public void write() { - startPt.write(); - endPt.write(); - startPtCalibrated.write(); - endPtCalibrated.write(); - backing.putDouble(32, angle); - backing.putDouble(40, angleCalibrated); - backing.putDouble(48, straightness); - backing.putDouble(56, avgStrength); - backing.putDouble(64, avgSNR); - backing.putInt(72, lineFound); - } - - public int size() { - return 80; - } - } - - public static class FindCircularEdgeReport extends DisposedStruct { - public PointFloat centerCalibrated; // Real world Coordinates of the Center. - public double radiusCalibrated; // Real world radius of the Circular Edge - // found. - public PointFloat center; // Pixel Coordinates of the Center. - public double radius; // Radius in pixels of the Circular Edge found. - public double roundness; // The roundness of the calculated circular edge. - public double avgStrength; // Average strength of the egde found. - public double avgSNR; // Average SNR(Signal to Noise Ratio) for the edge - // found. - public int circleFound; // If the circlular edge is found or not. - - private void init() { - centerCalibrated = new PointFloat(backing, 0); - center = new PointFloat(backing, 16); - } - - public FindCircularEdgeReport() { - super(64); - init(); - } - - public FindCircularEdgeReport(PointFloat centerCalibrated, double radiusCalibrated, - PointFloat center, double radius, double roundness, double avgStrength, double avgSNR, - int circleFound) { - super(64); - this.centerCalibrated = centerCalibrated; - this.radiusCalibrated = radiusCalibrated; - this.center = center; - this.radius = radius; - this.roundness = roundness; - this.avgStrength = avgStrength; - this.avgSNR = avgSNR; - this.circleFound = circleFound; - } - - protected FindCircularEdgeReport(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected FindCircularEdgeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - centerCalibrated.read(); - radiusCalibrated = backing.getDouble(8); - center.read(); - radius = backing.getDouble(24); - roundness = backing.getDouble(32); - avgStrength = backing.getDouble(40); - avgSNR = backing.getDouble(48); - circleFound = backing.getInt(56); - } - - public void write() { - centerCalibrated.write(); - backing.putDouble(8, radiusCalibrated); - center.write(); - backing.putDouble(24, radius); - backing.putDouble(32, roundness); - backing.putDouble(40, avgStrength); - backing.putDouble(48, avgSNR); - backing.putInt(56, circleFound); - } - - public int size() { - return 64; - } - } - - public static class WindowSize extends DisposedStruct { - public int x; // Window lenght on X direction. - public int y; // Window lenght on Y direction. - public int stepSize; // Distance between windows. - - private void init() { - - } - - public WindowSize() { - super(12); - init(); - } - - public WindowSize(int x, int y, int stepSize) { - super(12); - this.x = x; - this.y = y; - this.stepSize = stepSize; - } - - protected WindowSize(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected WindowSize(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - x = backing.getInt(0); - y = backing.getInt(4); - stepSize = backing.getInt(8); - } - - public void write() { - backing.putInt(0, x); - backing.putInt(4, y); - backing.putInt(8, stepSize); - } - - public int size() { - return 12; - } - } - - public static class DisplacementVector extends DisposedStruct { - public int x; // length on X direction. - public int y; // length on Y direction. - - private void init() { - - } - - public DisplacementVector() { - super(8); - init(); - } - - public DisplacementVector(int x, int y) { - super(8); - this.x = x; - this.y = y; - } - - protected DisplacementVector(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected DisplacementVector(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - x = backing.getInt(0); - y = backing.getInt(4); - } - - public void write() { - backing.putInt(0, x); - backing.putInt(4, y); - } - - public int size() { - return 8; - } - } - - public static class WaveletOptions extends DisposedStruct { - public WaveletType typeOfWavelet; // Type of wavelet(db, bior. - public float minEnergy; // Minimum Energy in the bands to consider for - // texture defect detection. - - private void init() { - - } - - public WaveletOptions() { - super(8); - init(); - } - - public WaveletOptions(WaveletType typeOfWavelet, double minEnergy) { - super(8); - this.typeOfWavelet = typeOfWavelet; - this.minEnergy = (float) minEnergy; - } - - protected WaveletOptions(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected WaveletOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - typeOfWavelet = WaveletType.fromValue(backing.getInt(0)); - minEnergy = backing.getFloat(4); - } - - public void write() { - if (typeOfWavelet != null) - backing.putInt(0, typeOfWavelet.getValue()); - backing.putFloat(4, minEnergy); - } - - public int size() { - return 8; - } - } - - public static class CooccurrenceOptions extends DisposedStruct { - public int level; // Level/size of matrix. - public DisplacementVector displacement; // Displacemnet between pixels to - // accumulate the matrix. - - private void init() { - displacement = new DisplacementVector(backing, 4); - } - - public CooccurrenceOptions() { - super(12); - init(); - } - - public CooccurrenceOptions(int level, DisplacementVector displacement) { - super(12); - this.level = level; - this.displacement = displacement; - } - - protected CooccurrenceOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected CooccurrenceOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - level = backing.getInt(0); - displacement.read(); - } - - public void write() { - backing.putInt(0, level); - displacement.write(); - } - - public int size() { - return 12; - } - } - - public static class ParticleClassifierLocalThresholdOptions extends DisposedStruct { - public LocalThresholdMethod method; // Specifies the local thresholding - // method the function uses. - public ParticleType particleType; // Specifies what kind of particles to - // look for. - public int windowWidth; // The width of the rectangular window around the - // pixel on which the function performs the local - // threshold. - public int windowHeight; // The height of the rectangular window around the - // pixel on which the function performs the local - // threshold. - public double deviationWeight; // Specifies the k constant used in the - // Niblack local thresholding algorithm, - // which determines the weight applied to the - // variance calculation. - - private void init() { - - } - - public ParticleClassifierLocalThresholdOptions() { - super(24); - init(); - } - - public ParticleClassifierLocalThresholdOptions(LocalThresholdMethod method, - ParticleType particleType, int windowWidth, int windowHeight, double deviationWeight) { - super(24); - this.method = method; - this.particleType = particleType; - this.windowWidth = windowWidth; - this.windowHeight = windowHeight; - this.deviationWeight = deviationWeight; - } - - protected ParticleClassifierLocalThresholdOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ParticleClassifierLocalThresholdOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - method = LocalThresholdMethod.fromValue(backing.getInt(0)); - particleType = ParticleType.fromValue(backing.getInt(4)); - windowWidth = backing.getInt(8); - windowHeight = backing.getInt(12); - deviationWeight = backing.getDouble(16); - } - - public void write() { - if (method != null) - backing.putInt(0, method.getValue()); - if (particleType != null) - backing.putInt(4, particleType.getValue()); - backing.putInt(8, windowWidth); - backing.putInt(12, windowHeight); - backing.putDouble(16, deviationWeight); - } - - public int size() { - return 24; - } - } - - public static class RangeFloat extends DisposedStruct { - public float minValue; // The minimum value of the range. - public float maxValue; // The maximum value of the range. - - private void init() { - - } - - public RangeFloat() { - super(8); - init(); - } - - public RangeFloat(double minValue, double maxValue) { - super(8); - this.minValue = (float) minValue; - this.maxValue = (float) maxValue; - } - - protected RangeFloat(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected RangeFloat(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - minValue = backing.getFloat(0); - maxValue = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, minValue); - backing.putFloat(4, maxValue); - } - - public int size() { - return 8; - } - } - - public static class ParticleClassifierAutoThresholdOptions extends DisposedStruct { - public ThresholdMethod method; // The method for binary thresholding, which - // specifies how to calculate the classes. - public ParticleType particleType; // Specifies what kind of particles to - // look for. - public RangeFloat limits; // The limits on the automatic threshold range. - - private void init() { - limits = new RangeFloat(backing, 8); - } - - public ParticleClassifierAutoThresholdOptions() { - super(16); - init(); - } - - public ParticleClassifierAutoThresholdOptions(ThresholdMethod method, - ParticleType particleType, RangeFloat limits) { - super(16); - this.method = method; - this.particleType = particleType; - this.limits = limits; - } - - protected ParticleClassifierAutoThresholdOptions(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ParticleClassifierAutoThresholdOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - method = ThresholdMethod.fromValue(backing.getInt(0)); - particleType = ParticleType.fromValue(backing.getInt(4)); - limits.read(); - } - - public void write() { - if (method != null) - backing.putInt(0, method.getValue()); - if (particleType != null) - backing.putInt(4, particleType.getValue()); - limits.write(); - } - - public int size() { - return 16; - } - } - - public static class ParticleClassifierPreprocessingOptions2 extends DisposedStruct { - public ParticleClassifierThresholdType thresholdType; // The type of - // threshold to - // perform on the - // image. - public RangeFloat manualThresholdRange; // The range of pixels to keep if - // manually thresholding the image. - public ParticleClassifierAutoThresholdOptions autoThresholdOptions; // The - // options - // used - // to - // auto - // threshold - // the - // image. - public ParticleClassifierLocalThresholdOptions localThresholdOptions; // The - // options - // used - // to - // local - // threshold - // the - // image. - public int rejectBorder; // Set this element to TRUE to reject border - // particles. - public int numErosions; // The number of erosions to perform. - - private void init() { - manualThresholdRange = new RangeFloat(backing, 4); - autoThresholdOptions = new ParticleClassifierAutoThresholdOptions(backing, 12); - localThresholdOptions = new ParticleClassifierLocalThresholdOptions(backing, 32); - } - - public ParticleClassifierPreprocessingOptions2() { - super(64); - init(); - } - - public ParticleClassifierPreprocessingOptions2(ParticleClassifierThresholdType thresholdType, - RangeFloat manualThresholdRange, - ParticleClassifierAutoThresholdOptions autoThresholdOptions, - ParticleClassifierLocalThresholdOptions localThresholdOptions, int rejectBorder, - int numErosions) { - super(64); - this.thresholdType = thresholdType; - this.manualThresholdRange = manualThresholdRange; - this.autoThresholdOptions = autoThresholdOptions; - this.localThresholdOptions = localThresholdOptions; - this.rejectBorder = rejectBorder; - this.numErosions = numErosions; - } - - protected ParticleClassifierPreprocessingOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected ParticleClassifierPreprocessingOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - thresholdType = ParticleClassifierThresholdType.fromValue(backing.getInt(0)); - manualThresholdRange.read(); - autoThresholdOptions.read(); - localThresholdOptions.read(); - rejectBorder = backing.getInt(56); - numErosions = backing.getInt(60); - } - - public void write() { - if (thresholdType != null) - backing.putInt(0, thresholdType.getValue()); - manualThresholdRange.write(); - autoThresholdOptions.write(); - localThresholdOptions.write(); - backing.putInt(56, rejectBorder); - backing.putInt(60, numErosions); - } - - public int size() { - return 64; - } - } - - public static class MeasureParticlesReport extends DisposedStruct { - public int numParticles; // The number of particles on which measurements - // were taken. - public int numMeasurements; // The number of measurements taken. - - private void init() { - - } - - public MeasureParticlesReport() { - super(16); - init(); - } - - public MeasureParticlesReport(int numParticles, int numMeasurements) { - super(16); - this.numParticles = numParticles; - this.numMeasurements = numMeasurements; - } - - protected MeasureParticlesReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected MeasureParticlesReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - numParticles = backing.getInt(8); - numMeasurements = backing.getInt(12); - } - - public void write() { - backing.putInt(8, numParticles); - backing.putInt(12, numMeasurements); - } - - public int size() { - return 16; - } - } - - public static class GeometricPatternMatch3 extends DisposedStruct { - public PointFloat position; // The location of the origin of the template in - // the match. - public float rotation; // The rotation of the match relative to the template - // image, in degrees. - public float scale; // The size of the match relative to the size of the - // template image, expressed as a percentage. - public float score; // The accuracy of the match. - public PointFloat[] corner; // An array of four points describing the - // rectangle surrounding the template image. - public int inverse; // This element is TRUE if the match is an inverse of - // the template image. - public float occlusion; // The percentage of the match that is occluded. - public float templateMatchCurveScore; // The accuracy of the match obtained - // by comparing the template curves to - // the curves in the match region. - public float matchTemplateCurveScore; // The accuracy of the match obtained - // by comparing the curves in the - // match region to the template - // curves. - public float correlationScore; // The accuracy of the match obtained by - // comparing the template image to the match - // region using a correlation metric that - // compares the two regions as a function of - // their pixel values. - public PointFloat calibratedPosition; // The location of the origin of the - // template in the match. - public float calibratedRotation; // The rotation of the match relative to - // the template image, in degrees. - public PointFloat[] calibratedCorner; // An array of four points describing - // the rectangle surrounding the - // template image. - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 20; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - calibratedPosition = new PointFloat(backing, 72); - calibratedCorner = new PointFloat[4]; - - for (int i = 0, off = 84; i < 4; i++, off += 8) - calibratedCorner[i] = new PointFloat(backing, off); - } - - public GeometricPatternMatch3() { - super(116); - init(); - } - - public GeometricPatternMatch3(PointFloat position, double rotation, double scale, double score, - PointFloat[] corner, int inverse, double occlusion, double templateMatchCurveScore, - double matchTemplateCurveScore, double correlationScore, PointFloat calibratedPosition, - double calibratedRotation, PointFloat[] calibratedCorner) { - super(116); - this.position = position; - this.rotation = (float) rotation; - this.scale = (float) scale; - this.score = (float) score; - this.corner = corner; - this.inverse = inverse; - this.occlusion = (float) occlusion; - this.templateMatchCurveScore = (float) templateMatchCurveScore; - this.matchTemplateCurveScore = (float) matchTemplateCurveScore; - this.correlationScore = (float) correlationScore; - this.calibratedPosition = calibratedPosition; - this.calibratedRotation = (float) calibratedRotation; - this.calibratedCorner = calibratedCorner; - } - - protected GeometricPatternMatch3(ByteBuffer backing, int offset) { - super(backing, offset, 116); - init(); - } - - protected GeometricPatternMatch3(long nativeObj, boolean owned) { - super(nativeObj, owned, 116); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 116); - } - - public void read() { - position.read(); - rotation = backing.getFloat(8); - scale = backing.getFloat(12); - score = backing.getFloat(16); - for (PointFloat it : corner) { - it.read(); - } - inverse = backing.getInt(52); - occlusion = backing.getFloat(56); - templateMatchCurveScore = backing.getFloat(60); - matchTemplateCurveScore = backing.getFloat(64); - correlationScore = backing.getFloat(68); - calibratedPosition.read(); - calibratedRotation = backing.getFloat(80); - for (PointFloat it : calibratedCorner) { - it.read(); - } - } - - public void write() { - position.write(); - backing.putFloat(8, rotation); - backing.putFloat(12, scale); - backing.putFloat(16, score); - for (PointFloat it : corner) { - it.write(); - } - backing.putInt(52, inverse); - backing.putFloat(56, occlusion); - backing.putFloat(60, templateMatchCurveScore); - backing.putFloat(64, matchTemplateCurveScore); - backing.putFloat(68, correlationScore); - calibratedPosition.write(); - backing.putFloat(80, calibratedRotation); - for (PointFloat it : calibratedCorner) { - it.write(); - } - } - - public int size() { - return 116; - } - } - - public static class MatchGeometricPatternAdvancedOptions3 extends DisposedStruct { - public int subpixelIterations; // Specifies the maximum number of - // incremental improvements used to refine - // matches with subpixel information. - public double subpixelTolerance; // Specifies the maximum amount of change, - // in pixels, between consecutive - // incremental improvements in the match - // position before the function stops - // refining the match position. - public int initialMatchListLength; // Specifies the maximum size of the - // match list. - public int targetTemplateCurveScore; // Set this element to TRUE to specify - // that the function should calculate - // the match curve to template curve - // score and return it for each match - // result. - public int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation - // score and return it for each match result. - public double minMatchSeparationDistance; // Specifies the minimum - // separation distance, in pixels, - // between the origins of two - // matches that have unique - // positions. - public double minMatchSeparationAngle; // Specifies the minimum angular - // difference, in degrees, between - // two matches that have unique - // angles. - public double minMatchSeparationScale; // Specifies the minimum difference - // in scale, expressed as a - // percentage, between two matches - // that have unique scales. - public double maxMatchOverlap; // Specifies the maximum amount of overlap, - // expressed as a percentage, allowed between - // the bounding rectangles of two unique - // matches. - public int coarseResult; // Specifies whether you want the function to spend - // less time accurately estimating the location of - // a match. - public int enableCalibrationSupport; // Set this element to TRUE to specify - // the algorithm treat the inspection - // image as a calibrated image. - public ContrastMode enableContrastReversal; // Use this element to specify - // the contrast of the matches - // to search for in the image. - public GeometricMatchingSearchStrategy matchStrategy; // Specifies the - // aggressiveness of - // the search - // strategy. - public int refineMatchFactor; // Specifies the factor that is applied to the - // number of matches requested by the user to - // determine the number of matches that are - // refined at the initial matching stage. - public int subpixelMatchFactor; // Specifies the factor that is applied to - // the number of matches requested by the - // user to determine the number of matches - // that are evaluated at the final subpixel - // matching stage. - - private void init() { - - } - - public MatchGeometricPatternAdvancedOptions3() { - super(88); - init(); - } - - public MatchGeometricPatternAdvancedOptions3(int subpixelIterations, double subpixelTolerance, - int initialMatchListLength, int targetTemplateCurveScore, int correlationScore, - double minMatchSeparationDistance, double minMatchSeparationAngle, - double minMatchSeparationScale, double maxMatchOverlap, int coarseResult, - int enableCalibrationSupport, ContrastMode enableContrastReversal, - GeometricMatchingSearchStrategy matchStrategy, int refineMatchFactor, - int subpixelMatchFactor) { - super(88); - this.subpixelIterations = subpixelIterations; - this.subpixelTolerance = subpixelTolerance; - this.initialMatchListLength = initialMatchListLength; - this.targetTemplateCurveScore = targetTemplateCurveScore; - this.correlationScore = correlationScore; - this.minMatchSeparationDistance = minMatchSeparationDistance; - this.minMatchSeparationAngle = minMatchSeparationAngle; - this.minMatchSeparationScale = minMatchSeparationScale; - this.maxMatchOverlap = maxMatchOverlap; - this.coarseResult = coarseResult; - this.enableCalibrationSupport = enableCalibrationSupport; - this.enableContrastReversal = enableContrastReversal; - this.matchStrategy = matchStrategy; - this.refineMatchFactor = refineMatchFactor; - this.subpixelMatchFactor = subpixelMatchFactor; - } - - protected MatchGeometricPatternAdvancedOptions3(ByteBuffer backing, int offset) { - super(backing, offset, 88); - init(); - } - - protected MatchGeometricPatternAdvancedOptions3(long nativeObj, boolean owned) { - super(nativeObj, owned, 88); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 88); - } - - public void read() { - subpixelIterations = backing.getInt(0); - subpixelTolerance = backing.getDouble(8); - initialMatchListLength = backing.getInt(16); - targetTemplateCurveScore = backing.getInt(20); - correlationScore = backing.getInt(24); - minMatchSeparationDistance = backing.getDouble(32); - minMatchSeparationAngle = backing.getDouble(40); - minMatchSeparationScale = backing.getDouble(48); - maxMatchOverlap = backing.getDouble(56); - coarseResult = backing.getInt(64); - enableCalibrationSupport = backing.getInt(68); - enableContrastReversal = ContrastMode.fromValue(backing.getInt(72)); - matchStrategy = GeometricMatchingSearchStrategy.fromValue(backing.getInt(76)); - refineMatchFactor = backing.getInt(80); - subpixelMatchFactor = backing.getInt(84); - } - - public void write() { - backing.putInt(0, subpixelIterations); - backing.putDouble(8, subpixelTolerance); - backing.putInt(16, initialMatchListLength); - backing.putInt(20, targetTemplateCurveScore); - backing.putInt(24, correlationScore); - backing.putDouble(32, minMatchSeparationDistance); - backing.putDouble(40, minMatchSeparationAngle); - backing.putDouble(48, minMatchSeparationScale); - backing.putDouble(56, maxMatchOverlap); - backing.putInt(64, coarseResult); - backing.putInt(68, enableCalibrationSupport); - if (enableContrastReversal != null) - backing.putInt(72, enableContrastReversal.getValue()); - if (matchStrategy != null) - backing.putInt(76, matchStrategy.getValue()); - backing.putInt(80, refineMatchFactor); - backing.putInt(84, subpixelMatchFactor); - } - - public int size() { - return 88; - } - } - - public static class ColorOptions extends DisposedStruct { - public ColorClassificationResolution colorClassificationResolution; // Specifies - // the - // color - // resolution - // of - // the - // classifier. - public int useLuminance; // Specifies if the luminance band is going to be - // used in the feature vector. - public ColorMode colorMode; // Specifies the color mode of the classifier. - - private void init() { - - } - - public ColorOptions() { - super(12); - init(); - } - - public ColorOptions(ColorClassificationResolution colorClassificationResolution, - int useLuminance, ColorMode colorMode) { - super(12); - this.colorClassificationResolution = colorClassificationResolution; - this.useLuminance = useLuminance; - this.colorMode = colorMode; - } - - protected ColorOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ColorOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - colorClassificationResolution = ColorClassificationResolution.fromValue(backing.getInt(0)); - useLuminance = backing.getInt(4); - colorMode = ColorMode.fromValue(backing.getInt(8)); - } - - public void write() { - if (colorClassificationResolution != null) - backing.putInt(0, colorClassificationResolution.getValue()); - backing.putInt(4, useLuminance); - if (colorMode != null) - backing.putInt(8, colorMode.getValue()); - } - - public int size() { - return 12; - } - } - - public static class SampleScore extends DisposedStruct { - public String className; // The name of the class. - public float distance; // The distance from the item to this class. - public int index; // index of this sample. - private ByteBuffer className_buf; - - private void init() { - - } - - public SampleScore() { - super(12); - init(); - } - - public SampleScore(String className, double distance, int index) { - super(12); - this.className = className; - this.distance = (float) distance; - this.index = index; - } - - protected SampleScore(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected SampleScore(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - long className_addr = getPointer(backing, 0); - if (className_addr == 0) - className = null; - else { - ByteBuffer bb = newDirectByteBuffer(className_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - className = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - className = ""; - } - } - - distance = backing.getFloat(4); - index = backing.getInt(8); - } - - public void write() { - if (className != null) { - byte[] className_bytes; - try { - className_bytes = className.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - className_bytes = new byte[0]; - } - className_buf = ByteBuffer.allocateDirect(className_bytes.length + 1); - putBytes(className_buf, className_bytes, 0, className_bytes.length).put( - className_bytes.length, (byte) 0); - } - putPointer(backing, 0, className == null ? 0 : getByteBufferAddress(className_buf)); - backing.putFloat(4, distance); - backing.putInt(8, index); - } - - public int size() { - return 12; - } - } - - public static class ClassifierReportAdvanced extends DisposedStruct { - public String bestClassName; // The name of the best class for the sample. - public float classificationScore; // The similarity of the sample and the - // two closest classes in the classifier. - public float identificationScore; // The similarity of the sample and the - // assigned class. - public ClassScore[] allScores; // All classes and their scores. - public SampleScore[] sampleScores; // All samples and their scores. - private ByteBuffer bestClassName_buf; - private ByteBuffer allScores_buf; - private ByteBuffer sampleScores_buf; - - private void init() { - allScores = new ClassScore[0]; - sampleScores = new SampleScore[0]; - } - - public ClassifierReportAdvanced() { - super(28); - init(); - } - - public ClassifierReportAdvanced(String bestClassName, double classificationScore, - double identificationScore, ClassScore[] allScores, SampleScore[] sampleScores) { - super(28); - this.bestClassName = bestClassName; - this.classificationScore = (float) classificationScore; - this.identificationScore = (float) identificationScore; - this.allScores = allScores; - this.sampleScores = sampleScores; - } - - protected ClassifierReportAdvanced(ByteBuffer backing, int offset) { - super(backing, offset, 28); - init(); - } - - protected ClassifierReportAdvanced(long nativeObj, boolean owned) { - super(nativeObj, owned, 28); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 28); - } - - public void read() { - long bestClassName_addr = getPointer(backing, 0); - if (bestClassName_addr == 0) - bestClassName = null; - else { - ByteBuffer bb = newDirectByteBuffer(bestClassName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - bestClassName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - bestClassName = ""; - } - } - - classificationScore = backing.getFloat(4); - identificationScore = backing.getFloat(8); - int allScores_allScoresSize = backing.getInt(16); - long allScores_addr = getPointer(backing, 12); - allScores = new ClassScore[allScores_allScoresSize]; - if (allScores_allScoresSize > 0 && allScores_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allScores_addr, allScores_allScoresSize * 8); - for (int i = 0, off = 0; i < allScores_allScoresSize; i++, off += 8) { - allScores[i] = new ClassScore(bb, off); - allScores[i].read(); - } - } - int sampleScores_sampleScoresSize = backing.getInt(24); - long sampleScores_addr = getPointer(backing, 20); - sampleScores = new SampleScore[sampleScores_sampleScoresSize]; - if (sampleScores_sampleScoresSize > 0 && sampleScores_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(sampleScores_addr, sampleScores_sampleScoresSize * 12); - for (int i = 0, off = 0; i < sampleScores_sampleScoresSize; i++, off += 12) { - sampleScores[i] = new SampleScore(bb, off); - sampleScores[i].read(); - } - } - } - - public void write() { - if (bestClassName != null) { - byte[] bestClassName_bytes; - try { - bestClassName_bytes = bestClassName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bestClassName_bytes = new byte[0]; - } - bestClassName_buf = ByteBuffer.allocateDirect(bestClassName_bytes.length + 1); - putBytes(bestClassName_buf, bestClassName_bytes, 0, bestClassName_bytes.length).put( - bestClassName_bytes.length, (byte) 0); - } - putPointer(backing, 0, bestClassName == null ? 0 : getByteBufferAddress(bestClassName_buf)); - backing.putFloat(4, classificationScore); - backing.putFloat(8, identificationScore); - allScores_buf = - ByteBuffer.allocateDirect(allScores.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allScores.length; i++, off += 8) { - allScores[i].setBuffer(allScores_buf, off); - allScores[i].write(); - } - backing.putInt(16, allScores.length); - putPointer(backing, 12, allScores_buf); - sampleScores_buf = - ByteBuffer.allocateDirect(sampleScores.length * 12).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < sampleScores.length; i++, off += 12) { - sampleScores[i].setBuffer(sampleScores_buf, off); - sampleScores[i].write(); - } - backing.putInt(24, sampleScores.length); - putPointer(backing, 20, sampleScores_buf); - } - - public int size() { - return 28; - } - } - - public static class LearnGeometricPatternAdvancedOptions2 extends DisposedStruct { - public double minScaleFactor; // Specifies the minimum scale factor that the - // template is learned for. - public double maxScaleFactor; // Specifies the maximum scale factor the - // template is learned for. - public double minRotationAngleValue; // Specifies the minimum rotation angle - // the template is learned for. - public double maxRotationAngleValue; // Specifies the maximum rotation angle - // the template is learned for. - public int imageSamplingFactor; // Specifies the factor that is used to - // subsample the template and the image for - // the initial matching phase. - - private void init() { - - } - - public LearnGeometricPatternAdvancedOptions2() { - super(40); - init(); - } - - public LearnGeometricPatternAdvancedOptions2(double minScaleFactor, double maxScaleFactor, - double minRotationAngleValue, double maxRotationAngleValue, int imageSamplingFactor) { - super(40); - this.minScaleFactor = minScaleFactor; - this.maxScaleFactor = maxScaleFactor; - this.minRotationAngleValue = minRotationAngleValue; - this.maxRotationAngleValue = maxRotationAngleValue; - this.imageSamplingFactor = imageSamplingFactor; - } - - protected LearnGeometricPatternAdvancedOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected LearnGeometricPatternAdvancedOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - minScaleFactor = backing.getDouble(0); - maxScaleFactor = backing.getDouble(8); - minRotationAngleValue = backing.getDouble(16); - maxRotationAngleValue = backing.getDouble(24); - imageSamplingFactor = backing.getInt(32); - } - - public void write() { - backing.putDouble(0, minScaleFactor); - backing.putDouble(8, maxScaleFactor); - backing.putDouble(16, minRotationAngleValue); - backing.putDouble(24, maxRotationAngleValue); - backing.putInt(32, imageSamplingFactor); - } - - public int size() { - return 40; - } - } - - public static class ParticleFilterOptions2 extends DisposedStruct { - public int rejectMatches; // Set this parameter to TRUE to transfer only - // those particles that do not meet all the - // criteria. - public int rejectBorder; // Set this element to TRUE to reject border - // particles. - public int fillHoles; // Set this element to TRUE to fill holes in - // particles. - public int connectivity8; // Set this parameter to TRUE to use - // connectivity-8 to determine whether particles - // are touching. - - private void init() { - - } - - public ParticleFilterOptions2() { - super(16); - init(); - } - - public ParticleFilterOptions2(int rejectMatches, int rejectBorder, int fillHoles, - int connectivity8) { - super(16); - this.rejectMatches = rejectMatches; - this.rejectBorder = rejectBorder; - this.fillHoles = fillHoles; - this.connectivity8 = connectivity8; - } - - protected ParticleFilterOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ParticleFilterOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - rejectMatches = backing.getInt(0); - rejectBorder = backing.getInt(4); - fillHoles = backing.getInt(8); - connectivity8 = backing.getInt(12); - } - - public void write() { - backing.putInt(0, rejectMatches); - backing.putInt(4, rejectBorder); - backing.putInt(8, fillHoles); - backing.putInt(12, connectivity8); - } - - public int size() { - return 16; - } - } - - public static class FindEdgeOptions2 extends DisposedStruct { - public RakeDirection direction; // The direction to search in the ROI. - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showSearchLines; // If TRUE, the function overlays the search - // lines used to locate the edges on the image. - public int showEdgesFound; // If TRUE, the function overlays the locations - // of the edges found on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue searchLinesColor; // Specifies the RGB color value to use to - // overlay the search lines. - public RGBValue searchEdgesColor; // Specifies the RGB color value to use to - // overlay the search edges. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the overlay group name to - // assign to the overlays. - public EdgeOptions2 edgeOptions; // Specifies the edge detection options - // along a single search line. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 20); - searchLinesColor = new RGBValue(backing, 24); - searchEdgesColor = new RGBValue(backing, 28); - resultColor = new RGBValue(backing, 32); - edgeOptions = new EdgeOptions2(backing, 40); - } - - public FindEdgeOptions2() { - super(64); - init(); - } - - public FindEdgeOptions2(RakeDirection direction, int showSearchArea, int showSearchLines, - int showEdgesFound, int showResult, RGBValue searchAreaColor, RGBValue searchLinesColor, - RGBValue searchEdgesColor, RGBValue resultColor, String overlayGroupName, - EdgeOptions2 edgeOptions) { - super(64); - this.direction = direction; - this.showSearchArea = showSearchArea; - this.showSearchLines = showSearchLines; - this.showEdgesFound = showEdgesFound; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.searchLinesColor = searchLinesColor; - this.searchEdgesColor = searchEdgesColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - this.edgeOptions = edgeOptions; - } - - protected FindEdgeOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected FindEdgeOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - direction = RakeDirection.fromValue(backing.getInt(0)); - showSearchArea = backing.getInt(4); - showSearchLines = backing.getInt(8); - showEdgesFound = backing.getInt(12); - showResult = backing.getInt(16); - searchAreaColor.read(); - searchLinesColor.read(); - searchEdgesColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 36); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - edgeOptions.read(); - } - - public void write() { - if (direction != null) - backing.putInt(0, direction.getValue()); - backing.putInt(4, showSearchArea); - backing.putInt(8, showSearchLines); - backing.putInt(12, showEdgesFound); - backing.putInt(16, showResult); - searchAreaColor.write(); - searchLinesColor.write(); - searchEdgesColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 36, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - edgeOptions.write(); - } - - public int size() { - return 64; - } - } - - public static class FindEdgeReport extends DisposedStruct { - public StraightEdge[] straightEdges; // An array of straight edges detected. - private ByteBuffer straightEdges_buf; - - private void init() { - straightEdges = new StraightEdge[0]; - } - - public FindEdgeReport() { - super(8); - init(); - } - - public FindEdgeReport(StraightEdge[] straightEdges) { - super(8); - this.straightEdges = straightEdges; - } - - protected FindEdgeReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected FindEdgeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int straightEdges_numStraightEdges = backing.getInt(4); - long straightEdges_addr = getPointer(backing, 0); - straightEdges = new StraightEdge[straightEdges_numStraightEdges]; - if (straightEdges_numStraightEdges > 0 && straightEdges_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(straightEdges_addr, straightEdges_numStraightEdges * 88); - for (int i = 0, off = 0; i < straightEdges_numStraightEdges; i++, off += 88) { - straightEdges[i] = new StraightEdge(bb, off); - straightEdges[i].read(); - } - } - } - - public void write() { - straightEdges_buf = - ByteBuffer.allocateDirect(straightEdges.length * 88).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < straightEdges.length; i++, off += 88) { - straightEdges[i].setBuffer(straightEdges_buf, off); - straightEdges[i].write(); - } - backing.putInt(4, straightEdges.length); - putPointer(backing, 0, straightEdges_buf); - } - - public int size() { - return 8; - } - } - - public static class FindTransformRectOptions2 extends DisposedStruct { - public FindReferenceDirection direction; // Specifies the direction and - // orientation in which the - // function searches for the - // primary axis. - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showSearchLines; // If TRUE, the function overlays the search - // lines used to locate the edges on the image. - public int showEdgesFound; // If TRUE, the function overlays the locations - // of the edges found on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue searchLinesColor; // Specifies the RGB color value to use to - // overlay the search lines. - public RGBValue searchEdgesColor; // Specifies the RGB color value to use to - // overlay the search edges. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the overlay group name to - // assign to the overlays. - public EdgeOptions2 edgeOptions; // Specifies the edge detection options - // along a single search line. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 20); - searchLinesColor = new RGBValue(backing, 24); - searchEdgesColor = new RGBValue(backing, 28); - resultColor = new RGBValue(backing, 32); - edgeOptions = new EdgeOptions2(backing, 40); - } - - public FindTransformRectOptions2() { - super(64); - init(); - } - - public FindTransformRectOptions2(FindReferenceDirection direction, int showSearchArea, - int showSearchLines, int showEdgesFound, int showResult, RGBValue searchAreaColor, - RGBValue searchLinesColor, RGBValue searchEdgesColor, RGBValue resultColor, - String overlayGroupName, EdgeOptions2 edgeOptions) { - super(64); - this.direction = direction; - this.showSearchArea = showSearchArea; - this.showSearchLines = showSearchLines; - this.showEdgesFound = showEdgesFound; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.searchLinesColor = searchLinesColor; - this.searchEdgesColor = searchEdgesColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - this.edgeOptions = edgeOptions; - } - - protected FindTransformRectOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected FindTransformRectOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - direction = FindReferenceDirection.fromValue(backing.getInt(0)); - showSearchArea = backing.getInt(4); - showSearchLines = backing.getInt(8); - showEdgesFound = backing.getInt(12); - showResult = backing.getInt(16); - searchAreaColor.read(); - searchLinesColor.read(); - searchEdgesColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 36); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - edgeOptions.read(); - } - - public void write() { - if (direction != null) - backing.putInt(0, direction.getValue()); - backing.putInt(4, showSearchArea); - backing.putInt(8, showSearchLines); - backing.putInt(12, showEdgesFound); - backing.putInt(16, showResult); - searchAreaColor.write(); - searchLinesColor.write(); - searchEdgesColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 36, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - edgeOptions.write(); - } - - public int size() { - return 64; - } - } - - public static class FindTransformRectsOptions2 extends DisposedStruct { - public FindReferenceDirection direction; // Specifies the direction and - // orientation in which the - // function searches for the - // primary axis. - public int showSearchArea; // If TRUE, the function overlays the search area - // on the image. - public int showSearchLines; // If TRUE, the function overlays the search - // lines used to locate the edges on the image. - public int showEdgesFound; // If TRUE, the function overlays the locations - // of the edges found on the image. - public int showResult; // If TRUE, the function overlays the hit lines to - // the object and the edge used to generate the hit - // line on the result image. - public RGBValue searchAreaColor; // Specifies the RGB color value to use to - // overlay the search area. - public RGBValue searchLinesColor; // Specifies the RGB color value to use to - // overlay the search lines. - public RGBValue searchEdgesColor; // Specifies the RGB color value to use to - // overlay the search edges. - public RGBValue resultColor; // Specifies the RGB color value to use to - // overlay the results. - public String overlayGroupName; // Specifies the overlay group name to - // assign to the overlays. - public EdgeOptions2 primaryEdgeOptions; // Specifies the parameters used to - // compute the edge gradient - // information and detect the edges - // for the primary ROI. - public EdgeOptions2 secondaryEdgeOptions; // Specifies the parameters used - // to compute the edge gradient - // information and detect the - // edges for the secondary ROI. - private ByteBuffer overlayGroupName_buf; - - private void init() { - searchAreaColor = new RGBValue(backing, 20); - searchLinesColor = new RGBValue(backing, 24); - searchEdgesColor = new RGBValue(backing, 28); - resultColor = new RGBValue(backing, 32); - primaryEdgeOptions = new EdgeOptions2(backing, 40); - secondaryEdgeOptions = new EdgeOptions2(backing, 64); - } - - public FindTransformRectsOptions2() { - super(88); - init(); - } - - public FindTransformRectsOptions2(FindReferenceDirection direction, int showSearchArea, - int showSearchLines, int showEdgesFound, int showResult, RGBValue searchAreaColor, - RGBValue searchLinesColor, RGBValue searchEdgesColor, RGBValue resultColor, - String overlayGroupName, EdgeOptions2 primaryEdgeOptions, EdgeOptions2 secondaryEdgeOptions) { - super(88); - this.direction = direction; - this.showSearchArea = showSearchArea; - this.showSearchLines = showSearchLines; - this.showEdgesFound = showEdgesFound; - this.showResult = showResult; - this.searchAreaColor = searchAreaColor; - this.searchLinesColor = searchLinesColor; - this.searchEdgesColor = searchEdgesColor; - this.resultColor = resultColor; - this.overlayGroupName = overlayGroupName; - this.primaryEdgeOptions = primaryEdgeOptions; - this.secondaryEdgeOptions = secondaryEdgeOptions; - } - - protected FindTransformRectsOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 88); - init(); - } - - protected FindTransformRectsOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 88); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 88); - } - - public void read() { - direction = FindReferenceDirection.fromValue(backing.getInt(0)); - showSearchArea = backing.getInt(4); - showSearchLines = backing.getInt(8); - showEdgesFound = backing.getInt(12); - showResult = backing.getInt(16); - searchAreaColor.read(); - searchLinesColor.read(); - searchEdgesColor.read(); - resultColor.read(); - long overlayGroupName_addr = getPointer(backing, 36); - if (overlayGroupName_addr == 0) - overlayGroupName = null; - else { - ByteBuffer bb = newDirectByteBuffer(overlayGroupName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - overlayGroupName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName = ""; - } - } - - primaryEdgeOptions.read(); - secondaryEdgeOptions.read(); - } - - public void write() { - if (direction != null) - backing.putInt(0, direction.getValue()); - backing.putInt(4, showSearchArea); - backing.putInt(8, showSearchLines); - backing.putInt(12, showEdgesFound); - backing.putInt(16, showResult); - searchAreaColor.write(); - searchLinesColor.write(); - searchEdgesColor.write(); - resultColor.write(); - if (overlayGroupName != null) { - byte[] overlayGroupName_bytes; - try { - overlayGroupName_bytes = overlayGroupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - overlayGroupName_bytes = new byte[0]; - } - overlayGroupName_buf = ByteBuffer.allocateDirect(overlayGroupName_bytes.length + 1); - putBytes(overlayGroupName_buf, overlayGroupName_bytes, 0, overlayGroupName_bytes.length) - .put(overlayGroupName_bytes.length, (byte) 0); - } - putPointer(backing, 36, overlayGroupName == null ? 0 - : getByteBufferAddress(overlayGroupName_buf)); - primaryEdgeOptions.write(); - secondaryEdgeOptions.write(); - } - - public int size() { - return 88; - } - } - - public static class ReadTextReport3 extends DisposedStruct { - public String readString; // The read string. - public CharReport3[] characterReport; // An array of reports describing the - // properties of each identified - // character. - public ROI roiBoundingCharacters; // An array specifying the coordinates of - // the character bounding ROI. - private ByteBuffer readString_buf; - private ByteBuffer characterReport_buf; - - private void init() { - characterReport = new CharReport3[0]; - } - - public ReadTextReport3() { - super(16); - init(); - } - - public ReadTextReport3(String readString, CharReport3[] characterReport, - ROI roiBoundingCharacters) { - super(16); - this.readString = readString; - this.characterReport = characterReport; - this.roiBoundingCharacters = roiBoundingCharacters; - } - - protected ReadTextReport3(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ReadTextReport3(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - long readString_addr = getPointer(backing, 0); - if (readString_addr == 0) - readString = null; - else { - ByteBuffer bb = newDirectByteBuffer(readString_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - readString = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - readString = ""; - } - } - - int characterReport_numCharacterReports = backing.getInt(8); - long characterReport_addr = getPointer(backing, 4); - characterReport = new CharReport3[characterReport_numCharacterReports]; - if (characterReport_numCharacterReports > 0 && characterReport_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(characterReport_addr, characterReport_numCharacterReports * 44); - for (int i = 0, off = 0; i < characterReport_numCharacterReports; i++, off += 44) { - characterReport[i] = new CharReport3(bb, off); - characterReport[i].read(); - } - } - long roiBoundingCharacters_addr = getPointer(backing, 12); - if (roiBoundingCharacters_addr == 0) - roiBoundingCharacters = null; - else - roiBoundingCharacters = new ROI(roiBoundingCharacters_addr, false); - } - - public void write() { - if (readString != null) { - byte[] readString_bytes; - try { - readString_bytes = readString.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - readString_bytes = new byte[0]; - } - readString_buf = ByteBuffer.allocateDirect(readString_bytes.length + 1); - putBytes(readString_buf, readString_bytes, 0, readString_bytes.length).put( - readString_bytes.length, (byte) 0); - } - putPointer(backing, 0, readString == null ? 0 : getByteBufferAddress(readString_buf)); - characterReport_buf = - ByteBuffer.allocateDirect(characterReport.length * 44).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < characterReport.length; i++, off += 44) { - characterReport[i].setBuffer(characterReport_buf, off); - characterReport[i].write(); - } - backing.putInt(8, characterReport.length); - putPointer(backing, 4, characterReport_buf); - putPointer(backing, 12, roiBoundingCharacters); - } - - public int size() { - return 16; - } - } - - public static class CharacterStatistics extends DisposedStruct { - public int left; // The left offset of the character bounding rectangles in - // the current ROI. - public int top; // The top offset of the character bounding rectangles in - // the current ROI. - public int width; // The width of each of the characters you trained in the - // current ROI. - public int height; // The height of each trained character in the current - // ROI. - public int characterSize; // The size of the character in pixels. - - private void init() { - - } - - public CharacterStatistics() { - super(20); - init(); - } - - public CharacterStatistics(int left, int top, int width, int height, int characterSize) { - super(20); - this.left = left; - this.top = top; - this.width = width; - this.height = height; - this.characterSize = characterSize; - } - - protected CharacterStatistics(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected CharacterStatistics(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - left = backing.getInt(0); - top = backing.getInt(4); - width = backing.getInt(8); - height = backing.getInt(12); - characterSize = backing.getInt(16); - } - - public void write() { - backing.putInt(0, left); - backing.putInt(4, top); - backing.putInt(8, width); - backing.putInt(12, height); - backing.putInt(16, characterSize); - } - - public int size() { - return 20; - } - } - - public static class CharReport3 extends DisposedStruct { - public String character; // The character value. - public int classificationScore; // The degree to which the assigned - // character class represents the object - // better than the other character classes - // in the character set. - public int verificationScore; // The similarity of the character and the - // reference character for the character - // class. - public int verified; // This element is TRUE if a reference character was - // found for the character class and FALSE if a - // reference character was not found. - public int lowThreshold; // The minimum value of the threshold range used - // for this character. - public int highThreshold; // The maximum value of the threshold range used - // for this character. - public CharacterStatistics characterStats; // Describes the characters - // segmented in the ROI. - private ByteBuffer character_buf; - - private void init() { - characterStats = new CharacterStatistics(backing, 24); - } - - public CharReport3() { - super(44); - init(); - } - - public CharReport3(String character, int classificationScore, int verificationScore, - int verified, int lowThreshold, int highThreshold, CharacterStatistics characterStats) { - super(44); - this.character = character; - this.classificationScore = classificationScore; - this.verificationScore = verificationScore; - this.verified = verified; - this.lowThreshold = lowThreshold; - this.highThreshold = highThreshold; - this.characterStats = characterStats; - } - - protected CharReport3(ByteBuffer backing, int offset) { - super(backing, offset, 44); - init(); - } - - protected CharReport3(long nativeObj, boolean owned) { - super(nativeObj, owned, 44); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 44); - } - - public void read() { - long character_addr = getPointer(backing, 0); - if (character_addr == 0) - character = null; - else { - ByteBuffer bb = newDirectByteBuffer(character_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - character = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - character = ""; - } - } - - classificationScore = backing.getInt(4); - verificationScore = backing.getInt(8); - verified = backing.getInt(12); - lowThreshold = backing.getInt(16); - highThreshold = backing.getInt(20); - characterStats.read(); - } - - public void write() { - if (character != null) { - byte[] character_bytes; - try { - character_bytes = character.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - character_bytes = new byte[0]; - } - character_buf = ByteBuffer.allocateDirect(character_bytes.length + 1); - putBytes(character_buf, character_bytes, 0, character_bytes.length).put( - character_bytes.length, (byte) 0); - } - putPointer(backing, 0, character == null ? 0 : getByteBufferAddress(character_buf)); - backing.putInt(4, classificationScore); - backing.putInt(8, verificationScore); - backing.putInt(12, verified); - backing.putInt(16, lowThreshold); - backing.putInt(20, highThreshold); - characterStats.write(); - } - - public int size() { - return 44; - } - } - - public static class ArcInfo2 extends DisposedStruct { - public PointFloat center; // The center point of the arc. - public double radius; // The radius of the arc. - public double startAngle; // The starting angle of the arc, specified - // counter-clockwise from the x-axis. - public double endAngle; // The ending angle of the arc, specified - // counter-clockwise from the x-axis. - - private void init() { - center = new PointFloat(backing, 0); - } - - public ArcInfo2() { - super(32); - init(); - } - - public ArcInfo2(PointFloat center, double radius, double startAngle, double endAngle) { - super(32); - this.center = center; - this.radius = radius; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected ArcInfo2(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ArcInfo2(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - center.read(); - radius = backing.getDouble(8); - startAngle = backing.getDouble(16); - endAngle = backing.getDouble(24); - } - - public void write() { - center.write(); - backing.putDouble(8, radius); - backing.putDouble(16, startAngle); - backing.putDouble(24, endAngle); - } - - public int size() { - return 32; - } - } - - public static class EdgeReport2 extends DisposedStruct { - public EdgeInfo[] edges; // An array of edges detected. - public double[] gradientInfo; // An array that contains the calculated edge - // strengths along the user-defined search - // area. - public int calibrationValid; // Indicates if the calibration data - // corresponding to the location of the edges - // is correct. - private ByteBuffer edges_buf; - private ByteBuffer gradientInfo_buf; - - private void init() { - edges = new EdgeInfo[0]; - gradientInfo = new double[0]; - } - - public EdgeReport2() { - super(20); - init(); - } - - public EdgeReport2(EdgeInfo[] edges, double[] gradientInfo, int calibrationValid) { - super(20); - this.edges = edges; - this.gradientInfo = gradientInfo; - this.calibrationValid = calibrationValid; - } - - protected EdgeReport2(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected EdgeReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - int edges_numEdges = backing.getInt(4); - long edges_addr = getPointer(backing, 0); - edges = new EdgeInfo[edges_numEdges]; - if (edges_numEdges > 0 && edges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(edges_addr, edges_numEdges * 56); - for (int i = 0, off = 0; i < edges_numEdges; i++, off += 56) { - edges[i] = new EdgeInfo(bb, off); - edges[i].read(); - } - } - int gradientInfo_numGradientInfo = backing.getInt(12); - long gradientInfo_addr = getPointer(backing, 8); - gradientInfo = new double[gradientInfo_numGradientInfo]; - if (gradientInfo_numGradientInfo > 0 && gradientInfo_addr != 0) { - newDirectByteBuffer(gradientInfo_addr, gradientInfo_numGradientInfo * 8).asDoubleBuffer() - .get(gradientInfo); - } - calibrationValid = backing.getInt(16); - } - - public void write() { - edges_buf = ByteBuffer.allocateDirect(edges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < edges.length; i++, off += 56) { - edges[i].setBuffer(edges_buf, off); - edges[i].write(); - } - backing.putInt(4, edges.length); - putPointer(backing, 0, edges_buf); - gradientInfo_buf = - ByteBuffer.allocateDirect(gradientInfo.length * 8).order(ByteOrder.nativeOrder()); - gradientInfo_buf.asDoubleBuffer().put(gradientInfo).rewind(); - backing.putInt(12, gradientInfo.length); - putPointer(backing, 8, gradientInfo_buf); - backing.putInt(16, calibrationValid); - } - - public int size() { - return 20; - } - } - - public static class SearchArcInfo extends DisposedStruct { - public ArcInfo2 arcCoordinates; // Describes the arc used for edge - // detection. - public EdgeReport2 edgeReport; // Describes the edges found in this search - // line. - - private void init() { - arcCoordinates = new ArcInfo2(backing, 0); - edgeReport = new EdgeReport2(backing, 32); - } - - public SearchArcInfo() { - super(56); - init(); - } - - public SearchArcInfo(ArcInfo2 arcCoordinates, EdgeReport2 edgeReport) { - super(56); - this.arcCoordinates = arcCoordinates; - this.edgeReport = edgeReport; - } - - protected SearchArcInfo(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected SearchArcInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - arcCoordinates.read(); - edgeReport.read(); - } - - public void write() { - arcCoordinates.write(); - edgeReport.write(); - } - - public int size() { - return 56; - } - } - - public static class ConcentricRakeReport2 extends DisposedStruct { - public EdgeInfo[] firstEdges; // The first edge point detected along each - // search line in the ROI. - public EdgeInfo[] lastEdges; // The last edge point detected along each - // search line in the ROI. - public SearchArcInfo[] searchArcs; // Contains the arcs used for edge - // detection and the edge information for - // each arc. - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer searchArcs_buf; - - private void init() { - firstEdges = new EdgeInfo[0]; - lastEdges = new EdgeInfo[0]; - searchArcs = new SearchArcInfo[0]; - } - - public ConcentricRakeReport2() { - super(24); - init(); - } - - public ConcentricRakeReport2(EdgeInfo[] firstEdges, EdgeInfo[] lastEdges, - SearchArcInfo[] searchArcs) { - super(24); - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.searchArcs = searchArcs; - } - - protected ConcentricRakeReport2(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ConcentricRakeReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - int firstEdges_numFirstEdges = backing.getInt(4); - long firstEdges_addr = getPointer(backing, 0); - firstEdges = new EdgeInfo[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 56); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 56) { - firstEdges[i] = new EdgeInfo(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(12); - long lastEdges_addr = getPointer(backing, 8); - lastEdges = new EdgeInfo[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 56); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 56) { - lastEdges[i] = new EdgeInfo(bb, off); - lastEdges[i].read(); - } - } - int searchArcs_numSearchArcs = backing.getInt(20); - long searchArcs_addr = getPointer(backing, 16); - searchArcs = new SearchArcInfo[searchArcs_numSearchArcs]; - if (searchArcs_numSearchArcs > 0 && searchArcs_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(searchArcs_addr, searchArcs_numSearchArcs * 56); - for (int i = 0, off = 0; i < searchArcs_numSearchArcs; i++, off += 56) { - searchArcs[i] = new SearchArcInfo(bb, off); - searchArcs[i].read(); - } - } - } - - public void write() { - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 56) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(4, firstEdges.length); - putPointer(backing, 0, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 56) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(12, lastEdges.length); - putPointer(backing, 8, lastEdges_buf); - searchArcs_buf = - ByteBuffer.allocateDirect(searchArcs.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < searchArcs.length; i++, off += 56) { - searchArcs[i].setBuffer(searchArcs_buf, off); - searchArcs[i].write(); - } - backing.putInt(20, searchArcs.length); - putPointer(backing, 16, searchArcs_buf); - } - - public int size() { - return 24; - } - } - - public static class SpokeReport2 extends DisposedStruct { - public EdgeInfo[] firstEdges; // The first edge point detected along each - // search line in the ROI. - public EdgeInfo[] lastEdges; // The last edge point detected along each - // search line in the ROI. - public SearchLineInfo[] searchLines; // The search lines used for edge - // detection. - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer searchLines_buf; - - private void init() { - firstEdges = new EdgeInfo[0]; - lastEdges = new EdgeInfo[0]; - searchLines = new SearchLineInfo[0]; - } - - public SpokeReport2() { - super(24); - init(); - } - - public SpokeReport2(EdgeInfo[] firstEdges, EdgeInfo[] lastEdges, SearchLineInfo[] searchLines) { - super(24); - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.searchLines = searchLines; - } - - protected SpokeReport2(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected SpokeReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - int firstEdges_numFirstEdges = backing.getInt(4); - long firstEdges_addr = getPointer(backing, 0); - firstEdges = new EdgeInfo[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 56); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 56) { - firstEdges[i] = new EdgeInfo(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(12); - long lastEdges_addr = getPointer(backing, 8); - lastEdges = new EdgeInfo[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 56); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 56) { - lastEdges[i] = new EdgeInfo(bb, off); - lastEdges[i].read(); - } - } - int searchLines_numSearchLines = backing.getInt(20); - long searchLines_addr = getPointer(backing, 16); - searchLines = new SearchLineInfo[searchLines_numSearchLines]; - if (searchLines_numSearchLines > 0 && searchLines_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines * 36); - for (int i = 0, off = 0; i < searchLines_numSearchLines; i++, off += 36) { - searchLines[i] = new SearchLineInfo(bb, off); - searchLines[i].read(); - } - } - } - - public void write() { - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 56) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(4, firstEdges.length); - putPointer(backing, 0, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 56) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(12, lastEdges.length); - putPointer(backing, 8, lastEdges_buf); - searchLines_buf = - ByteBuffer.allocateDirect(searchLines.length * 36).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < searchLines.length; i++, off += 36) { - searchLines[i].setBuffer(searchLines_buf, off); - searchLines[i].write(); - } - backing.putInt(20, searchLines.length); - putPointer(backing, 16, searchLines_buf); - } - - public int size() { - return 24; - } - } - - public static class EdgeInfo extends DisposedStruct { - public PointFloat position; // The location of the edge in the image. - public PointFloat calibratedPosition; // The position of the edge in the - // image in real-world coordinates. - public double distance; // The location of the edge from the first point - // along the boundary of the input ROI. - public double calibratedDistance; // The location of the edge from the first - // point along the boundary of the input - // ROI in real-world coordinates. - public double magnitude; // The intensity contrast at the edge. - public double noisePeak; // The strength of the noise associated with the - // current edge. - public int rising; // Indicates the polarity of the edge. - - private void init() { - position = new PointFloat(backing, 0); - calibratedPosition = new PointFloat(backing, 8); - } - - public EdgeInfo() { - super(56); - init(); - } - - public EdgeInfo(PointFloat position, PointFloat calibratedPosition, double distance, - double calibratedDistance, double magnitude, double noisePeak, int rising) { - super(56); - this.position = position; - this.calibratedPosition = calibratedPosition; - this.distance = distance; - this.calibratedDistance = calibratedDistance; - this.magnitude = magnitude; - this.noisePeak = noisePeak; - this.rising = rising; - } - - protected EdgeInfo(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected EdgeInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - position.read(); - calibratedPosition.read(); - distance = backing.getDouble(16); - calibratedDistance = backing.getDouble(24); - magnitude = backing.getDouble(32); - noisePeak = backing.getDouble(40); - rising = backing.getInt(48); - } - - public void write() { - position.write(); - calibratedPosition.write(); - backing.putDouble(16, distance); - backing.putDouble(24, calibratedDistance); - backing.putDouble(32, magnitude); - backing.putDouble(40, noisePeak); - backing.putInt(48, rising); - } - - public int size() { - return 56; - } - } - - public static class SearchLineInfo extends DisposedStruct { - public LineFloat lineCoordinates; // The endpoints of the search line. - public EdgeReport2 edgeReport; // Describes the edges found in this search - // line. - - private void init() { - lineCoordinates = new LineFloat(backing, 0); - edgeReport = new EdgeReport2(backing, 16); - } - - public SearchLineInfo() { - super(36); - init(); - } - - public SearchLineInfo(LineFloat lineCoordinates, EdgeReport2 edgeReport) { - super(36); - this.lineCoordinates = lineCoordinates; - this.edgeReport = edgeReport; - } - - protected SearchLineInfo(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected SearchLineInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - lineCoordinates.read(); - edgeReport.read(); - } - - public void write() { - lineCoordinates.write(); - edgeReport.write(); - } - - public int size() { - return 36; - } - } - - public static class RakeReport2 extends DisposedStruct { - public EdgeInfo[] firstEdges; // The first edge point detected along each - // search line in the ROI. - public EdgeInfo[] lastEdges; // The last edge point detected along each - // search line in the ROI. - public SearchLineInfo[] searchLines; // The search lines used for edge - // detection. - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer searchLines_buf; - - private void init() { - firstEdges = new EdgeInfo[0]; - lastEdges = new EdgeInfo[0]; - searchLines = new SearchLineInfo[0]; - } - - public RakeReport2() { - super(24); - init(); - } - - public RakeReport2(EdgeInfo[] firstEdges, EdgeInfo[] lastEdges, SearchLineInfo[] searchLines) { - super(24); - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.searchLines = searchLines; - } - - protected RakeReport2(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected RakeReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - int firstEdges_numFirstEdges = backing.getInt(4); - long firstEdges_addr = getPointer(backing, 0); - firstEdges = new EdgeInfo[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 56); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 56) { - firstEdges[i] = new EdgeInfo(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(12); - long lastEdges_addr = getPointer(backing, 8); - lastEdges = new EdgeInfo[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 56); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 56) { - lastEdges[i] = new EdgeInfo(bb, off); - lastEdges[i].read(); - } - } - int searchLines_numSearchLines = backing.getInt(20); - long searchLines_addr = getPointer(backing, 16); - searchLines = new SearchLineInfo[searchLines_numSearchLines]; - if (searchLines_numSearchLines > 0 && searchLines_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines * 36); - for (int i = 0, off = 0; i < searchLines_numSearchLines; i++, off += 36) { - searchLines[i] = new SearchLineInfo(bb, off); - searchLines[i].read(); - } - } - } - - public void write() { - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 56) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(4, firstEdges.length); - putPointer(backing, 0, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 56) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(12, lastEdges.length); - putPointer(backing, 8, lastEdges_buf); - searchLines_buf = - ByteBuffer.allocateDirect(searchLines.length * 36).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < searchLines.length; i++, off += 36) { - searchLines[i].setBuffer(searchLines_buf, off); - searchLines[i].write(); - } - backing.putInt(20, searchLines.length); - putPointer(backing, 16, searchLines_buf); - } - - public int size() { - return 24; - } - } - - public static class TransformBehaviors extends DisposedStruct { - public GroupBehavior ShiftBehavior; // Specifies the behavior of an overlay - // group when a shift operation is - // applied to an image. - public GroupBehavior ScaleBehavior; // Specifies the behavior of an overlay - // group when a scale operation is - // applied to an image. - public GroupBehavior RotateBehavior; // Specifies the behavior of an overlay - // group when a rotate operation is - // applied to an image. - public GroupBehavior SymmetryBehavior; // Specifies the behavior of an - // overlay group when a symmetry - // operation is applied to an image. - - private void init() { - - } - - public TransformBehaviors() { - super(16); - init(); - } - - public TransformBehaviors(GroupBehavior ShiftBehavior, GroupBehavior ScaleBehavior, - GroupBehavior RotateBehavior, GroupBehavior SymmetryBehavior) { - super(16); - this.ShiftBehavior = ShiftBehavior; - this.ScaleBehavior = ScaleBehavior; - this.RotateBehavior = RotateBehavior; - this.SymmetryBehavior = SymmetryBehavior; - } - - protected TransformBehaviors(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected TransformBehaviors(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - ShiftBehavior = GroupBehavior.fromValue(backing.getInt(0)); - ScaleBehavior = GroupBehavior.fromValue(backing.getInt(4)); - RotateBehavior = GroupBehavior.fromValue(backing.getInt(8)); - SymmetryBehavior = GroupBehavior.fromValue(backing.getInt(12)); - } - - public void write() { - if (ShiftBehavior != null) - backing.putInt(0, ShiftBehavior.getValue()); - if (ScaleBehavior != null) - backing.putInt(4, ScaleBehavior.getValue()); - if (RotateBehavior != null) - backing.putInt(8, RotateBehavior.getValue()); - if (SymmetryBehavior != null) - backing.putInt(12, SymmetryBehavior.getValue()); - } - - public int size() { - return 16; - } - } - - public static class QRCodeDataToken extends DisposedStruct { - public QRStreamMode mode; // Specifies the stream mode or the format of the - // data that is encoded in the QR code. - public int modeData; // Indicates specifiers used by the user to postprocess - // the data if it requires it. - public byte[] data; // Shows the encoded data in the QR code. - private ByteBuffer data_buf; - - private void init() { - data = new byte[0]; - } - - public QRCodeDataToken() { - super(16); - init(); - } - - public QRCodeDataToken(QRStreamMode mode, int modeData, byte[] data) { - super(16); - this.mode = mode; - this.modeData = modeData; - this.data = data; - } - - protected QRCodeDataToken(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected QRCodeDataToken(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - mode = QRStreamMode.fromValue(backing.getInt(0)); - modeData = backing.getInt(4); - int data_dataLength = backing.getInt(12); - long data_addr = getPointer(backing, 8); - data = new byte[data_dataLength]; - if (data_dataLength > 0 && data_addr != 0) { - getBytes(newDirectByteBuffer(data_addr, data_dataLength), data, 0, data_dataLength); - } - } - - public void write() { - if (mode != null) - backing.putInt(0, mode.getValue()); - backing.putInt(4, modeData); - data_buf = ByteBuffer.allocateDirect(data.length); - putBytes(data_buf, data, 0, data.length); - backing.putInt(12, data.length); - putPointer(backing, 8, data_buf); - } - - public int size() { - return 16; - } - } - - public static class ParticleFilterOptions extends DisposedStruct { - public int rejectMatches; // Set this parameter to TRUE to transfer only - // those particles that do not meet all the - // criteria. - public int rejectBorder; // Set this element to TRUE to reject border - // particles. - public int connectivity8; // Set this parameter to TRUE to use - // connectivity-8 to determine whether particles - // are touching. - - private void init() { - - } - - public ParticleFilterOptions() { - super(12); - init(); - } - - public ParticleFilterOptions(int rejectMatches, int rejectBorder, int connectivity8) { - super(12); - this.rejectMatches = rejectMatches; - this.rejectBorder = rejectBorder; - this.connectivity8 = connectivity8; - } - - protected ParticleFilterOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ParticleFilterOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - rejectMatches = backing.getInt(0); - rejectBorder = backing.getInt(4); - connectivity8 = backing.getInt(8); - } - - public void write() { - backing.putInt(0, rejectMatches); - backing.putInt(4, rejectBorder); - backing.putInt(8, connectivity8); - } - - public int size() { - return 12; - } - } - - public static class StraightEdgeReport2 extends DisposedStruct { - public StraightEdge[] straightEdges; // Contains an array of found straight - // edges. - public SearchLineInfo[] searchLines; // Contains an array of all search - // lines used in the detection. - private ByteBuffer straightEdges_buf; - private ByteBuffer searchLines_buf; - - private void init() { - straightEdges = new StraightEdge[0]; - searchLines = new SearchLineInfo[0]; - } - - public StraightEdgeReport2() { - super(16); - init(); - } - - public StraightEdgeReport2(StraightEdge[] straightEdges, SearchLineInfo[] searchLines) { - super(16); - this.straightEdges = straightEdges; - this.searchLines = searchLines; - } - - protected StraightEdgeReport2(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected StraightEdgeReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - int straightEdges_numStraightEdges = backing.getInt(4); - long straightEdges_addr = getPointer(backing, 0); - straightEdges = new StraightEdge[straightEdges_numStraightEdges]; - if (straightEdges_numStraightEdges > 0 && straightEdges_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(straightEdges_addr, straightEdges_numStraightEdges * 88); - for (int i = 0, off = 0; i < straightEdges_numStraightEdges; i++, off += 88) { - straightEdges[i] = new StraightEdge(bb, off); - straightEdges[i].read(); - } - } - int searchLines_numSearchLines = backing.getInt(12); - long searchLines_addr = getPointer(backing, 8); - searchLines = new SearchLineInfo[searchLines_numSearchLines]; - if (searchLines_numSearchLines > 0 && searchLines_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines * 36); - for (int i = 0, off = 0; i < searchLines_numSearchLines; i++, off += 36) { - searchLines[i] = new SearchLineInfo(bb, off); - searchLines[i].read(); - } - } - } - - public void write() { - straightEdges_buf = - ByteBuffer.allocateDirect(straightEdges.length * 88).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < straightEdges.length; i++, off += 88) { - straightEdges[i].setBuffer(straightEdges_buf, off); - straightEdges[i].write(); - } - backing.putInt(4, straightEdges.length); - putPointer(backing, 0, straightEdges_buf); - searchLines_buf = - ByteBuffer.allocateDirect(searchLines.length * 36).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < searchLines.length; i++, off += 36) { - searchLines[i].setBuffer(searchLines_buf, off); - searchLines[i].write(); - } - backing.putInt(12, searchLines.length); - putPointer(backing, 8, searchLines_buf); - } - - public int size() { - return 16; - } - } - - public static class StraightEdgeOptions extends DisposedStruct { - public int numLines; // Specifies the number of straight edges to find. - public StraightEdgeSearchMode searchMode; // Specifies the method used to - // find the straight edge. - public double minScore; // Specifies the minimum score of a detected - // straight edge. - public double maxScore; // Specifies the maximum score of a detected edge. - public double orientation; // Specifies the angle at which the straight edge - // is expected to be found. - public double angleRange; // Specifies the +/- range around the orientation - // within which the straight edge is expected to - // be found. - public double angleTolerance; // Specifies the expected angular accuracy of - // the straight edge. - public int stepSize; // Specifies the gap in pixels between the search lines - // used with the rake-based methods. - public double minSignalToNoiseRatio; // Specifies the minimum signal to - // noise ratio (SNR) of the edge points - // used to fit the straight edge. - public double minCoverage; // Specifies the minimum number of points as a - // percentage of the number of search lines that - // need to be included in the detected straight - // edge. - public int houghIterations; // Specifies the number of iterations used in - // the Hough-based method. - - private void init() { - - } - - public StraightEdgeOptions() { - super(80); - init(); - } - - public StraightEdgeOptions(int numLines, StraightEdgeSearchMode searchMode, double minScore, - double maxScore, double orientation, double angleRange, double angleTolerance, - int stepSize, double minSignalToNoiseRatio, double minCoverage, int houghIterations) { - super(80); - this.numLines = numLines; - this.searchMode = searchMode; - this.minScore = minScore; - this.maxScore = maxScore; - this.orientation = orientation; - this.angleRange = angleRange; - this.angleTolerance = angleTolerance; - this.stepSize = stepSize; - this.minSignalToNoiseRatio = minSignalToNoiseRatio; - this.minCoverage = minCoverage; - this.houghIterations = houghIterations; - } - - protected StraightEdgeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 80); - init(); - } - - protected StraightEdgeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 80); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 80); - } - - public void read() { - numLines = backing.getInt(0); - searchMode = StraightEdgeSearchMode.fromValue(backing.getInt(4)); - minScore = backing.getDouble(8); - maxScore = backing.getDouble(16); - orientation = backing.getDouble(24); - angleRange = backing.getDouble(32); - angleTolerance = backing.getDouble(40); - stepSize = backing.getInt(48); - minSignalToNoiseRatio = backing.getDouble(56); - minCoverage = backing.getDouble(64); - houghIterations = backing.getInt(72); - } - - public void write() { - backing.putInt(0, numLines); - if (searchMode != null) - backing.putInt(4, searchMode.getValue()); - backing.putDouble(8, minScore); - backing.putDouble(16, maxScore); - backing.putDouble(24, orientation); - backing.putDouble(32, angleRange); - backing.putDouble(40, angleTolerance); - backing.putInt(48, stepSize); - backing.putDouble(56, minSignalToNoiseRatio); - backing.putDouble(64, minCoverage); - backing.putInt(72, houghIterations); - } - - public int size() { - return 80; - } - } - - public static class StraightEdge extends DisposedStruct { - public LineFloat straightEdgeCoordinates; // End points of the detected - // straight edge in pixel - // coordinates. - public LineFloat calibratedStraightEdgeCoordinates; // End points of the - // detected straight - // edge in real-world - // coordinates. - public double angle; // Angle of the found edge using the pixel coordinates. - public double calibratedAngle; // Angle of the found edge using the - // real-world coordinates. - public double score; // Describes the score of the detected edge. - public double straightness; // The straightness value of the detected - // straight edge. - public double averageSignalToNoiseRatio; // Describes the average signal to - // noise ratio (SNR) of the - // detected edge. - public int calibrationValid; // Indicates if the calibration data for the - // straight edge is valid. - public EdgeInfo[] usedEdges; // An array of edges that were used to - // determine this straight line. - private ByteBuffer usedEdges_buf; - - private void init() { - straightEdgeCoordinates = new LineFloat(backing, 0); - calibratedStraightEdgeCoordinates = new LineFloat(backing, 16); - usedEdges = new EdgeInfo[0]; - } - - public StraightEdge() { - super(88); - init(); - } - - public StraightEdge(LineFloat straightEdgeCoordinates, - LineFloat calibratedStraightEdgeCoordinates, double angle, double calibratedAngle, - double score, double straightness, double averageSignalToNoiseRatio, int calibrationValid, - EdgeInfo[] usedEdges) { - super(88); - this.straightEdgeCoordinates = straightEdgeCoordinates; - this.calibratedStraightEdgeCoordinates = calibratedStraightEdgeCoordinates; - this.angle = angle; - this.calibratedAngle = calibratedAngle; - this.score = score; - this.straightness = straightness; - this.averageSignalToNoiseRatio = averageSignalToNoiseRatio; - this.calibrationValid = calibrationValid; - this.usedEdges = usedEdges; - } - - protected StraightEdge(ByteBuffer backing, int offset) { - super(backing, offset, 88); - init(); - } - - protected StraightEdge(long nativeObj, boolean owned) { - super(nativeObj, owned, 88); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 88); - } - - public void read() { - straightEdgeCoordinates.read(); - calibratedStraightEdgeCoordinates.read(); - angle = backing.getDouble(32); - calibratedAngle = backing.getDouble(40); - score = backing.getDouble(48); - straightness = backing.getDouble(56); - averageSignalToNoiseRatio = backing.getDouble(64); - calibrationValid = backing.getInt(72); - int usedEdges_numUsedEdges = backing.getInt(80); - long usedEdges_addr = getPointer(backing, 76); - usedEdges = new EdgeInfo[usedEdges_numUsedEdges]; - if (usedEdges_numUsedEdges > 0 && usedEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(usedEdges_addr, usedEdges_numUsedEdges * 56); - for (int i = 0, off = 0; i < usedEdges_numUsedEdges; i++, off += 56) { - usedEdges[i] = new EdgeInfo(bb, off); - usedEdges[i].read(); - } - } - } - - public void write() { - straightEdgeCoordinates.write(); - calibratedStraightEdgeCoordinates.write(); - backing.putDouble(32, angle); - backing.putDouble(40, calibratedAngle); - backing.putDouble(48, score); - backing.putDouble(56, straightness); - backing.putDouble(64, averageSignalToNoiseRatio); - backing.putInt(72, calibrationValid); - usedEdges_buf = - ByteBuffer.allocateDirect(usedEdges.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < usedEdges.length; i++, off += 56) { - usedEdges[i].setBuffer(usedEdges_buf, off); - usedEdges[i].write(); - } - backing.putInt(80, usedEdges.length); - putPointer(backing, 76, usedEdges_buf); - } - - public int size() { - return 88; - } - } - - public static class QRCodeSearchOptions extends DisposedStruct { - public QRRotationMode rotationMode; // Specifies the amount of QR code - // rotation the function should allow - // for. - public int skipLocation; // If set to TRUE, specifies that the function - // should assume that the QR code occupies the - // entire image (or the entire search region). - public int edgeThreshold; // The strength of the weakest edge the function - // uses to find the coarse location of the QR code - // in the image. - public QRDemodulationMode demodulationMode; // The demodulation mode the - // function uses to locate the - // QR code. - public QRCellSampleSize cellSampleSize; // The cell sample size the function - // uses to locate the QR code. - public QRCellFilterMode cellFilterMode; // The cell filter mode the function - // uses to locate the QR code. - public int skewDegreesAllowed; // Specifies the amount of skew in the QR - // code the function should allow for. - - private void init() { - - } - - public QRCodeSearchOptions() { - super(48); - init(); - } - - public QRCodeSearchOptions(QRRotationMode rotationMode, int skipLocation, int edgeThreshold, - QRDemodulationMode demodulationMode, QRCellSampleSize cellSampleSize, - QRCellFilterMode cellFilterMode, int skewDegreesAllowed) { - super(48); - this.rotationMode = rotationMode; - this.skipLocation = skipLocation; - this.edgeThreshold = edgeThreshold; - this.demodulationMode = demodulationMode; - this.cellSampleSize = cellSampleSize; - this.cellFilterMode = cellFilterMode; - this.skewDegreesAllowed = skewDegreesAllowed; - } - - protected QRCodeSearchOptions(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected QRCodeSearchOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - rotationMode = QRRotationMode.fromValue(backing.getInt(0)); - skipLocation = backing.getInt(4); - edgeThreshold = backing.getInt(8); - demodulationMode = QRDemodulationMode.fromValue(backing.getInt(16)); - cellSampleSize = QRCellSampleSize.fromValue(backing.getInt(24)); - cellFilterMode = QRCellFilterMode.fromValue(backing.getInt(32)); - skewDegreesAllowed = backing.getInt(40); - } - - public void write() { - if (rotationMode != null) - backing.putInt(0, rotationMode.getValue()); - backing.putInt(4, skipLocation); - backing.putInt(8, edgeThreshold); - if (demodulationMode != null) - backing.putInt(16, demodulationMode.getValue()); - if (cellSampleSize != null) - backing.putInt(24, cellSampleSize.getValue()); - if (cellFilterMode != null) - backing.putInt(32, cellFilterMode.getValue()); - backing.putInt(40, skewDegreesAllowed); - } - - public int size() { - return 48; - } - } - - public static class QRCodeSizeOptions extends DisposedStruct { - public int minSize; // Specifies the minimum size (in pixels) of the QR code - // in the image. - public int maxSize; // Specifies the maximum size (in pixels) of the QR code - // in the image. - - private void init() { - - } - - public QRCodeSizeOptions() { - super(8); - init(); - } - - public QRCodeSizeOptions(int minSize, int maxSize) { - super(8); - this.minSize = minSize; - this.maxSize = maxSize; - } - - protected QRCodeSizeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected QRCodeSizeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - minSize = backing.getInt(0); - maxSize = backing.getInt(4); - } - - public void write() { - backing.putInt(0, minSize); - backing.putInt(4, maxSize); - } - - public int size() { - return 8; - } - } - - public static class QRCodeDescriptionOptions extends DisposedStruct { - public QRDimensions dimensions; // The number of rows and columns that are - // populated for the QR code, measured in - // cells. - public QRPolarities polarity; // The polarity of the QR code. - public QRMirrorMode mirror; // This element is TRUE if the QR code appears - // mirrored in the image and FALSE if the QR - // code appears normally in the image. - public QRModelType modelType; // This option allows you to specify the type - // of QR code. - - private void init() { - - } - - public QRCodeDescriptionOptions() { - super(32); - init(); - } - - public QRCodeDescriptionOptions(QRDimensions dimensions, QRPolarities polarity, - QRMirrorMode mirror, QRModelType modelType) { - super(32); - this.dimensions = dimensions; - this.polarity = polarity; - this.mirror = mirror; - this.modelType = modelType; - } - - protected QRCodeDescriptionOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected QRCodeDescriptionOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - dimensions = QRDimensions.fromValue(backing.getInt(0)); - polarity = QRPolarities.fromValue(backing.getInt(8)); - mirror = QRMirrorMode.fromValue(backing.getInt(16)); - modelType = QRModelType.fromValue(backing.getInt(24)); - } - - public void write() { - if (dimensions != null) - backing.putInt(0, dimensions.getValue()); - if (polarity != null) - backing.putInt(8, polarity.getValue()); - if (mirror != null) - backing.putInt(16, mirror.getValue()); - if (modelType != null) - backing.putInt(24, modelType.getValue()); - } - - public int size() { - return 32; - } - } - - public static class QRCodeReport extends DisposedStruct { - public int found; // This element is TRUE if the function located and - // decoded a QR code and FALSE if the function failed to - // locate and decode a QR code. - public byte[] data; // The data encoded in the QR code. - public PointFloat[] boundingBox; // An array of four points describing the - // rectangle surrounding the QR code. - public QRCodeDataToken[] tokenizedData; // Contains the data tokenized in - // exactly the way it was encoded in - // the code. - public int numErrorsCorrected; // The number of errors the function - // corrected when decoding the QR code. - public int dimensions; // The number of rows and columns that are populated - // for the QR code, measured in cells. - public int version; // The version of the QR code. - public QRModelType modelType; // This option allows you to specify what type - // of QR code this is. - public QRStreamMode streamMode; // The format of the data encoded in the - // stream. - public QRPolarities matrixPolarity; // The polarity of the QR code. - public int mirrored; // This element is TRUE if the QR code appears mirrored - // in the image and FALSE if the QR code appears - // normally in the image. - public int positionInAppendStream; // Indicates what position the QR code is - // in with respect to the stream of data - // in all codes. - public int sizeOfAppendStream; // Specifies how many QR codes are part of a - // larger array of codes. - public int firstEAN128ApplicationID; // The first EAN-128 Application ID - // encountered in the stream. - public int firstECIDesignator; // The first Regional Language Designator - // encountered in the stream. - public int appendStreamIdentifier; // Specifies what stream the QR code is - // in relation to when the code is part - // of a larger array of codes. - public int minimumEdgeStrength; // The strength of the weakest edge the - // function used to find the coarse location - // of the QR code in the image. - public QRDemodulationMode demodulationMode; // The demodulation mode the - // function used to locate the - // QR code. - public QRCellSampleSize cellSampleSize; // The cell sample size the function - // used to locate the QR code. - public QRCellFilterMode cellFilterMode; // The cell filter mode the function - // used to locate the QR code. - private ByteBuffer data_buf; - private ByteBuffer tokenizedData_buf; - - private void init() { - data = new byte[0]; - boundingBox = new PointFloat[4]; - - for (int i = 0, off = 12; i < 4; i++, off += 8) - boundingBox[i] = new PointFloat(backing, off); - tokenizedData = new QRCodeDataToken[0]; - } - - public QRCodeReport() { - super(136); - init(); - } - - public QRCodeReport(int found, byte[] data, PointFloat[] boundingBox, - QRCodeDataToken[] tokenizedData, int numErrorsCorrected, int dimensions, int version, - QRModelType modelType, QRStreamMode streamMode, QRPolarities matrixPolarity, int mirrored, - int positionInAppendStream, int sizeOfAppendStream, int firstEAN128ApplicationID, - int firstECIDesignator, int appendStreamIdentifier, int minimumEdgeStrength, - QRDemodulationMode demodulationMode, QRCellSampleSize cellSampleSize, - QRCellFilterMode cellFilterMode) { - super(136); - this.found = found; - this.data = data; - this.boundingBox = boundingBox; - this.tokenizedData = tokenizedData; - this.numErrorsCorrected = numErrorsCorrected; - this.dimensions = dimensions; - this.version = version; - this.modelType = modelType; - this.streamMode = streamMode; - this.matrixPolarity = matrixPolarity; - this.mirrored = mirrored; - this.positionInAppendStream = positionInAppendStream; - this.sizeOfAppendStream = sizeOfAppendStream; - this.firstEAN128ApplicationID = firstEAN128ApplicationID; - this.firstECIDesignator = firstECIDesignator; - this.appendStreamIdentifier = appendStreamIdentifier; - this.minimumEdgeStrength = minimumEdgeStrength; - this.demodulationMode = demodulationMode; - this.cellSampleSize = cellSampleSize; - this.cellFilterMode = cellFilterMode; - } - - protected QRCodeReport(ByteBuffer backing, int offset) { - super(backing, offset, 136); - init(); - } - - protected QRCodeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 136); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 136); - } - - public void read() { - found = backing.getInt(0); - int data_dataLength = backing.getInt(8); - long data_addr = getPointer(backing, 4); - data = new byte[data_dataLength]; - if (data_dataLength > 0 && data_addr != 0) { - getBytes(newDirectByteBuffer(data_addr, data_dataLength), data, 0, data_dataLength); - } - for (PointFloat it : boundingBox) { - it.read(); - } - int tokenizedData_sizeOfTokenizedData = backing.getInt(48); - long tokenizedData_addr = getPointer(backing, 44); - tokenizedData = new QRCodeDataToken[tokenizedData_sizeOfTokenizedData]; - if (tokenizedData_sizeOfTokenizedData > 0 && tokenizedData_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(tokenizedData_addr, tokenizedData_sizeOfTokenizedData * 16); - for (int i = 0, off = 0; i < tokenizedData_sizeOfTokenizedData; i++, off += 16) { - tokenizedData[i] = new QRCodeDataToken(bb, off); - tokenizedData[i].read(); - } - } - numErrorsCorrected = backing.getInt(52); - dimensions = backing.getInt(56); - version = backing.getInt(60); - modelType = QRModelType.fromValue(backing.getInt(64)); - streamMode = QRStreamMode.fromValue(backing.getInt(68)); - matrixPolarity = QRPolarities.fromValue(backing.getInt(72)); - mirrored = backing.getInt(80); - positionInAppendStream = backing.getInt(84); - sizeOfAppendStream = backing.getInt(88); - firstEAN128ApplicationID = backing.getInt(92); - firstECIDesignator = backing.getInt(96); - appendStreamIdentifier = backing.getInt(100); - minimumEdgeStrength = backing.getInt(104); - demodulationMode = QRDemodulationMode.fromValue(backing.getInt(112)); - cellSampleSize = QRCellSampleSize.fromValue(backing.getInt(120)); - cellFilterMode = QRCellFilterMode.fromValue(backing.getInt(128)); - } - - public void write() { - backing.putInt(0, found); - data_buf = ByteBuffer.allocateDirect(data.length); - putBytes(data_buf, data, 0, data.length); - backing.putInt(8, data.length); - putPointer(backing, 4, data_buf); - for (PointFloat it : boundingBox) { - it.write(); - } - tokenizedData_buf = - ByteBuffer.allocateDirect(tokenizedData.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < tokenizedData.length; i++, off += 16) { - tokenizedData[i].setBuffer(tokenizedData_buf, off); - tokenizedData[i].write(); - } - backing.putInt(48, tokenizedData.length); - putPointer(backing, 44, tokenizedData_buf); - backing.putInt(52, numErrorsCorrected); - backing.putInt(56, dimensions); - backing.putInt(60, version); - if (modelType != null) - backing.putInt(64, modelType.getValue()); - if (streamMode != null) - backing.putInt(68, streamMode.getValue()); - if (matrixPolarity != null) - backing.putInt(72, matrixPolarity.getValue()); - backing.putInt(80, mirrored); - backing.putInt(84, positionInAppendStream); - backing.putInt(88, sizeOfAppendStream); - backing.putInt(92, firstEAN128ApplicationID); - backing.putInt(96, firstECIDesignator); - backing.putInt(100, appendStreamIdentifier); - backing.putInt(104, minimumEdgeStrength); - if (demodulationMode != null) - backing.putInt(112, demodulationMode.getValue()); - if (cellSampleSize != null) - backing.putInt(120, cellSampleSize.getValue()); - if (cellFilterMode != null) - backing.putInt(128, cellFilterMode.getValue()); - } - - public int size() { - return 136; - } - } - - public static class AIMGradeReport extends DisposedStruct { - public AIMGrade overallGrade; // The overall letter grade, which is equal to - // the lowest of the other five letter grades. - public AIMGrade decodingGrade; // The letter grade assigned to a Data Matrix - // barcode based on the success of the - // function in decoding the Data Matrix - // barcode. - public AIMGrade symbolContrastGrade; // The letter grade assigned to a Data - // Matrix barcode based on the symbol - // contrast raw score. - public float symbolContrast; // The symbol contrast raw score representing - // the percentage difference between the mean - // of the reflectance of the darkest 10 percent - // and lightest 10 percent of the Data Matrix - // barcode. - public AIMGrade printGrowthGrade; // The print growth letter grade for the - // Data Matrix barcode. - public float printGrowth; // The print growth raw score for the barcode, - // which is based on the extent to which dark or - // light markings appropriately fill their module - // boundaries. - public AIMGrade axialNonuniformityGrade; // The axial nonuniformity grade - // for the Data Matrix barcode. - public float axialNonuniformity; // The axial nonuniformity raw score for - // the barcode, which is based on how much - // the sampling point spacing differs from - // one axis to another. - public AIMGrade unusedErrorCorrectionGrade; // The unused error correction - // letter grade for the Data - // Matrix barcode. - public float unusedErrorCorrection; // The unused error correction raw score - // for the Data Matrix barcode, which is - // based on the extent to which regional - // or spot damage in the Data Matrix - // barcode has eroded the reading safety - // margin provided by the error - // correction. - - private void init() { - - } - - public AIMGradeReport() { - super(40); - init(); - } - - public AIMGradeReport(AIMGrade overallGrade, AIMGrade decodingGrade, - AIMGrade symbolContrastGrade, double symbolContrast, AIMGrade printGrowthGrade, - double printGrowth, AIMGrade axialNonuniformityGrade, double axialNonuniformity, - AIMGrade unusedErrorCorrectionGrade, double unusedErrorCorrection) { - super(40); - this.overallGrade = overallGrade; - this.decodingGrade = decodingGrade; - this.symbolContrastGrade = symbolContrastGrade; - this.symbolContrast = (float) symbolContrast; - this.printGrowthGrade = printGrowthGrade; - this.printGrowth = (float) printGrowth; - this.axialNonuniformityGrade = axialNonuniformityGrade; - this.axialNonuniformity = (float) axialNonuniformity; - this.unusedErrorCorrectionGrade = unusedErrorCorrectionGrade; - this.unusedErrorCorrection = (float) unusedErrorCorrection; - } - - protected AIMGradeReport(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected AIMGradeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - overallGrade = AIMGrade.fromValue(backing.getInt(0)); - decodingGrade = AIMGrade.fromValue(backing.getInt(4)); - symbolContrastGrade = AIMGrade.fromValue(backing.getInt(8)); - symbolContrast = backing.getFloat(12); - printGrowthGrade = AIMGrade.fromValue(backing.getInt(16)); - printGrowth = backing.getFloat(20); - axialNonuniformityGrade = AIMGrade.fromValue(backing.getInt(24)); - axialNonuniformity = backing.getFloat(28); - unusedErrorCorrectionGrade = AIMGrade.fromValue(backing.getInt(32)); - unusedErrorCorrection = backing.getFloat(36); - } - - public void write() { - if (overallGrade != null) - backing.putInt(0, overallGrade.getValue()); - if (decodingGrade != null) - backing.putInt(4, decodingGrade.getValue()); - if (symbolContrastGrade != null) - backing.putInt(8, symbolContrastGrade.getValue()); - backing.putFloat(12, symbolContrast); - if (printGrowthGrade != null) - backing.putInt(16, printGrowthGrade.getValue()); - backing.putFloat(20, printGrowth); - if (axialNonuniformityGrade != null) - backing.putInt(24, axialNonuniformityGrade.getValue()); - backing.putFloat(28, axialNonuniformity); - if (unusedErrorCorrectionGrade != null) - backing.putInt(32, unusedErrorCorrectionGrade.getValue()); - backing.putFloat(36, unusedErrorCorrection); - } - - public int size() { - return 40; - } - } - - public static class DataMatrixSizeOptions extends DisposedStruct { - public int minSize; // Specifies the minimum size (in pixels) of the Data - // Matrix barcode in the image. - public int maxSize; // Specifies the maximum size (in pixels) of the Data - // Matrix barcode in the image. - public int quietZoneWidth; // Specifies the expected minimum size of the - // quiet zone, in pixels. - - private void init() { - - } - - public DataMatrixSizeOptions() { - super(12); - init(); - } - - public DataMatrixSizeOptions(int minSize, int maxSize, int quietZoneWidth) { - super(12); - this.minSize = minSize; - this.maxSize = maxSize; - this.quietZoneWidth = quietZoneWidth; - } - - protected DataMatrixSizeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected DataMatrixSizeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - minSize = backing.getInt(0); - maxSize = backing.getInt(4); - quietZoneWidth = backing.getInt(8); - } - - public void write() { - backing.putInt(0, minSize); - backing.putInt(4, maxSize); - backing.putInt(8, quietZoneWidth); - } - - public int size() { - return 12; - } - } - - public static class DataMatrixDescriptionOptions extends DisposedStruct { - public float aspectRatio; // Specifies the ratio of the width of each Data - // Matrix barcode cell (in pixels) to the height - // of the Data Matrix barcode (in pixels). - public int rows; // Specifies the number of rows in the Data Matrix barcode. - public int columns; // Specifies the number of columns in the Data Matrix - // barcode. - public int rectangle; // Set this element to TRUE to specify that the Data - // Matrix barcode is rectangular. - public DataMatrixECC ecc; // Specifies the ECC used for this Data Matrix - // barcode. - public DataMatrixPolarity polarity; // Specifies the data-to-background - // contrast for the Data Matrix barcode. - public DataMatrixCellFillMode cellFill; // Specifies the fill percentage for - // a cell of the Data Matrix barcode - // that is in the "ON" state. - public float minBorderIntegrity; // Specifies the minimum percentage of the - // border (locator pattern and timing - // pattern) the function should expect in - // the Data Matrix barcode. - public DataMatrixMirrorMode mirrorMode; // Specifies if the Data Matrix - // barcode appears normally in the - // image or if the barcode appears - // mirrored in the image. - - private void init() { - - } - - public DataMatrixDescriptionOptions() { - super(56); - init(); - } - - public DataMatrixDescriptionOptions(double aspectRatio, int rows, int columns, int rectangle, - DataMatrixECC ecc, DataMatrixPolarity polarity, DataMatrixCellFillMode cellFill, - double minBorderIntegrity, DataMatrixMirrorMode mirrorMode) { - super(56); - this.aspectRatio = (float) aspectRatio; - this.rows = rows; - this.columns = columns; - this.rectangle = rectangle; - this.ecc = ecc; - this.polarity = polarity; - this.cellFill = cellFill; - this.minBorderIntegrity = (float) minBorderIntegrity; - this.mirrorMode = mirrorMode; - } - - protected DataMatrixDescriptionOptions(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected DataMatrixDescriptionOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - aspectRatio = backing.getFloat(0); - rows = backing.getInt(4); - columns = backing.getInt(8); - rectangle = backing.getInt(12); - ecc = DataMatrixECC.fromValue(backing.getInt(16)); - polarity = DataMatrixPolarity.fromValue(backing.getInt(24)); - cellFill = DataMatrixCellFillMode.fromValue(backing.getInt(32)); - minBorderIntegrity = backing.getFloat(40); - mirrorMode = DataMatrixMirrorMode.fromValue(backing.getInt(48)); - } - - public void write() { - backing.putFloat(0, aspectRatio); - backing.putInt(4, rows); - backing.putInt(8, columns); - backing.putInt(12, rectangle); - if (ecc != null) - backing.putInt(16, ecc.getValue()); - if (polarity != null) - backing.putInt(24, polarity.getValue()); - if (cellFill != null) - backing.putInt(32, cellFill.getValue()); - backing.putFloat(40, minBorderIntegrity); - if (mirrorMode != null) - backing.putInt(48, mirrorMode.getValue()); - } - - public int size() { - return 56; - } - } - - public static class DataMatrixSearchOptions extends DisposedStruct { - public DataMatrixRotationMode rotationMode; // Specifies the amount of Data - // Matrix barcode rotation the - // function should allow for. - public int skipLocation; // If set to TRUE, specifies that the function - // should assume that the Data Matrix barcode - // occupies the entire image (or the entire search - // region). - public int edgeThreshold; // Specifies the minimum contrast a pixel must - // have in order to be considered part of a matrix - // cell edge. - public DataMatrixDemodulationMode demodulationMode; // Specifies the mode - // the function should - // use to demodulate - // (determine which - // cells are on and - // which cells are off) - // the Data Matrix - // barcode. - public DataMatrixCellSampleSize cellSampleSize; // Specifies the sample - // size, in pixels, the - // function should take to - // determine if each cell is - // on or off. - public DataMatrixCellFilterMode cellFilterMode; // Specifies the mode the - // function uses to - // determine the pixel value - // for each cell. - public int skewDegreesAllowed; // Specifies the amount of skew in the Data - // Matrix barcode the function should allow - // for. - public int maxIterations; // Specifies the maximum number of iterations - // before the function stops looking for the Data - // Matrix barcode. - public int initialSearchVectorWidth; // Specifies the number of pixels the - // function should average together to - // determine the location of an edge. - - private void init() { - - } - - public DataMatrixSearchOptions() { - super(56); - init(); - } - - public DataMatrixSearchOptions(DataMatrixRotationMode rotationMode, int skipLocation, - int edgeThreshold, DataMatrixDemodulationMode demodulationMode, - DataMatrixCellSampleSize cellSampleSize, DataMatrixCellFilterMode cellFilterMode, - int skewDegreesAllowed, int maxIterations, int initialSearchVectorWidth) { - super(56); - this.rotationMode = rotationMode; - this.skipLocation = skipLocation; - this.edgeThreshold = edgeThreshold; - this.demodulationMode = demodulationMode; - this.cellSampleSize = cellSampleSize; - this.cellFilterMode = cellFilterMode; - this.skewDegreesAllowed = skewDegreesAllowed; - this.maxIterations = maxIterations; - this.initialSearchVectorWidth = initialSearchVectorWidth; - } - - protected DataMatrixSearchOptions(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected DataMatrixSearchOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - rotationMode = DataMatrixRotationMode.fromValue(backing.getInt(0)); - skipLocation = backing.getInt(4); - edgeThreshold = backing.getInt(8); - demodulationMode = DataMatrixDemodulationMode.fromValue(backing.getInt(16)); - cellSampleSize = DataMatrixCellSampleSize.fromValue(backing.getInt(24)); - cellFilterMode = DataMatrixCellFilterMode.fromValue(backing.getInt(32)); - skewDegreesAllowed = backing.getInt(40); - maxIterations = backing.getInt(44); - initialSearchVectorWidth = backing.getInt(48); - } - - public void write() { - if (rotationMode != null) - backing.putInt(0, rotationMode.getValue()); - backing.putInt(4, skipLocation); - backing.putInt(8, edgeThreshold); - if (demodulationMode != null) - backing.putInt(16, demodulationMode.getValue()); - if (cellSampleSize != null) - backing.putInt(24, cellSampleSize.getValue()); - if (cellFilterMode != null) - backing.putInt(32, cellFilterMode.getValue()); - backing.putInt(40, skewDegreesAllowed); - backing.putInt(44, maxIterations); - backing.putInt(48, initialSearchVectorWidth); - } - - public int size() { - return 56; - } - } - - public static class DataMatrixReport extends DisposedStruct { - public int found; // This element is TRUE if the function located and - // decoded a Data Matrix barcode and FALSE if the function - // failed to locate and decode a Data Matrix barcode. - public int binary; // This element is TRUE if the Data Matrix barcode - // contains binary data and FALSE if the Data Matrix - // barcode contains text data. - public byte[] data; // The data encoded in the Data Matrix barcode. - public PointFloat[] boundingBox; // An array of four points describing the - // rectangle surrounding the Data Matrix - // barcode. - public int numErrorsCorrected; // The number of errors the function - // corrected when decoding the Data Matrix - // barcode. - public int numErasuresCorrected; // The number of erasures the function - // corrected when decoding the Data Matrix - // barcode. - public float aspectRatio; // Specifies the aspect ratio of the Data Matrix - // barcode in the image, which equals the ratio of - // the width of a Data Matrix barcode cell (in - // pixels) to the height of a Data Matrix barcode - // cell (in pixels). - public int rows; // The number of rows in the Data Matrix barcode. - public int columns; // The number of columns in the Data Matrix barcode. - public DataMatrixECC ecc; // The Error Correction Code (ECC) used by the - // Data Matrix barcode. - public DataMatrixPolarity polarity; // The polarity of the Data Matrix - // barcode. - public DataMatrixCellFillMode cellFill; // The cell fill percentage of the - // Data Matrix barcode. - public float borderIntegrity; // The percentage of the Data Matrix barcode - // border that appears correctly in the image. - public int mirrored; // This element is TRUE if the Data Matrix barcode - // appears mirrored in the image and FALSE if the Data - // Matrix barcode appears normally in the image. - public int minimumEdgeStrength; // The strength of the weakest edge the - // function used to find the coarse location - // of the Data Matrix barcode in the image. - public DataMatrixDemodulationMode demodulationMode; // The demodulation mode - // the function used to - // locate the Data - // Matrix barcode. - public DataMatrixCellSampleSize cellSampleSize; // The cell sample size the - // function used to locate - // the Data Matrix barcode. - public DataMatrixCellFilterMode cellFilterMode; // The cell filter mode the - // function used to locate - // the Data Matrix barcode. - public int iterations; // The number of iterations the function took in - // attempting to locate the Data Matrix barcode. - private ByteBuffer data_buf; - - private void init() { - data = new byte[0]; - boundingBox = new PointFloat[4]; - - for (int i = 0, off = 16; i < 4; i++, off += 8) - boundingBox[i] = new PointFloat(backing, off); - } - - public DataMatrixReport() { - super(144); - init(); - } - - public DataMatrixReport(int found, int binary, byte[] data, PointFloat[] boundingBox, - int numErrorsCorrected, int numErasuresCorrected, double aspectRatio, int rows, - int columns, DataMatrixECC ecc, DataMatrixPolarity polarity, - DataMatrixCellFillMode cellFill, double borderIntegrity, int mirrored, - int minimumEdgeStrength, DataMatrixDemodulationMode demodulationMode, - DataMatrixCellSampleSize cellSampleSize, DataMatrixCellFilterMode cellFilterMode, - int iterations) { - super(144); - this.found = found; - this.binary = binary; - this.data = data; - this.boundingBox = boundingBox; - this.numErrorsCorrected = numErrorsCorrected; - this.numErasuresCorrected = numErasuresCorrected; - this.aspectRatio = (float) aspectRatio; - this.rows = rows; - this.columns = columns; - this.ecc = ecc; - this.polarity = polarity; - this.cellFill = cellFill; - this.borderIntegrity = (float) borderIntegrity; - this.mirrored = mirrored; - this.minimumEdgeStrength = minimumEdgeStrength; - this.demodulationMode = demodulationMode; - this.cellSampleSize = cellSampleSize; - this.cellFilterMode = cellFilterMode; - this.iterations = iterations; - } - - protected DataMatrixReport(ByteBuffer backing, int offset) { - super(backing, offset, 144); - init(); - } - - protected DataMatrixReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 144); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 144); - } - - public void read() { - found = backing.getInt(0); - binary = backing.getInt(4); - int data_dataLength = backing.getInt(12); - long data_addr = getPointer(backing, 8); - data = new byte[data_dataLength]; - if (data_dataLength > 0 && data_addr != 0) { - getBytes(newDirectByteBuffer(data_addr, data_dataLength), data, 0, data_dataLength); - } - for (PointFloat it : boundingBox) { - it.read(); - } - numErrorsCorrected = backing.getInt(48); - numErasuresCorrected = backing.getInt(52); - aspectRatio = backing.getFloat(56); - rows = backing.getInt(60); - columns = backing.getInt(64); - ecc = DataMatrixECC.fromValue(backing.getInt(72)); - polarity = DataMatrixPolarity.fromValue(backing.getInt(80)); - cellFill = DataMatrixCellFillMode.fromValue(backing.getInt(88)); - borderIntegrity = backing.getFloat(96); - mirrored = backing.getInt(100); - minimumEdgeStrength = backing.getInt(104); - demodulationMode = DataMatrixDemodulationMode.fromValue(backing.getInt(112)); - cellSampleSize = DataMatrixCellSampleSize.fromValue(backing.getInt(120)); - cellFilterMode = DataMatrixCellFilterMode.fromValue(backing.getInt(128)); - iterations = backing.getInt(136); - } - - public void write() { - backing.putInt(0, found); - backing.putInt(4, binary); - data_buf = ByteBuffer.allocateDirect(data.length); - putBytes(data_buf, data, 0, data.length); - backing.putInt(12, data.length); - putPointer(backing, 8, data_buf); - for (PointFloat it : boundingBox) { - it.write(); - } - backing.putInt(48, numErrorsCorrected); - backing.putInt(52, numErasuresCorrected); - backing.putFloat(56, aspectRatio); - backing.putInt(60, rows); - backing.putInt(64, columns); - if (ecc != null) - backing.putInt(72, ecc.getValue()); - if (polarity != null) - backing.putInt(80, polarity.getValue()); - if (cellFill != null) - backing.putInt(88, cellFill.getValue()); - backing.putFloat(96, borderIntegrity); - backing.putInt(100, mirrored); - backing.putInt(104, minimumEdgeStrength); - if (demodulationMode != null) - backing.putInt(112, demodulationMode.getValue()); - if (cellSampleSize != null) - backing.putInt(120, cellSampleSize.getValue()); - if (cellFilterMode != null) - backing.putInt(128, cellFilterMode.getValue()); - backing.putInt(136, iterations); - } - - public int size() { - return 144; - } - } - - public static class JPEG2000FileAdvancedOptions extends DisposedStruct { - public WaveletTransformMode waveletMode; // Determines which wavelet - // transform to use when writing - // the file. - public int useMultiComponentTransform; // Set this parameter to TRUE to use - // an additional transform on RGB - // images. - public int maxWaveletTransformLevel; // Specifies the maximum allowed level - // of wavelet transform. - public float quantizationStepSize; // Specifies the absolute base - // quantization step size for derived - // quantization mode. - - private void init() { - - } - - public JPEG2000FileAdvancedOptions() { - super(16); - init(); - } - - public JPEG2000FileAdvancedOptions(WaveletTransformMode waveletMode, - int useMultiComponentTransform, int maxWaveletTransformLevel, double quantizationStepSize) { - super(16); - this.waveletMode = waveletMode; - this.useMultiComponentTransform = useMultiComponentTransform; - this.maxWaveletTransformLevel = maxWaveletTransformLevel; - this.quantizationStepSize = (float) quantizationStepSize; - } - - protected JPEG2000FileAdvancedOptions(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected JPEG2000FileAdvancedOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - waveletMode = WaveletTransformMode.fromValue(backing.getInt(0)); - useMultiComponentTransform = backing.getInt(4); - maxWaveletTransformLevel = backing.getInt(8); - quantizationStepSize = backing.getFloat(12); - } - - public void write() { - if (waveletMode != null) - backing.putInt(0, waveletMode.getValue()); - backing.putInt(4, useMultiComponentTransform); - backing.putInt(8, maxWaveletTransformLevel); - backing.putFloat(12, quantizationStepSize); - } - - public int size() { - return 16; - } - } - - public static class MatchGeometricPatternAdvancedOptions2 extends DisposedStruct { - public int minFeaturesUsed; // Specifies the minimum number of features the - // function uses when matching. - public int maxFeaturesUsed; // Specifies the maximum number of features the - // function uses when matching. - public int subpixelIterations; // Specifies the maximum number of - // incremental improvements used to refine - // matches with subpixel information. - public double subpixelTolerance; // Specifies the maximum amount of change, - // in pixels, between consecutive - // incremental improvements in the match - // position before the function stops - // refining the match position. - public int initialMatchListLength; // Specifies the maximum size of the - // match list. - public float matchTemplateCurveScore; // Set this element to TRUE to specify - // that the function should calculate - // the match curve to template curve - // score and return it for each match - // result. - public int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation - // score and return it for each match result. - public double minMatchSeparationDistance; // Specifies the minimum - // separation distance, in pixels, - // between the origins of two - // matches that have unique - // positions. - public double minMatchSeparationAngle; // Specifies the minimum angular - // difference, in degrees, between - // two matches that have unique - // angles. - public double minMatchSeparationScale; // Specifies the minimum difference - // in scale, expressed as a - // percentage, between two matches - // that have unique scales. - public double maxMatchOverlap; // Specifies the maximum amount of overlap, - // expressed as a percentage, allowed between - // the bounding rectangles of two unique - // matches. - public int coarseResult; // Specifies whether you want the function to spend - // less time accurately estimating the location of - // a match. - public int smoothContours; // Set this element to TRUE to specify smoothing - // be done on the contours of the inspection - // image before feature extraction. - public int enableCalibrationSupport; // Set this element to TRUE to specify - // the algorithm treat the inspection - // image as a calibrated image. - - private void init() { - - } - - public MatchGeometricPatternAdvancedOptions2() { - super(88); - init(); - } - - public MatchGeometricPatternAdvancedOptions2(int minFeaturesUsed, int maxFeaturesUsed, - int subpixelIterations, double subpixelTolerance, int initialMatchListLength, - double matchTemplateCurveScore, int correlationScore, double minMatchSeparationDistance, - double minMatchSeparationAngle, double minMatchSeparationScale, double maxMatchOverlap, - int coarseResult, int smoothContours, int enableCalibrationSupport) { - super(88); - this.minFeaturesUsed = minFeaturesUsed; - this.maxFeaturesUsed = maxFeaturesUsed; - this.subpixelIterations = subpixelIterations; - this.subpixelTolerance = subpixelTolerance; - this.initialMatchListLength = initialMatchListLength; - this.matchTemplateCurveScore = (float) matchTemplateCurveScore; - this.correlationScore = correlationScore; - this.minMatchSeparationDistance = minMatchSeparationDistance; - this.minMatchSeparationAngle = minMatchSeparationAngle; - this.minMatchSeparationScale = minMatchSeparationScale; - this.maxMatchOverlap = maxMatchOverlap; - this.coarseResult = coarseResult; - this.smoothContours = smoothContours; - this.enableCalibrationSupport = enableCalibrationSupport; - } - - protected MatchGeometricPatternAdvancedOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 88); - init(); - } - - protected MatchGeometricPatternAdvancedOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 88); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 88); - } - - public void read() { - minFeaturesUsed = backing.getInt(0); - maxFeaturesUsed = backing.getInt(4); - subpixelIterations = backing.getInt(8); - subpixelTolerance = backing.getDouble(16); - initialMatchListLength = backing.getInt(24); - matchTemplateCurveScore = backing.getFloat(28); - correlationScore = backing.getInt(32); - minMatchSeparationDistance = backing.getDouble(40); - minMatchSeparationAngle = backing.getDouble(48); - minMatchSeparationScale = backing.getDouble(56); - maxMatchOverlap = backing.getDouble(64); - coarseResult = backing.getInt(72); - smoothContours = backing.getInt(76); - enableCalibrationSupport = backing.getInt(80); - } - - public void write() { - backing.putInt(0, minFeaturesUsed); - backing.putInt(4, maxFeaturesUsed); - backing.putInt(8, subpixelIterations); - backing.putDouble(16, subpixelTolerance); - backing.putInt(24, initialMatchListLength); - backing.putFloat(28, matchTemplateCurveScore); - backing.putInt(32, correlationScore); - backing.putDouble(40, minMatchSeparationDistance); - backing.putDouble(48, minMatchSeparationAngle); - backing.putDouble(56, minMatchSeparationScale); - backing.putDouble(64, maxMatchOverlap); - backing.putInt(72, coarseResult); - backing.putInt(76, smoothContours); - backing.putInt(80, enableCalibrationSupport); - } - - public int size() { - return 88; - } - } - - public static class InspectionAlignment extends DisposedStruct { - public PointFloat position; // The location of the center of the golden - // template in the image under inspection. - public float rotation; // The rotation of the golden template in the image - // under inspection, in degrees. - public float scale; // The percentage of the size of the area under - // inspection compared to the size of the golden - // template. - - private void init() { - position = new PointFloat(backing, 0); - } - - public InspectionAlignment() { - super(16); - init(); - } - - public InspectionAlignment(PointFloat position, double rotation, double scale) { - super(16); - this.position = position; - this.rotation = (float) rotation; - this.scale = (float) scale; - } - - protected InspectionAlignment(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected InspectionAlignment(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - position.read(); - rotation = backing.getFloat(8); - scale = backing.getFloat(12); - } - - public void write() { - position.write(); - backing.putFloat(8, rotation); - backing.putFloat(12, scale); - } - - public int size() { - return 16; - } - } - - public static class InspectionOptions extends DisposedStruct { - public RegistrationMethod registrationMethod; // Specifies how the function - // registers the golden - // template and the target - // image. - public NormalizationMethod normalizationMethod; // Specifies how the - // function normalizes the - // golden template to the - // target image. - public int edgeThicknessToIgnore; // Specifies desired thickness of edges to - // be ignored. - public float brightThreshold; // Specifies the threshold for areas where the - // target image is brighter than the golden - // template. - public float darkThreshold; // Specifies the threshold for areas where the - // target image is darker than the golden - // template. - public int binary; // Specifies whether the function should return a binary - // image giving the location of defects, or a grayscale - // image giving the intensity of defects. - - private void init() { - - } - - public InspectionOptions() { - super(24); - init(); - } - - public InspectionOptions(RegistrationMethod registrationMethod, - NormalizationMethod normalizationMethod, int edgeThicknessToIgnore, double brightThreshold, - double darkThreshold, int binary) { - super(24); - this.registrationMethod = registrationMethod; - this.normalizationMethod = normalizationMethod; - this.edgeThicknessToIgnore = edgeThicknessToIgnore; - this.brightThreshold = (float) brightThreshold; - this.darkThreshold = (float) darkThreshold; - this.binary = binary; - } - - protected InspectionOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected InspectionOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - registrationMethod = RegistrationMethod.fromValue(backing.getInt(0)); - normalizationMethod = NormalizationMethod.fromValue(backing.getInt(4)); - edgeThicknessToIgnore = backing.getInt(8); - brightThreshold = backing.getFloat(12); - darkThreshold = backing.getFloat(16); - binary = backing.getInt(20); - } - - public void write() { - if (registrationMethod != null) - backing.putInt(0, registrationMethod.getValue()); - if (normalizationMethod != null) - backing.putInt(4, normalizationMethod.getValue()); - backing.putInt(8, edgeThicknessToIgnore); - backing.putFloat(12, brightThreshold); - backing.putFloat(16, darkThreshold); - backing.putInt(20, binary); - } - - public int size() { - return 24; - } - } - - public static class CharReport2 extends DisposedStruct { - public String character; // The character value. - public PointFloat[] corner; // An array of four points that describes the - // rectangle that surrounds the character. - public int lowThreshold; // The minimum value of the threshold range used - // for this character. - public int highThreshold; // The maximum value of the threshold range used - // for this character. - public int classificationScore; // The degree to which the assigned - // character class represents the object - // better than the other character classes - // in the character set. - public int verificationScore; // The similarity of the character and the - // reference character for the character - // class. - public int verified; // This element is TRUE if a reference character was - // found for the character class and FALSE if a - // reference character was not found. - private ByteBuffer character_buf; - - private void init() { - corner = new PointFloat[4]; - - for (int i = 0, off = 4; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public CharReport2() { - super(56); - init(); - } - - public CharReport2(String character, PointFloat[] corner, int lowThreshold, int highThreshold, - int classificationScore, int verificationScore, int verified) { - super(56); - this.character = character; - this.corner = corner; - this.lowThreshold = lowThreshold; - this.highThreshold = highThreshold; - this.classificationScore = classificationScore; - this.verificationScore = verificationScore; - this.verified = verified; - } - - protected CharReport2(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected CharReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - long character_addr = getPointer(backing, 0); - if (character_addr == 0) - character = null; - else { - ByteBuffer bb = newDirectByteBuffer(character_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - character = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - character = ""; - } - } - - for (PointFloat it : corner) { - it.read(); - } - lowThreshold = backing.getInt(36); - highThreshold = backing.getInt(40); - classificationScore = backing.getInt(44); - verificationScore = backing.getInt(48); - verified = backing.getInt(52); - } - - public void write() { - if (character != null) { - byte[] character_bytes; - try { - character_bytes = character.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - character_bytes = new byte[0]; - } - character_buf = ByteBuffer.allocateDirect(character_bytes.length + 1); - putBytes(character_buf, character_bytes, 0, character_bytes.length).put( - character_bytes.length, (byte) 0); - } - putPointer(backing, 0, character == null ? 0 : getByteBufferAddress(character_buf)); - for (PointFloat it : corner) { - it.write(); - } - backing.putInt(36, lowThreshold); - backing.putInt(40, highThreshold); - backing.putInt(44, classificationScore); - backing.putInt(48, verificationScore); - backing.putInt(52, verified); - } - - public int size() { - return 56; - } - } - - public static class CharInfo2 extends DisposedStruct { - public String charValue; // Retrieves the character value of the - // corresponding character in the character set. - public Image charImage; // The image you used to train this character. - public Image internalImage; // The internal representation that NI Vision - // uses to match objects to this character. - public int isReferenceChar; // This element is TRUE if the character is the - // reference character for the character class. - private ByteBuffer charValue_buf; - - private void init() { - - } - - public CharInfo2() { - super(16); - init(); - } - - public CharInfo2(String charValue, Image charImage, Image internalImage, int isReferenceChar) { - super(16); - this.charValue = charValue; - this.charImage = charImage; - this.internalImage = internalImage; - this.isReferenceChar = isReferenceChar; - } - - protected CharInfo2(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CharInfo2(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - long charValue_addr = getPointer(backing, 0); - if (charValue_addr == 0) - charValue = null; - else { - ByteBuffer bb = newDirectByteBuffer(charValue_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - charValue = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - charValue = ""; - } - } - - long charImage_addr = getPointer(backing, 4); - if (charImage_addr == 0) - charImage = null; - else - charImage = new Image(charImage_addr, false); - long internalImage_addr = getPointer(backing, 8); - if (internalImage_addr == 0) - internalImage = null; - else - internalImage = new Image(internalImage_addr, false); - isReferenceChar = backing.getInt(12); - } - - public void write() { - if (charValue != null) { - byte[] charValue_bytes; - try { - charValue_bytes = charValue.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - charValue_bytes = new byte[0]; - } - charValue_buf = ByteBuffer.allocateDirect(charValue_bytes.length + 1); - putBytes(charValue_buf, charValue_bytes, 0, charValue_bytes.length).put( - charValue_bytes.length, (byte) 0); - } - putPointer(backing, 0, charValue == null ? 0 : getByteBufferAddress(charValue_buf)); - putPointer(backing, 4, charImage); - putPointer(backing, 8, internalImage); - backing.putInt(12, isReferenceChar); - } - - public int size() { - return 16; - } - } - - public static class ReadTextReport2 extends DisposedStruct { - public String readString; // The read string. - public CharReport2[] characterReport; // An array of reports describing the - // properties of each identified - // character. - private ByteBuffer readString_buf; - private ByteBuffer characterReport_buf; - - private void init() { - characterReport = new CharReport2[0]; - } - - public ReadTextReport2() { - super(12); - init(); - } - - public ReadTextReport2(String readString, CharReport2[] characterReport) { - super(12); - this.readString = readString; - this.characterReport = characterReport; - } - - protected ReadTextReport2(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ReadTextReport2(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - long readString_addr = getPointer(backing, 0); - if (readString_addr == 0) - readString = null; - else { - ByteBuffer bb = newDirectByteBuffer(readString_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - readString = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - readString = ""; - } - } - - int characterReport_numCharacterReports = backing.getInt(8); - long characterReport_addr = getPointer(backing, 4); - characterReport = new CharReport2[characterReport_numCharacterReports]; - if (characterReport_numCharacterReports > 0 && characterReport_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(characterReport_addr, characterReport_numCharacterReports * 56); - for (int i = 0, off = 0; i < characterReport_numCharacterReports; i++, off += 56) { - characterReport[i] = new CharReport2(bb, off); - characterReport[i].read(); - } - } - } - - public void write() { - if (readString != null) { - byte[] readString_bytes; - try { - readString_bytes = readString.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - readString_bytes = new byte[0]; - } - readString_buf = ByteBuffer.allocateDirect(readString_bytes.length + 1); - putBytes(readString_buf, readString_bytes, 0, readString_bytes.length).put( - readString_bytes.length, (byte) 0); - } - putPointer(backing, 0, readString == null ? 0 : getByteBufferAddress(readString_buf)); - characterReport_buf = - ByteBuffer.allocateDirect(characterReport.length * 56).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < characterReport.length; i++, off += 56) { - characterReport[i].setBuffer(characterReport_buf, off); - characterReport[i].write(); - } - backing.putInt(8, characterReport.length); - putPointer(backing, 4, characterReport_buf); - } - - public int size() { - return 12; - } - } - - public static class EllipseFeature extends DisposedStruct { - public PointFloat position; // The location of the center of the ellipse. - public double rotation; // The orientation of the semi-major axis of the - // ellipse with respect to the horizontal. - public double minorRadius; // The length of the semi-minor axis of the - // ellipse. - public double majorRadius; // The length of the semi-major axis of the - // ellipse. - - private void init() { - position = new PointFloat(backing, 0); - } - - public EllipseFeature() { - super(32); - init(); - } - - public EllipseFeature(PointFloat position, double rotation, double minorRadius, - double majorRadius) { - super(32); - this.position = position; - this.rotation = rotation; - this.minorRadius = minorRadius; - this.majorRadius = majorRadius; - } - - protected EllipseFeature(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected EllipseFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - position.read(); - rotation = backing.getDouble(8); - minorRadius = backing.getDouble(16); - majorRadius = backing.getDouble(24); - } - - public void write() { - position.write(); - backing.putDouble(8, rotation); - backing.putDouble(16, minorRadius); - backing.putDouble(24, majorRadius); - } - - public int size() { - return 32; - } - } - - public static class CircleFeature extends DisposedStruct { - public PointFloat position; // The location of the center of the circle. - public double radius; // The radius of the circle. - - private void init() { - position = new PointFloat(backing, 0); - } - - public CircleFeature() { - super(16); - init(); - } - - public CircleFeature(PointFloat position, double radius) { - super(16); - this.position = position; - this.radius = radius; - } - - protected CircleFeature(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CircleFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - position.read(); - radius = backing.getDouble(8); - } - - public void write() { - position.write(); - backing.putDouble(8, radius); - } - - public int size() { - return 16; - } - } - - public static class ConstCurveFeature extends DisposedStruct { - public PointFloat position; // The center of the circle that this constant - // curve lies upon. - public double radius; // The radius of the circle that this constant curve - // lies upon. - public double startAngle; // When traveling along the constant curve from - // one endpoint to the next in a counterclockwise - // manner, this is the angular component of the - // vector originating at the center of the - // constant curve and pointing towards the first - // endpoint of the constant curve. - public double endAngle; // When traveling along the constant curve from one - // endpoint to the next in a counterclockwise - // manner, this is the angular component of the - // vector originating at the center of the constant - // curve and pointing towards the second endpoint of - // the constant curve. - - private void init() { - position = new PointFloat(backing, 0); - } - - public ConstCurveFeature() { - super(32); - init(); - } - - public ConstCurveFeature(PointFloat position, double radius, double startAngle, double endAngle) { - super(32); - this.position = position; - this.radius = radius; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected ConstCurveFeature(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ConstCurveFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - position.read(); - radius = backing.getDouble(8); - startAngle = backing.getDouble(16); - endAngle = backing.getDouble(24); - } - - public void write() { - position.write(); - backing.putDouble(8, radius); - backing.putDouble(16, startAngle); - backing.putDouble(24, endAngle); - } - - public int size() { - return 32; - } - } - - public static class RectangleFeature extends DisposedStruct { - public PointFloat position; // The center of the rectangle. - public PointFloat[] corner; // The four corners of the rectangle. - public double rotation; // The orientation of the rectangle with respect to - // the horizontal. - public double width; // The width of the rectangle. - public double height; // The height of the rectangle. - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 8; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public RectangleFeature() { - super(64); - init(); - } - - public RectangleFeature(PointFloat position, PointFloat[] corner, double rotation, - double width, double height) { - super(64); - this.position = position; - this.corner = corner; - this.rotation = rotation; - this.width = width; - this.height = height; - } - - protected RectangleFeature(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected RectangleFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - position.read(); - for (PointFloat it : corner) { - it.read(); - } - rotation = backing.getDouble(40); - width = backing.getDouble(48); - height = backing.getDouble(56); - } - - public void write() { - position.write(); - for (PointFloat it : corner) { - it.write(); - } - backing.putDouble(40, rotation); - backing.putDouble(48, width); - backing.putDouble(56, height); - } - - public int size() { - return 64; - } - } - - public static class LegFeature extends DisposedStruct { - public PointFloat position; // The location of the leg feature. - public PointFloat[] corner; // The four corners of the leg feature. - public double rotation; // The orientation of the leg with respect to the - // horizontal. - public double width; // The width of the leg. - public double height; // The height of the leg. - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 8; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public LegFeature() { - super(64); - init(); - } - - public LegFeature(PointFloat position, PointFloat[] corner, double rotation, double width, - double height) { - super(64); - this.position = position; - this.corner = corner; - this.rotation = rotation; - this.width = width; - this.height = height; - } - - protected LegFeature(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected LegFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - position.read(); - for (PointFloat it : corner) { - it.read(); - } - rotation = backing.getDouble(40); - width = backing.getDouble(48); - height = backing.getDouble(56); - } - - public void write() { - position.write(); - for (PointFloat it : corner) { - it.write(); - } - backing.putDouble(40, rotation); - backing.putDouble(48, width); - backing.putDouble(56, height); - } - - public int size() { - return 64; - } - } - - public static class CornerFeature extends DisposedStruct { - public PointFloat position; // The location of the corner feature. - public double rotation; // The angular component of the vector bisecting the - // corner from position. - public double enclosedAngle; // The measure of the enclosed angle of the - // corner. - public int isVirtual; - - private void init() { - position = new PointFloat(backing, 0); - } - - public CornerFeature() { - super(32); - init(); - } - - public CornerFeature(PointFloat position, double rotation, double enclosedAngle, int isVirtual) { - super(32); - this.position = position; - this.rotation = rotation; - this.enclosedAngle = enclosedAngle; - this.isVirtual = isVirtual; - } - - protected CornerFeature(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected CornerFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - position.read(); - rotation = backing.getDouble(8); - enclosedAngle = backing.getDouble(16); - isVirtual = backing.getInt(24); - } - - public void write() { - position.write(); - backing.putDouble(8, rotation); - backing.putDouble(16, enclosedAngle); - backing.putInt(24, isVirtual); - } - - public int size() { - return 32; - } - } - - public static class LineFeature extends DisposedStruct { - public PointFloat startPoint; // The starting point of the line. - public PointFloat endPoint; // The ending point of the line. - public double length; // The length of the line measured in pixels from the - // start point to the end point. - public double rotation; // The orientation of the line with respect to the - // horizontal. - - private void init() { - startPoint = new PointFloat(backing, 0); - endPoint = new PointFloat(backing, 8); - } - - public LineFeature() { - super(32); - init(); - } - - public LineFeature(PointFloat startPoint, PointFloat endPoint, double length, double rotation) { - super(32); - this.startPoint = startPoint; - this.endPoint = endPoint; - this.length = length; - this.rotation = rotation; - } - - protected LineFeature(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected LineFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - startPoint.read(); - endPoint.read(); - length = backing.getDouble(16); - rotation = backing.getDouble(24); - } - - public void write() { - startPoint.write(); - endPoint.write(); - backing.putDouble(16, length); - backing.putDouble(24, rotation); - } - - public int size() { - return 32; - } - } - - public static class ParallelLinePairFeature extends DisposedStruct { - public PointFloat firstStartPoint; // The starting point of the first line - // of the pair. - public PointFloat firstEndPoint; // The ending point of the first line of - // the pair. - public PointFloat secondStartPoint; // The starting point of the second line - // of the pair. - public PointFloat secondEndPoint; // The ending point of the second line of - // the pair. - public double rotation; // The orientation of the feature with respect to - // the horizontal. - public double distance; // The distance from the first line to the second - // line. - - private void init() { - firstStartPoint = new PointFloat(backing, 0); - firstEndPoint = new PointFloat(backing, 8); - secondStartPoint = new PointFloat(backing, 16); - secondEndPoint = new PointFloat(backing, 24); - } - - public ParallelLinePairFeature() { - super(48); - init(); - } - - public ParallelLinePairFeature(PointFloat firstStartPoint, PointFloat firstEndPoint, - PointFloat secondStartPoint, PointFloat secondEndPoint, double rotation, double distance) { - super(48); - this.firstStartPoint = firstStartPoint; - this.firstEndPoint = firstEndPoint; - this.secondStartPoint = secondStartPoint; - this.secondEndPoint = secondEndPoint; - this.rotation = rotation; - this.distance = distance; - } - - protected ParallelLinePairFeature(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected ParallelLinePairFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - firstStartPoint.read(); - firstEndPoint.read(); - secondStartPoint.read(); - secondEndPoint.read(); - rotation = backing.getDouble(32); - distance = backing.getDouble(40); - } - - public void write() { - firstStartPoint.write(); - firstEndPoint.write(); - secondStartPoint.write(); - secondEndPoint.write(); - backing.putDouble(32, rotation); - backing.putDouble(40, distance); - } - - public int size() { - return 48; - } - } - - public static class PairOfParallelLinePairsFeature extends DisposedStruct { - public ParallelLinePairFeature firstParallelLinePair; // The first parallel - // line pair. - public ParallelLinePairFeature secondParallelLinePair; // The second - // parallel line - // pair. - public double rotation; // The orientation of the feature with respect to - // the horizontal. - public double distance; // The distance from the midline of the first - // parallel line pair to the midline of the second - // parallel line pair. - - private void init() { - firstParallelLinePair = new ParallelLinePairFeature(backing, 0); - secondParallelLinePair = new ParallelLinePairFeature(backing, 48); - } - - public PairOfParallelLinePairsFeature() { - super(112); - init(); - } - - public PairOfParallelLinePairsFeature(ParallelLinePairFeature firstParallelLinePair, - ParallelLinePairFeature secondParallelLinePair, double rotation, double distance) { - super(112); - this.firstParallelLinePair = firstParallelLinePair; - this.secondParallelLinePair = secondParallelLinePair; - this.rotation = rotation; - this.distance = distance; - } - - protected PairOfParallelLinePairsFeature(ByteBuffer backing, int offset) { - super(backing, offset, 112); - init(); - } - - protected PairOfParallelLinePairsFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 112); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 112); - } - - public void read() { - firstParallelLinePair.read(); - secondParallelLinePair.read(); - rotation = backing.getDouble(96); - distance = backing.getDouble(104); - } - - public void write() { - firstParallelLinePair.write(); - secondParallelLinePair.write(); - backing.putDouble(96, rotation); - backing.putDouble(104, distance); - } - - public int size() { - return 112; - } - } - - public static class FeatureData extends DisposedStruct { - public FeatureType type; // An enumeration representing the type of the - // feature. - public PointFloat[] contourPoints; // A set of points describing the contour - // of the feature. - public CircleFeature circle; // A pointer to a CircleFeature. - public EllipseFeature ellipse; // A pointer to an EllipseFeature. - public ConstCurveFeature constCurve; // A pointer to a ConstCurveFeature. - public RectangleFeature rectangle; // A pointer to a RectangleFeature. - public LegFeature leg; // A pointer to a LegFeature. - public CornerFeature corner; // A pointer to a CornerFeature. - public ParallelLinePairFeature parallelLinePair; // A pointer to a - // ParallelLinePairFeature. - public PairOfParallelLinePairsFeature pairOfParallelLinePairs; // A pointer - // to a - // PairOfParallelLinePairsFeature. - public LineFeature line; // A pointer to a LineFeature. - public ClosedCurveFeature closedCurve; // A pointer to a ClosedCurveFeature. - private ByteBuffer contourPoints_buf; - - private void init() { - contourPoints = new PointFloat[0]; - } - - public FeatureData() { - super(16); - init(); - } - - public FeatureData(FeatureType type, PointFloat[] contourPoints) { - super(16); - this.type = type; - this.contourPoints = contourPoints; - } - - protected FeatureData(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected FeatureData(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - type = FeatureType.fromValue(backing.getInt(0)); - int contourPoints_numContourPoints = backing.getInt(8); - long contourPoints_addr = getPointer(backing, 4); - contourPoints = new PointFloat[contourPoints_numContourPoints]; - if (contourPoints_numContourPoints > 0 && contourPoints_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(contourPoints_addr, contourPoints_numContourPoints * 8); - for (int i = 0, off = 0; i < contourPoints_numContourPoints; i++, off += 8) { - contourPoints[i] = new PointFloat(bb, off); - contourPoints[i].read(); - } - } - if (type == FeatureType.CIRCLE_FEATURE) { - long circle_addr = getPointer(backing, 12); - if (circle_addr == 0) - circle = null; - else - circle = new CircleFeature(circle_addr, false); - } - if (type == FeatureType.ELLIPSE_FEATURE) { - long ellipse_addr = getPointer(backing, 12); - if (ellipse_addr == 0) - ellipse = null; - else - ellipse = new EllipseFeature(ellipse_addr, false); - } - if (type == FeatureType.CONST_CURVE_FEATURE) { - long constCurve_addr = getPointer(backing, 12); - if (constCurve_addr == 0) - constCurve = null; - else - constCurve = new ConstCurveFeature(constCurve_addr, false); - } - if (type == FeatureType.RECTANGLE_FEATURE) { - long rectangle_addr = getPointer(backing, 12); - if (rectangle_addr == 0) - rectangle = null; - else - rectangle = new RectangleFeature(rectangle_addr, false); - } - if (type == FeatureType.LEG_FEATURE) { - long leg_addr = getPointer(backing, 12); - if (leg_addr == 0) - leg = null; - else - leg = new LegFeature(leg_addr, false); - } - if (type == FeatureType.CORNER_FEATURE) { - long corner_addr = getPointer(backing, 12); - if (corner_addr == 0) - corner = null; - else - corner = new CornerFeature(corner_addr, false); - } - if (type == FeatureType.PARALLEL_LINE_PAIR_FEATURE) { - long parallelLinePair_addr = getPointer(backing, 12); - if (parallelLinePair_addr == 0) - parallelLinePair = null; - else - parallelLinePair = new ParallelLinePairFeature(parallelLinePair_addr, false); - } - if (type == FeatureType.PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE) { - long pairOfParallelLinePairs_addr = getPointer(backing, 12); - if (pairOfParallelLinePairs_addr == 0) - pairOfParallelLinePairs = null; - else - pairOfParallelLinePairs = - new PairOfParallelLinePairsFeature(pairOfParallelLinePairs_addr, false); - } - if (type == FeatureType.LINE_FEATURE) { - long line_addr = getPointer(backing, 12); - if (line_addr == 0) - line = null; - else - line = new LineFeature(line_addr, false); - } - if (type == FeatureType.CLOSED_CURVE_FEATURE) { - long closedCurve_addr = getPointer(backing, 12); - if (closedCurve_addr == 0) - closedCurve = null; - else - closedCurve = new ClosedCurveFeature(closedCurve_addr, false); - } - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - contourPoints_buf = - ByteBuffer.allocateDirect(contourPoints.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < contourPoints.length; i++, off += 8) { - contourPoints[i].setBuffer(contourPoints_buf, off); - contourPoints[i].write(); - } - backing.putInt(8, contourPoints.length); - putPointer(backing, 4, contourPoints_buf); - if (type == FeatureType.CIRCLE_FEATURE) { - putPointer(backing, 12, circle); - } - if (type == FeatureType.ELLIPSE_FEATURE) { - putPointer(backing, 12, ellipse); - } - if (type == FeatureType.CONST_CURVE_FEATURE) { - putPointer(backing, 12, constCurve); - } - if (type == FeatureType.RECTANGLE_FEATURE) { - putPointer(backing, 12, rectangle); - } - if (type == FeatureType.LEG_FEATURE) { - putPointer(backing, 12, leg); - } - if (type == FeatureType.CORNER_FEATURE) { - putPointer(backing, 12, corner); - } - if (type == FeatureType.PARALLEL_LINE_PAIR_FEATURE) { - putPointer(backing, 12, parallelLinePair); - } - if (type == FeatureType.PAIR_OF_PARALLEL_LINE_PAIRS_FEATURE) { - putPointer(backing, 12, pairOfParallelLinePairs); - } - if (type == FeatureType.LINE_FEATURE) { - putPointer(backing, 12, line); - } - if (type == FeatureType.CLOSED_CURVE_FEATURE) { - putPointer(backing, 12, closedCurve); - } - } - - public int size() { - return 16; - } - } - - public static class GeometricPatternMatch2 extends DisposedStruct { - public PointFloat position; // The location of the origin of the template in - // the match. - public float rotation; // The rotation of the match relative to the template - // image, in degrees. - public float scale; // The size of the match relative to the size of the - // template image, expressed as a percentage. - public float score; // The accuracy of the match. - public PointFloat[] corner; // An array of four points describing the - // rectangle surrounding the template image. - public int inverse; // This element is TRUE if the match is an inverse of - // the template image. - public float occlusion; // The percentage of the match that is occluded. - public float templateMatchCurveScore; // The accuracy of the match obtained - // by comparing the template curves to - // the curves in the match region. - public float matchTemplateCurveScore; // The accuracy of the match obtained - // by comparing the curves in the - // match region to the template - // curves. - public float correlationScore; // The accuracy of the match obtained by - // comparing the template image to the match - // region using a correlation metric that - // compares the two regions as a function of - // their pixel values. - public String label; // The label corresponding to this match when the match - // is returned by imaqMatchMultipleGeometricPatterns(). - public FeatureData[] featureData; // The features used in this match. - public PointFloat calibratedPosition; // The location of the origin of the - // template in the match. - public float calibratedRotation; // The rotation of the match relative to - // the template image, in degrees. - public PointFloat[] calibratedCorner; // An array of four points describing - // the rectangle surrounding the - // template image. - private ByteBuffer featureData_buf; - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 20; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - featureData = new FeatureData[0]; - calibratedPosition = new PointFloat(backing, 336); - calibratedCorner = new PointFloat[4]; - - for (int i = 0, off = 348; i < 4; i++, off += 8) - calibratedCorner[i] = new PointFloat(backing, off); - } - - public GeometricPatternMatch2() { - super(380); - init(); - } - - public GeometricPatternMatch2(PointFloat position, double rotation, double scale, double score, - PointFloat[] corner, int inverse, double occlusion, double templateMatchCurveScore, - double matchTemplateCurveScore, double correlationScore, String label, - FeatureData[] featureData, PointFloat calibratedPosition, double calibratedRotation, - PointFloat[] calibratedCorner) { - super(380); - this.position = position; - this.rotation = (float) rotation; - this.scale = (float) scale; - this.score = (float) score; - this.corner = corner; - this.inverse = inverse; - this.occlusion = (float) occlusion; - this.templateMatchCurveScore = (float) templateMatchCurveScore; - this.matchTemplateCurveScore = (float) matchTemplateCurveScore; - this.correlationScore = (float) correlationScore; - this.label = label; - this.featureData = featureData; - this.calibratedPosition = calibratedPosition; - this.calibratedRotation = (float) calibratedRotation; - this.calibratedCorner = calibratedCorner; - } - - protected GeometricPatternMatch2(ByteBuffer backing, int offset) { - super(backing, offset, 380); - init(); - } - - protected GeometricPatternMatch2(long nativeObj, boolean owned) { - super(nativeObj, owned, 380); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 380); - } - - public void read() { - position.read(); - rotation = backing.getFloat(8); - scale = backing.getFloat(12); - score = backing.getFloat(16); - for (PointFloat it : corner) { - it.read(); - } - inverse = backing.getInt(52); - occlusion = backing.getFloat(56); - templateMatchCurveScore = backing.getFloat(60); - matchTemplateCurveScore = backing.getFloat(64); - correlationScore = backing.getFloat(68); - { - byte[] bytes = new byte[256]; - getBytes(backing, bytes, 72, 256); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - label = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - label = ""; - } - } - int featureData_numFeatureData = backing.getInt(332); - long featureData_addr = getPointer(backing, 328); - featureData = new FeatureData[featureData_numFeatureData]; - if (featureData_numFeatureData > 0 && featureData_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(featureData_addr, featureData_numFeatureData * 16); - for (int i = 0, off = 0; i < featureData_numFeatureData; i++, off += 16) { - featureData[i] = new FeatureData(bb, off); - featureData[i].read(); - } - } - calibratedPosition.read(); - calibratedRotation = backing.getFloat(344); - for (PointFloat it : calibratedCorner) { - it.read(); - } - } - - public void write() { - position.write(); - backing.putFloat(8, rotation); - backing.putFloat(12, scale); - backing.putFloat(16, score); - for (PointFloat it : corner) { - it.write(); - } - backing.putInt(52, inverse); - backing.putFloat(56, occlusion); - backing.putFloat(60, templateMatchCurveScore); - backing.putFloat(64, matchTemplateCurveScore); - backing.putFloat(68, correlationScore); - if (label != null) { - byte[] bytes; - try { - bytes = label.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 72, bytes.length); - for (int i = bytes.length; i < 256; i++) - backing.put(i, (byte) 0); // fill with zero - } - featureData_buf = - ByteBuffer.allocateDirect(featureData.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < featureData.length; i++, off += 16) { - featureData[i].setBuffer(featureData_buf, off); - featureData[i].write(); - } - backing.putInt(332, featureData.length); - putPointer(backing, 328, featureData_buf); - calibratedPosition.write(); - backing.putFloat(344, calibratedRotation); - for (PointFloat it : calibratedCorner) { - it.write(); - } - } - - public int size() { - return 380; - } - } - - public static class ClosedCurveFeature extends DisposedStruct { - public PointFloat position; // The center of the closed curve feature. - public double arcLength; // The arc length of the closed curve feature. - - private void init() { - position = new PointFloat(backing, 0); - } - - public ClosedCurveFeature() { - super(16); - init(); - } - - public ClosedCurveFeature(PointFloat position, double arcLength) { - super(16); - this.position = position; - this.arcLength = arcLength; - } - - protected ClosedCurveFeature(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ClosedCurveFeature(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - position.read(); - arcLength = backing.getDouble(8); - } - - public void write() { - position.write(); - backing.putDouble(8, arcLength); - } - - public int size() { - return 16; - } - } - - public static class LineMatch extends DisposedStruct { - public PointFloat startPoint; // The starting point of the matched line. - public PointFloat endPoint; // The ending point of the matched line. - public double length; // The length of the line measured in pixels from the - // start point to the end point. - public double rotation; // The orientation of the matched line. - public double score; // The score of the matched line. - - private void init() { - startPoint = new PointFloat(backing, 0); - endPoint = new PointFloat(backing, 8); - } - - public LineMatch() { - super(40); - init(); - } - - public LineMatch(PointFloat startPoint, PointFloat endPoint, double length, double rotation, - double score) { - super(40); - this.startPoint = startPoint; - this.endPoint = endPoint; - this.length = length; - this.rotation = rotation; - this.score = score; - } - - protected LineMatch(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected LineMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - startPoint.read(); - endPoint.read(); - length = backing.getDouble(16); - rotation = backing.getDouble(24); - score = backing.getDouble(32); - } - - public void write() { - startPoint.write(); - endPoint.write(); - backing.putDouble(16, length); - backing.putDouble(24, rotation); - backing.putDouble(32, score); - } - - public int size() { - return 40; - } - } - - public static class LineDescriptor extends DisposedStruct { - public double minLength; // Specifies the minimum length of a line the - // function will return. - public double maxLength; // Specifies the maximum length of a line the - // function will return. - - private void init() { - - } - - public LineDescriptor() { - super(16); - init(); - } - - public LineDescriptor(double minLength, double maxLength) { - super(16); - this.minLength = minLength; - this.maxLength = maxLength; - } - - protected LineDescriptor(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected LineDescriptor(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - minLength = backing.getDouble(0); - maxLength = backing.getDouble(8); - } - - public void write() { - backing.putDouble(0, minLength); - backing.putDouble(8, maxLength); - } - - public int size() { - return 16; - } - } - - public static class RectangleDescriptor extends DisposedStruct { - public double minWidth; // Specifies the minimum width of a rectangle the - // algorithm will return. - public double maxWidth; // Specifies the maximum width of a rectangle the - // algorithm will return. - public double minHeight; // Specifies the minimum height of a rectangle the - // algorithm will return. - public double maxHeight; // Specifies the maximum height of a rectangle the - // algorithm will return. - - private void init() { - - } - - public RectangleDescriptor() { - super(32); - init(); - } - - public RectangleDescriptor(double minWidth, double maxWidth, double minHeight, double maxHeight) { - super(32); - this.minWidth = minWidth; - this.maxWidth = maxWidth; - this.minHeight = minHeight; - this.maxHeight = maxHeight; - } - - protected RectangleDescriptor(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected RectangleDescriptor(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - minWidth = backing.getDouble(0); - maxWidth = backing.getDouble(8); - minHeight = backing.getDouble(16); - maxHeight = backing.getDouble(24); - } - - public void write() { - backing.putDouble(0, minWidth); - backing.putDouble(8, maxWidth); - backing.putDouble(16, minHeight); - backing.putDouble(24, maxHeight); - } - - public int size() { - return 32; - } - } - - public static class RectangleMatch extends DisposedStruct { - public PointFloat[] corner; // The corners of the matched rectangle. - public double rotation; // The orientation of the matched rectangle. - public double width; // The width of the matched rectangle. - public double height; // The height of the matched rectangle. - public double score; // The score of the matched rectangle. - - private void init() { - corner = new PointFloat[4]; - - for (int i = 0, off = 0; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public RectangleMatch() { - super(64); - init(); - } - - public RectangleMatch(PointFloat[] corner, double rotation, double width, double height, - double score) { - super(64); - this.corner = corner; - this.rotation = rotation; - this.width = width; - this.height = height; - this.score = score; - } - - protected RectangleMatch(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected RectangleMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - for (PointFloat it : corner) { - it.read(); - } - rotation = backing.getDouble(32); - width = backing.getDouble(40); - height = backing.getDouble(48); - score = backing.getDouble(56); - } - - public void write() { - for (PointFloat it : corner) { - it.write(); - } - backing.putDouble(32, rotation); - backing.putDouble(40, width); - backing.putDouble(48, height); - backing.putDouble(56, score); - } - - public int size() { - return 64; - } - } - - public static class EllipseDescriptor extends DisposedStruct { - public double minMajorRadius; // Specifies the minimum length of the - // semi-major axis of an ellipse the function - // will return. - public double maxMajorRadius; // Specifies the maximum length of the - // semi-major axis of an ellipse the function - // will return. - public double minMinorRadius; // Specifies the minimum length of the - // semi-minor axis of an ellipse the function - // will return. - public double maxMinorRadius; // Specifies the maximum length of the - // semi-minor axis of an ellipse the function - // will return. - - private void init() { - - } - - public EllipseDescriptor() { - super(32); - init(); - } - - public EllipseDescriptor(double minMajorRadius, double maxMajorRadius, double minMinorRadius, - double maxMinorRadius) { - super(32); - this.minMajorRadius = minMajorRadius; - this.maxMajorRadius = maxMajorRadius; - this.minMinorRadius = minMinorRadius; - this.maxMinorRadius = maxMinorRadius; - } - - protected EllipseDescriptor(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected EllipseDescriptor(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - minMajorRadius = backing.getDouble(0); - maxMajorRadius = backing.getDouble(8); - minMinorRadius = backing.getDouble(16); - maxMinorRadius = backing.getDouble(24); - } - - public void write() { - backing.putDouble(0, minMajorRadius); - backing.putDouble(8, maxMajorRadius); - backing.putDouble(16, minMinorRadius); - backing.putDouble(24, maxMinorRadius); - } - - public int size() { - return 32; - } - } - - public static class EllipseMatch extends DisposedStruct { - public PointFloat position; // The location of the center of the matched - // ellipse. - public double rotation; // The orientation of the matched ellipse. - public double majorRadius; // The length of the semi-major axis of the - // matched ellipse. - public double minorRadius; // The length of the semi-minor axis of the - // matched ellipse. - public double score; // The score of the matched ellipse. - - private void init() { - position = new PointFloat(backing, 0); - } - - public EllipseMatch() { - super(40); - init(); - } - - public EllipseMatch(PointFloat position, double rotation, double majorRadius, - double minorRadius, double score) { - super(40); - this.position = position; - this.rotation = rotation; - this.majorRadius = majorRadius; - this.minorRadius = minorRadius; - this.score = score; - } - - protected EllipseMatch(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected EllipseMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - position.read(); - rotation = backing.getDouble(8); - majorRadius = backing.getDouble(16); - minorRadius = backing.getDouble(24); - score = backing.getDouble(32); - } - - public void write() { - position.write(); - backing.putDouble(8, rotation); - backing.putDouble(16, majorRadius); - backing.putDouble(24, minorRadius); - backing.putDouble(32, score); - } - - public int size() { - return 40; - } - } - - public static class CircleMatch extends DisposedStruct { - public PointFloat position; // The location of the center of the matched - // circle. - public double radius; // The radius of the matched circle. - public double score; // The score of the matched circle. - - private void init() { - position = new PointFloat(backing, 0); - } - - public CircleMatch() { - super(24); - init(); - } - - public CircleMatch(PointFloat position, double radius, double score) { - super(24); - this.position = position; - this.radius = radius; - this.score = score; - } - - protected CircleMatch(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected CircleMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - position.read(); - radius = backing.getDouble(8); - score = backing.getDouble(16); - } - - public void write() { - position.write(); - backing.putDouble(8, radius); - backing.putDouble(16, score); - } - - public int size() { - return 24; - } - } - - public static class CircleDescriptor extends DisposedStruct { - public double minRadius; // Specifies the minimum radius of a circle the - // function will return. - public double maxRadius; // Specifies the maximum radius of a circle the - // function will return. - - private void init() { - - } - - public CircleDescriptor() { - super(16); - init(); - } - - public CircleDescriptor(double minRadius, double maxRadius) { - super(16); - this.minRadius = minRadius; - this.maxRadius = maxRadius; - } - - protected CircleDescriptor(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CircleDescriptor(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - minRadius = backing.getDouble(0); - maxRadius = backing.getDouble(8); - } - - public void write() { - backing.putDouble(0, minRadius); - backing.putDouble(8, maxRadius); - } - - public int size() { - return 16; - } - } - - public static class ShapeDetectionOptions extends DisposedStruct { - public int mode; // Specifies the method used when looking for the shape in - // the image. - public RangeFloat[] angleRanges; // An array of angle ranges, in degrees, - // where each range specifies how much you - // expect the shape to be rotated in the - // image. - public RangeFloat scaleRange; // A range that specifies the sizes of the - // shapes you expect to be in the image, - // expressed as a ratio percentage - // representing the size of the pattern in the - // image divided by size of the original - // pattern multiplied by 100. - public double minMatchScore; - private ByteBuffer angleRanges_buf; - - private void init() { - angleRanges = new RangeFloat[0]; - scaleRange = new RangeFloat(backing, 12); - } - - public ShapeDetectionOptions() { - super(32); - init(); - } - - public ShapeDetectionOptions(int mode, RangeFloat[] angleRanges, RangeFloat scaleRange, - double minMatchScore) { - super(32); - this.mode = mode; - this.angleRanges = angleRanges; - this.scaleRange = scaleRange; - this.minMatchScore = minMatchScore; - } - - protected ShapeDetectionOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ShapeDetectionOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - mode = backing.getInt(0); - int angleRanges_numAngleRanges = backing.getInt(8); - long angleRanges_addr = getPointer(backing, 4); - angleRanges = new RangeFloat[angleRanges_numAngleRanges]; - if (angleRanges_numAngleRanges > 0 && angleRanges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numAngleRanges * 8); - for (int i = 0, off = 0; i < angleRanges_numAngleRanges; i++, off += 8) { - angleRanges[i] = new RangeFloat(bb, off); - angleRanges[i].read(); - } - } - scaleRange.read(); - minMatchScore = backing.getDouble(24); - } - - public void write() { - backing.putInt(0, mode); - angleRanges_buf = - ByteBuffer.allocateDirect(angleRanges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < angleRanges.length; i++, off += 8) { - angleRanges[i].setBuffer(angleRanges_buf, off); - angleRanges[i].write(); - } - backing.putInt(8, angleRanges.length); - putPointer(backing, 4, angleRanges_buf); - scaleRange.write(); - backing.putDouble(24, minMatchScore); - } - - public int size() { - return 32; - } - } - - public static class Curve extends DisposedStruct { - public PointFloat[] points; // The points on the curve. - public int closed; // This element is TRUE if the curve is closed and FALSE - // if the curve is open. - public double curveLength; // The length of the curve. - public double minEdgeStrength; // The lowest edge strength detected on the - // curve. - public double maxEdgeStrength; // The highest edge strength detected on the - // curve. - public double averageEdgeStrength; // The average of all edge strengths - // detected on the curve. - private ByteBuffer points_buf; - - private void init() { - points = new PointFloat[0]; - } - - public Curve() { - super(48); - init(); - } - - public Curve(PointFloat[] points, int closed, double curveLength, double minEdgeStrength, - double maxEdgeStrength, double averageEdgeStrength) { - super(48); - this.points = points; - this.closed = closed; - this.curveLength = curveLength; - this.minEdgeStrength = minEdgeStrength; - this.maxEdgeStrength = maxEdgeStrength; - this.averageEdgeStrength = averageEdgeStrength; - } - - protected Curve(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected Curve(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - int points_numPoints = backing.getInt(4); - long points_addr = getPointer(backing, 0); - points = new PointFloat[points_numPoints]; - if (points_numPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints * 8); - for (int i = 0, off = 0; i < points_numPoints; i++, off += 8) { - points[i] = new PointFloat(bb, off); - points[i].read(); - } - } - closed = backing.getInt(8); - curveLength = backing.getDouble(16); - minEdgeStrength = backing.getDouble(24); - maxEdgeStrength = backing.getDouble(32); - averageEdgeStrength = backing.getDouble(40); - } - - public void write() { - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(4, points.length); - putPointer(backing, 0, points_buf); - backing.putInt(8, closed); - backing.putDouble(16, curveLength); - backing.putDouble(24, minEdgeStrength); - backing.putDouble(32, maxEdgeStrength); - backing.putDouble(40, averageEdgeStrength); - } - - public int size() { - return 48; - } - } - - public static class CurveOptions extends DisposedStruct { - public ExtractionMode extractionMode; // Specifies the method the function - // uses to identify curves in the - // image. - public int threshold; // Specifies the minimum contrast a seed point must - // have in order to begin a curve. - public EdgeFilterSize filterSize; // Specifies the width of the edge filter - // the function uses to identify curves in - // the image. - public int minLength; // Specifies the length, in pixels, of the smallest - // curve the function will extract. - public int rowStepSize; // Specifies the distance, in the y direction, - // between lines the function inspects for curve - // seed points. - public int columnStepSize; // Specifies the distance, in the x direction, - // between columns the function inspects for - // curve seed points. - public int maxEndPointGap; // Specifies the maximum gap, in pixels, between - // the endpoints of a curve that the function - // identifies as a closed curve. - public int onlyClosed; // Set this element to TRUE to specify that the - // function should only identify closed curves in the - // image. - public int subpixelAccuracy; // Set this element to TRUE to specify that the - // function identifies the location of curves - // with subpixel accuracy by interpolating - // between points to find the crossing of - // threshold. - - private void init() { - - } - - public CurveOptions() { - super(36); - init(); - } - - public CurveOptions(ExtractionMode extractionMode, int threshold, EdgeFilterSize filterSize, - int minLength, int rowStepSize, int columnStepSize, int maxEndPointGap, int onlyClosed, - int subpixelAccuracy) { - super(36); - this.extractionMode = extractionMode; - this.threshold = threshold; - this.filterSize = filterSize; - this.minLength = minLength; - this.rowStepSize = rowStepSize; - this.columnStepSize = columnStepSize; - this.maxEndPointGap = maxEndPointGap; - this.onlyClosed = onlyClosed; - this.subpixelAccuracy = subpixelAccuracy; - } - - protected CurveOptions(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected CurveOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - extractionMode = ExtractionMode.fromValue(backing.getInt(0)); - threshold = backing.getInt(4); - filterSize = EdgeFilterSize.fromValue(backing.getInt(8)); - minLength = backing.getInt(12); - rowStepSize = backing.getInt(16); - columnStepSize = backing.getInt(20); - maxEndPointGap = backing.getInt(24); - onlyClosed = backing.getInt(28); - subpixelAccuracy = backing.getInt(32); - } - - public void write() { - if (extractionMode != null) - backing.putInt(0, extractionMode.getValue()); - backing.putInt(4, threshold); - if (filterSize != null) - backing.putInt(8, filterSize.getValue()); - backing.putInt(12, minLength); - backing.putInt(16, rowStepSize); - backing.putInt(20, columnStepSize); - backing.putInt(24, maxEndPointGap); - backing.putInt(28, onlyClosed); - backing.putInt(32, subpixelAccuracy); - } - - public int size() { - return 36; - } - } - - public static class Barcode2DInfo extends DisposedStruct { - public Barcode2DType type; // The type of the 2D barcode. - public int binary; // This element is TRUE if the 2D barcode contains binary - // data and FALSE if the 2D barcode contains text data. - public byte[] data; // The data encoded in the 2D barcode. - public PointFloat[] boundingBox; // An array of four points describing the - // rectangle surrounding the 2D barcode. - public int numErrorsCorrected; // The number of errors the function - // corrected when decoding the 2D barcode. - public int numErasuresCorrected; // The number of erasures the function - // corrected when decoding the 2D barcode. - public int rows; // The number of rows in the 2D barcode. - public int columns; // The number of columns in the 2D barcode. - private ByteBuffer data_buf; - - private void init() { - data = new byte[0]; - boundingBox = new PointFloat[4]; - - for (int i = 0, off = 16; i < 4; i++, off += 8) - boundingBox[i] = new PointFloat(backing, off); - } - - public Barcode2DInfo() { - super(64); - init(); - } - - public Barcode2DInfo(Barcode2DType type, int binary, byte[] data, PointFloat[] boundingBox, - int numErrorsCorrected, int numErasuresCorrected, int rows, int columns) { - super(64); - this.type = type; - this.binary = binary; - this.data = data; - this.boundingBox = boundingBox; - this.numErrorsCorrected = numErrorsCorrected; - this.numErasuresCorrected = numErasuresCorrected; - this.rows = rows; - this.columns = columns; - } - - protected Barcode2DInfo(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected Barcode2DInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - type = Barcode2DType.fromValue(backing.getInt(0)); - binary = backing.getInt(4); - int data_dataLength = backing.getInt(12); - long data_addr = getPointer(backing, 8); - data = new byte[data_dataLength]; - if (data_dataLength > 0 && data_addr != 0) { - getBytes(newDirectByteBuffer(data_addr, data_dataLength), data, 0, data_dataLength); - } - for (PointFloat it : boundingBox) { - it.read(); - } - numErrorsCorrected = backing.getInt(48); - numErasuresCorrected = backing.getInt(52); - rows = backing.getInt(56); - columns = backing.getInt(60); - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - backing.putInt(4, binary); - data_buf = ByteBuffer.allocateDirect(data.length); - putBytes(data_buf, data, 0, data.length); - backing.putInt(12, data.length); - putPointer(backing, 8, data_buf); - for (PointFloat it : boundingBox) { - it.write(); - } - backing.putInt(48, numErrorsCorrected); - backing.putInt(52, numErasuresCorrected); - backing.putInt(56, rows); - backing.putInt(60, columns); - } - - public int size() { - return 64; - } - } - - public static class DataMatrixOptions extends DisposedStruct { - public Barcode2DSearchMode searchMode; // Specifies the mode the function - // uses to search for barcodes. - public Barcode2DContrast contrast; // Specifies the contrast of the barcodes - // that the function searches for. - public Barcode2DCellShape cellShape; // Specifies the shape of the barcode - // data cells, which affects how the - // function decodes the barcode. - public Barcode2DShape barcodeShape; // Specifies the shape of the barcodes - // that the function searches for. - public DataMatrixSubtype subtype; // Specifies the Data Matrix subtypes of - // the barcodes that the function searches - // for. - - private void init() { - - } - - public DataMatrixOptions() { - super(20); - init(); - } - - public DataMatrixOptions(Barcode2DSearchMode searchMode, Barcode2DContrast contrast, - Barcode2DCellShape cellShape, Barcode2DShape barcodeShape, DataMatrixSubtype subtype) { - super(20); - this.searchMode = searchMode; - this.contrast = contrast; - this.cellShape = cellShape; - this.barcodeShape = barcodeShape; - this.subtype = subtype; - } - - protected DataMatrixOptions(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected DataMatrixOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - searchMode = Barcode2DSearchMode.fromValue(backing.getInt(0)); - contrast = Barcode2DContrast.fromValue(backing.getInt(4)); - cellShape = Barcode2DCellShape.fromValue(backing.getInt(8)); - barcodeShape = Barcode2DShape.fromValue(backing.getInt(12)); - subtype = DataMatrixSubtype.fromValue(backing.getInt(16)); - } - - public void write() { - if (searchMode != null) - backing.putInt(0, searchMode.getValue()); - if (contrast != null) - backing.putInt(4, contrast.getValue()); - if (cellShape != null) - backing.putInt(8, cellShape.getValue()); - if (barcodeShape != null) - backing.putInt(12, barcodeShape.getValue()); - if (subtype != null) - backing.putInt(16, subtype.getValue()); - } - - public int size() { - return 20; - } - } - - public static class ClassifierAccuracyReport extends DisposedStruct { - public float accuracy; // The overall accuracy of the classifier, from 0 to - // 1000. - public String[] classNames; // The names of the classes of this classifier. - public double[] classAccuracy; // An array of size elements that contains - // accuracy information for each class. - public double[] classPredictiveValue; // An array containing size elements - // that contains the predictive values - // of each class. - private ByteBuffer classNames_buf; - private ByteBuffer[] classNames_bufs; - private ByteBuffer classAccuracy_buf; - private ByteBuffer classPredictiveValue_buf; - - private void init() { - classNames = new String[0]; - classAccuracy = new double[0]; - classPredictiveValue = new double[0]; - } - - public ClassifierAccuracyReport() { - super(24); - init(); - } - - public ClassifierAccuracyReport(double accuracy, String[] classNames, double[] classAccuracy, - double[] classPredictiveValue) { - super(24); - this.accuracy = (float) accuracy; - this.classNames = classNames; - this.classAccuracy = classAccuracy; - this.classPredictiveValue = classPredictiveValue; - } - - protected ClassifierAccuracyReport(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ClassifierAccuracyReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - accuracy = backing.getFloat(4); - int classNames_size = backing.getInt(0); - long classNames_addr = getPointer(backing, 8); - classNames = new String[classNames_size]; - if (classNames_size > 0 && classNames_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(classNames_addr, classNames_size * 4); - for (int i = 0, off = 0; i < classNames_size; i++, off += 4) { - long addr = getPointer(bb, off); - if (addr == 0) - classNames[i] = null; - else { - ByteBuffer bb2 = newDirectByteBuffer(addr, 1000); // FIXME - while (bb2.get() != 0) { - } - byte[] bytes = new byte[bb2.position() - 1]; - bb2.rewind(); - getBytes(bb2, bytes, 0, bytes.length); - try { - classNames[i] = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - classNames[i] = ""; - } - } - } - } - int classAccuracy_size = backing.getInt(0); - long classAccuracy_addr = getPointer(backing, 12); - classAccuracy = new double[classAccuracy_size]; - if (classAccuracy_size > 0 && classAccuracy_addr != 0) { - newDirectByteBuffer(classAccuracy_addr, classAccuracy_size * 8).asDoubleBuffer().get( - classAccuracy); - } - int classPredictiveValue_size = backing.getInt(0); - long classPredictiveValue_addr = getPointer(backing, 16); - classPredictiveValue = new double[classPredictiveValue_size]; - if (classPredictiveValue_size > 0 && classPredictiveValue_addr != 0) { - newDirectByteBuffer(classPredictiveValue_addr, classPredictiveValue_size * 8) - .asDoubleBuffer().get(classPredictiveValue); - } - } - - public void write() { - backing.putFloat(4, accuracy); - classNames_buf = - ByteBuffer.allocateDirect(classNames.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < classNames.length; i++, off += 4) { - if (classNames[i] == null) - putPointer(classNames_buf, off, 0); - else { - byte[] bytes; - try { - bytes = classNames[i].getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - classNames_bufs[i] = ByteBuffer.allocateDirect(bytes.length + 1); - putBytes(classNames_bufs[i], bytes, 0, bytes.length).put(bytes.length, (byte) 0); - putPointer(classNames_buf, off, getByteBufferAddress(classNames_bufs[i])); - } - } - backing.putInt(0, classNames.length); - putPointer(backing, 8, classNames_buf); - classAccuracy_buf = - ByteBuffer.allocateDirect(classAccuracy.length * 8).order(ByteOrder.nativeOrder()); - classAccuracy_buf.asDoubleBuffer().put(classAccuracy).rewind(); - backing.putInt(0, classAccuracy.length); - putPointer(backing, 12, classAccuracy_buf); - classPredictiveValue_buf = - ByteBuffer.allocateDirect(classPredictiveValue.length * 8).order(ByteOrder.nativeOrder()); - classPredictiveValue_buf.asDoubleBuffer().put(classPredictiveValue).rewind(); - backing.putInt(0, classPredictiveValue.length); - putPointer(backing, 16, classPredictiveValue_buf); - } - - public int size() { - return 24; - } - } - - public static class NearestNeighborClassResult extends DisposedStruct { - public String className; // The name of the class. - public float standardDeviation; // The standard deviation of the members of - // this class. - public int count; // The number of samples in this class. - private ByteBuffer className_buf; - - private void init() { - - } - - public NearestNeighborClassResult() { - super(12); - init(); - } - - public NearestNeighborClassResult(String className, double standardDeviation, int count) { - super(12); - this.className = className; - this.standardDeviation = (float) standardDeviation; - this.count = count; - } - - protected NearestNeighborClassResult(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected NearestNeighborClassResult(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - long className_addr = getPointer(backing, 0); - if (className_addr == 0) - className = null; - else { - ByteBuffer bb = newDirectByteBuffer(className_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - className = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - className = ""; - } - } - - standardDeviation = backing.getFloat(4); - count = backing.getInt(8); - } - - public void write() { - if (className != null) { - byte[] className_bytes; - try { - className_bytes = className.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - className_bytes = new byte[0]; - } - className_buf = ByteBuffer.allocateDirect(className_bytes.length + 1); - putBytes(className_buf, className_bytes, 0, className_bytes.length).put( - className_bytes.length, (byte) 0); - } - putPointer(backing, 0, className == null ? 0 : getByteBufferAddress(className_buf)); - backing.putFloat(4, standardDeviation); - backing.putInt(8, count); - } - - public int size() { - return 12; - } - } - - public static class NearestNeighborTrainingReport extends DisposedStruct { - public NearestNeighborClassResult[] allScores; // All classes and their - // scores. - private ByteBuffer allScores_buf; - - private void init() { - allScores = new NearestNeighborClassResult[0]; - } - - public NearestNeighborTrainingReport() { - super(12); - init(); - } - - public NearestNeighborTrainingReport(NearestNeighborClassResult[] allScores) { - super(12); - this.allScores = allScores; - } - - protected NearestNeighborTrainingReport(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected NearestNeighborTrainingReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - int allScores_allScoresSize = backing.getInt(8); - long allScores_addr = getPointer(backing, 4); - allScores = new NearestNeighborClassResult[allScores_allScoresSize]; - if (allScores_allScoresSize > 0 && allScores_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allScores_addr, allScores_allScoresSize * 12); - for (int i = 0, off = 0; i < allScores_allScoresSize; i++, off += 12) { - allScores[i] = new NearestNeighborClassResult(bb, off); - allScores[i].read(); - } - } - } - - public void write() { - allScores_buf = - ByteBuffer.allocateDirect(allScores.length * 12).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allScores.length; i++, off += 12) { - allScores[i].setBuffer(allScores_buf, off); - allScores[i].write(); - } - backing.putInt(8, allScores.length); - putPointer(backing, 4, allScores_buf); - } - - public int size() { - return 12; - } - } - - public static class ParticleClassifierPreprocessingOptions extends DisposedStruct { - public int manualThreshold; // Set this element to TRUE to specify the - // threshold range manually. - public RangeFloat manualThresholdRange; // If a manual threshold is being - // done, the range of pixels to - // keep. - public ThresholdMethod autoThresholdMethod; // If an automatic threshold is - // being done, the method used - // to calculate the threshold - // range. - public RangeFloat limits; // The limits on the automatic threshold range. - public ParticleType particleType; // Specifies what kind of particles to - // look for. - public int rejectBorder; // Set this element to TRUE to reject border - // particles. - public int numErosions; // The number of erosions to perform. - - private void init() { - manualThresholdRange = new RangeFloat(backing, 4); - limits = new RangeFloat(backing, 16); - } - - public ParticleClassifierPreprocessingOptions() { - super(36); - init(); - } - - public ParticleClassifierPreprocessingOptions(int manualThreshold, - RangeFloat manualThresholdRange, ThresholdMethod autoThresholdMethod, RangeFloat limits, - ParticleType particleType, int rejectBorder, int numErosions) { - super(36); - this.manualThreshold = manualThreshold; - this.manualThresholdRange = manualThresholdRange; - this.autoThresholdMethod = autoThresholdMethod; - this.limits = limits; - this.particleType = particleType; - this.rejectBorder = rejectBorder; - this.numErosions = numErosions; - } - - protected ParticleClassifierPreprocessingOptions(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected ParticleClassifierPreprocessingOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - manualThreshold = backing.getInt(0); - manualThresholdRange.read(); - autoThresholdMethod = ThresholdMethod.fromValue(backing.getInt(12)); - limits.read(); - particleType = ParticleType.fromValue(backing.getInt(24)); - rejectBorder = backing.getInt(28); - numErosions = backing.getInt(32); - } - - public void write() { - backing.putInt(0, manualThreshold); - manualThresholdRange.write(); - if (autoThresholdMethod != null) - backing.putInt(12, autoThresholdMethod.getValue()); - limits.write(); - if (particleType != null) - backing.putInt(24, particleType.getValue()); - backing.putInt(28, rejectBorder); - backing.putInt(32, numErosions); - } - - public int size() { - return 36; - } - } - - public static class ClassifierSampleInfo extends DisposedStruct { - public String className; // The name of the class this sample is in. - public double[] featureVector; // The feature vector of this sample, or NULL - // if this is not a custom classifier - // session. - public Image thumbnail; // A thumbnail image of this sample, or NULL if no - // image was specified. - private ByteBuffer className_buf; - private ByteBuffer featureVector_buf; - - private void init() { - featureVector = new double[0]; - } - - public ClassifierSampleInfo() { - super(16); - init(); - } - - public ClassifierSampleInfo(String className, double[] featureVector, Image thumbnail) { - super(16); - this.className = className; - this.featureVector = featureVector; - this.thumbnail = thumbnail; - } - - protected ClassifierSampleInfo(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ClassifierSampleInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - long className_addr = getPointer(backing, 0); - if (className_addr == 0) - className = null; - else { - ByteBuffer bb = newDirectByteBuffer(className_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - className = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - className = ""; - } - } - - int featureVector_featureVectorSize = backing.getInt(8); - long featureVector_addr = getPointer(backing, 4); - featureVector = new double[featureVector_featureVectorSize]; - if (featureVector_featureVectorSize > 0 && featureVector_addr != 0) { - newDirectByteBuffer(featureVector_addr, featureVector_featureVectorSize * 8) - .asDoubleBuffer().get(featureVector); - } - long thumbnail_addr = getPointer(backing, 12); - if (thumbnail_addr == 0) - thumbnail = null; - else - thumbnail = new Image(thumbnail_addr, false); - } - - public void write() { - if (className != null) { - byte[] className_bytes; - try { - className_bytes = className.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - className_bytes = new byte[0]; - } - className_buf = ByteBuffer.allocateDirect(className_bytes.length + 1); - putBytes(className_buf, className_bytes, 0, className_bytes.length).put( - className_bytes.length, (byte) 0); - } - putPointer(backing, 0, className == null ? 0 : getByteBufferAddress(className_buf)); - featureVector_buf = - ByteBuffer.allocateDirect(featureVector.length * 8).order(ByteOrder.nativeOrder()); - featureVector_buf.asDoubleBuffer().put(featureVector).rewind(); - backing.putInt(8, featureVector.length); - putPointer(backing, 4, featureVector_buf); - putPointer(backing, 12, thumbnail); - } - - public int size() { - return 16; - } - } - - public static class ClassScore extends DisposedStruct { - public String className; // The name of the class. - public float distance; // The distance from the item to this class. - private ByteBuffer className_buf; - - private void init() { - - } - - public ClassScore() { - super(8); - init(); - } - - public ClassScore(String className, double distance) { - super(8); - this.className = className; - this.distance = (float) distance; - } - - protected ClassScore(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ClassScore(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - long className_addr = getPointer(backing, 0); - if (className_addr == 0) - className = null; - else { - ByteBuffer bb = newDirectByteBuffer(className_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - className = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - className = ""; - } - } - - distance = backing.getFloat(4); - } - - public void write() { - if (className != null) { - byte[] className_bytes; - try { - className_bytes = className.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - className_bytes = new byte[0]; - } - className_buf = ByteBuffer.allocateDirect(className_bytes.length + 1); - putBytes(className_buf, className_bytes, 0, className_bytes.length).put( - className_bytes.length, (byte) 0); - } - putPointer(backing, 0, className == null ? 0 : getByteBufferAddress(className_buf)); - backing.putFloat(4, distance); - } - - public int size() { - return 8; - } - } - - public static class ClassifierReport extends DisposedStruct { - public String bestClassName; // The name of the best class for the sample. - public float classificationScore; // The similarity of the sample and the - // two closest classes in the classifier. - public float identificationScore; // The similarity of the sample and the - // assigned class. - public ClassScore[] allScores; // All classes and their scores. - private ByteBuffer bestClassName_buf; - private ByteBuffer allScores_buf; - - private void init() { - allScores = new ClassScore[0]; - } - - public ClassifierReport() { - super(20); - init(); - } - - public ClassifierReport(String bestClassName, double classificationScore, - double identificationScore, ClassScore[] allScores) { - super(20); - this.bestClassName = bestClassName; - this.classificationScore = (float) classificationScore; - this.identificationScore = (float) identificationScore; - this.allScores = allScores; - } - - protected ClassifierReport(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected ClassifierReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - long bestClassName_addr = getPointer(backing, 0); - if (bestClassName_addr == 0) - bestClassName = null; - else { - ByteBuffer bb = newDirectByteBuffer(bestClassName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - bestClassName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - bestClassName = ""; - } - } - - classificationScore = backing.getFloat(4); - identificationScore = backing.getFloat(8); - int allScores_allScoresSize = backing.getInt(16); - long allScores_addr = getPointer(backing, 12); - allScores = new ClassScore[allScores_allScoresSize]; - if (allScores_allScoresSize > 0 && allScores_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allScores_addr, allScores_allScoresSize * 8); - for (int i = 0, off = 0; i < allScores_allScoresSize; i++, off += 8) { - allScores[i] = new ClassScore(bb, off); - allScores[i].read(); - } - } - } - - public void write() { - if (bestClassName != null) { - byte[] bestClassName_bytes; - try { - bestClassName_bytes = bestClassName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bestClassName_bytes = new byte[0]; - } - bestClassName_buf = ByteBuffer.allocateDirect(bestClassName_bytes.length + 1); - putBytes(bestClassName_buf, bestClassName_bytes, 0, bestClassName_bytes.length).put( - bestClassName_bytes.length, (byte) 0); - } - putPointer(backing, 0, bestClassName == null ? 0 : getByteBufferAddress(bestClassName_buf)); - backing.putFloat(4, classificationScore); - backing.putFloat(8, identificationScore); - allScores_buf = - ByteBuffer.allocateDirect(allScores.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allScores.length; i++, off += 8) { - allScores[i].setBuffer(allScores_buf, off); - allScores[i].write(); - } - backing.putInt(16, allScores.length); - putPointer(backing, 12, allScores_buf); - } - - public int size() { - return 20; - } - } - - public static class NearestNeighborOptions extends DisposedStruct { - public NearestNeighborMethod method; // The method to use. - public NearestNeighborMetric metric; // The metric to use. - public int k; // The value of k, if the IMAQ_K_NEAREST_NEIGHBOR method is - // used. - - private void init() { - - } - - public NearestNeighborOptions() { - super(12); - init(); - } - - public NearestNeighborOptions(NearestNeighborMethod method, NearestNeighborMetric metric, int k) { - super(12); - this.method = method; - this.metric = metric; - this.k = k; - } - - protected NearestNeighborOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected NearestNeighborOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - method = NearestNeighborMethod.fromValue(backing.getInt(0)); - metric = NearestNeighborMetric.fromValue(backing.getInt(4)); - k = backing.getInt(8); - } - - public void write() { - if (method != null) - backing.putInt(0, method.getValue()); - if (metric != null) - backing.putInt(4, metric.getValue()); - backing.putInt(8, k); - } - - public int size() { - return 12; - } - } - - public static class ParticleClassifierOptions extends DisposedStruct { - public float scaleDependence; // The relative importance of scale when - // classifying particles. - public float mirrorDependence; // The relative importance of mirror symmetry - // when classifying particles. - - private void init() { - - } - - public ParticleClassifierOptions() { - super(8); - init(); - } - - public ParticleClassifierOptions(double scaleDependence, double mirrorDependence) { - super(8); - this.scaleDependence = (float) scaleDependence; - this.mirrorDependence = (float) mirrorDependence; - } - - protected ParticleClassifierOptions(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ParticleClassifierOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - scaleDependence = backing.getFloat(0); - mirrorDependence = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, scaleDependence); - backing.putFloat(4, mirrorDependence); - } - - public int size() { - return 8; - } - } - - public static class RGBU64Value extends DisposedStruct { - public int B; // The blue value of the color. - public int G; // The green value of the color. - public int R; // The red value of the color. - public int alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public RGBU64Value() { - super(8); - init(); - } - - public RGBU64Value(int B, int G, int R, int alpha) { - super(8); - this.B = B; - this.G = G; - this.R = R; - this.alpha = alpha; - } - - protected RGBU64Value(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected RGBU64Value(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - B = (int) (backing.getShort(0) & 0xffff); - G = (int) (backing.getShort(2) & 0xffff); - R = (int) (backing.getShort(4) & 0xffff); - alpha = (int) (backing.getShort(6) & 0xffff); - } - - public void write() { - backing.putShort(0, (short) (B & 0xffff)); - backing.putShort(2, (short) (G & 0xffff)); - backing.putShort(4, (short) (R & 0xffff)); - backing.putShort(6, (short) (alpha & 0xffff)); - } - - public int size() { - return 8; - } - } - - public static class GeometricPatternMatch extends DisposedStruct { - public PointFloat position; // The location of the origin of the template in - // the match. - public float rotation; // The rotation of the match relative to the template - // image, in degrees. - public float scale; // The size of the match relative to the size of the - // template image, expressed as a percentage. - public float score; // The accuracy of the match. - public PointFloat[] corner; // An array of four points describing the - // rectangle surrounding the template image. - public int inverse; // This element is TRUE if the match is an inverse of - // the template image. - public float occlusion; // The percentage of the match that is occluded. - public float templateMatchCurveScore; // The accuracy of the match obtained - // by comparing the template curves to - // the curves in the match region. - public float matchTemplateCurveScore; // The accuracy of the match obtained - // by comparing the curves in the - // match region to the template - // curves. - public float correlationScore; // The accuracy of the match obtained by - // comparing the template image to the match - // region using a correlation metric that - // compares the two regions as a function of - // their pixel values. - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 20; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public GeometricPatternMatch() { - super(72); - init(); - } - - public GeometricPatternMatch(PointFloat position, double rotation, double scale, double score, - PointFloat[] corner, int inverse, double occlusion, double templateMatchCurveScore, - double matchTemplateCurveScore, double correlationScore) { - super(72); - this.position = position; - this.rotation = (float) rotation; - this.scale = (float) scale; - this.score = (float) score; - this.corner = corner; - this.inverse = inverse; - this.occlusion = (float) occlusion; - this.templateMatchCurveScore = (float) templateMatchCurveScore; - this.matchTemplateCurveScore = (float) matchTemplateCurveScore; - this.correlationScore = (float) correlationScore; - } - - protected GeometricPatternMatch(ByteBuffer backing, int offset) { - super(backing, offset, 72); - init(); - } - - protected GeometricPatternMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 72); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 72); - } - - public void read() { - position.read(); - rotation = backing.getFloat(8); - scale = backing.getFloat(12); - score = backing.getFloat(16); - for (PointFloat it : corner) { - it.read(); - } - inverse = backing.getInt(52); - occlusion = backing.getFloat(56); - templateMatchCurveScore = backing.getFloat(60); - matchTemplateCurveScore = backing.getFloat(64); - correlationScore = backing.getFloat(68); - } - - public void write() { - position.write(); - backing.putFloat(8, rotation); - backing.putFloat(12, scale); - backing.putFloat(16, score); - for (PointFloat it : corner) { - it.write(); - } - backing.putInt(52, inverse); - backing.putFloat(56, occlusion); - backing.putFloat(60, templateMatchCurveScore); - backing.putFloat(64, matchTemplateCurveScore); - backing.putFloat(68, correlationScore); - } - - public int size() { - return 72; - } - } - - public static class MatchGeometricPatternAdvancedOptions extends DisposedStruct { - public int minFeaturesUsed; // Specifies the minimum number of features the - // function uses when matching. - public int maxFeaturesUsed; // Specifies the maximum number of features the - // function uses when matching. - public int subpixelIterations; // Specifies the maximum number of - // incremental improvements used to refine - // matches with subpixel information. - public double subpixelTolerance; // Specifies the maximum amount of change, - // in pixels, between consecutive - // incremental improvements in the match - // position before the function stops - // refining the match position. - public int initialMatchListLength; // Specifies the maximum size of the - // match list. - public int matchTemplateCurveScore; // Set this element to TRUE to specify - // that the function should calculate - // the match curve to template curve - // score and return it for each match - // result. - public int correlationScore; // Set this element to TRUE to specify that the - // function should calculate the correlation - // score and return it for each match result. - public double minMatchSeparationDistance; // Specifies the minimum - // separation distance, in pixels, - // between the origins of two - // matches that have unique - // positions. - public double minMatchSeparationAngle; // Specifies the minimum angular - // difference, in degrees, between - // two matches that have unique - // angles. - public double minMatchSeparationScale; // Specifies the minimum difference - // in scale, expressed as a - // percentage, between two matches - // that have unique scales. - public double maxMatchOverlap; // Specifies the maximum amount of overlap, - // expressed as a percentage, allowed between - // the bounding rectangles of two unique - // matches. - public int coarseResult; // Specifies whether you want the function to spend - // less time accurately estimating the location of - // a match. - - private void init() { - - } - - public MatchGeometricPatternAdvancedOptions() { - super(80); - init(); - } - - public MatchGeometricPatternAdvancedOptions(int minFeaturesUsed, int maxFeaturesUsed, - int subpixelIterations, double subpixelTolerance, int initialMatchListLength, - int matchTemplateCurveScore, int correlationScore, double minMatchSeparationDistance, - double minMatchSeparationAngle, double minMatchSeparationScale, double maxMatchOverlap, - int coarseResult) { - super(80); - this.minFeaturesUsed = minFeaturesUsed; - this.maxFeaturesUsed = maxFeaturesUsed; - this.subpixelIterations = subpixelIterations; - this.subpixelTolerance = subpixelTolerance; - this.initialMatchListLength = initialMatchListLength; - this.matchTemplateCurveScore = matchTemplateCurveScore; - this.correlationScore = correlationScore; - this.minMatchSeparationDistance = minMatchSeparationDistance; - this.minMatchSeparationAngle = minMatchSeparationAngle; - this.minMatchSeparationScale = minMatchSeparationScale; - this.maxMatchOverlap = maxMatchOverlap; - this.coarseResult = coarseResult; - } - - protected MatchGeometricPatternAdvancedOptions(ByteBuffer backing, int offset) { - super(backing, offset, 80); - init(); - } - - protected MatchGeometricPatternAdvancedOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 80); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 80); - } - - public void read() { - minFeaturesUsed = backing.getInt(0); - maxFeaturesUsed = backing.getInt(4); - subpixelIterations = backing.getInt(8); - subpixelTolerance = backing.getDouble(16); - initialMatchListLength = backing.getInt(24); - matchTemplateCurveScore = backing.getInt(28); - correlationScore = backing.getInt(32); - minMatchSeparationDistance = backing.getDouble(40); - minMatchSeparationAngle = backing.getDouble(48); - minMatchSeparationScale = backing.getDouble(56); - maxMatchOverlap = backing.getDouble(64); - coarseResult = backing.getInt(72); - } - - public void write() { - backing.putInt(0, minFeaturesUsed); - backing.putInt(4, maxFeaturesUsed); - backing.putInt(8, subpixelIterations); - backing.putDouble(16, subpixelTolerance); - backing.putInt(24, initialMatchListLength); - backing.putInt(28, matchTemplateCurveScore); - backing.putInt(32, correlationScore); - backing.putDouble(40, minMatchSeparationDistance); - backing.putDouble(48, minMatchSeparationAngle); - backing.putDouble(56, minMatchSeparationScale); - backing.putDouble(64, maxMatchOverlap); - backing.putInt(72, coarseResult); - } - - public int size() { - return 80; - } - } - - public static class MatchGeometricPatternOptions extends DisposedStruct { - public int mode; // Specifies the method imaqMatchGeometricPattern() uses - // when looking for the pattern in the image. - public int subpixelAccuracy; // Set this element to TRUE to specify that the - // function should calculate match locations - // with subpixel accuracy. - public RangeFloat[] angleRanges; // An array of angle ranges, in degrees, - // where each range specifies how much you - // expect the template to be rotated in the - // image. - public RangeFloat scaleRange; // A range that specifies the sizes of the - // pattern you expect to be in the image, - // expressed as a ratio percentage - // representing the size of the pattern in the - // image divided by size of the original - // pattern multiplied by 100. - public RangeFloat occlusionRange; // A range that specifies the percentage - // of the pattern you expect to be - // occluded in the image. - public int numMatchesRequested; // Number of valid matches expected. - public float minMatchScore; // The minimum score a match can have for the - // function to consider the match valid. - private ByteBuffer angleRanges_buf; - - private void init() { - angleRanges = new RangeFloat[0]; - scaleRange = new RangeFloat(backing, 16); - occlusionRange = new RangeFloat(backing, 24); - } - - public MatchGeometricPatternOptions() { - super(40); - init(); - } - - public MatchGeometricPatternOptions(int mode, int subpixelAccuracy, RangeFloat[] angleRanges, - RangeFloat scaleRange, RangeFloat occlusionRange, int numMatchesRequested, - double minMatchScore) { - super(40); - this.mode = mode; - this.subpixelAccuracy = subpixelAccuracy; - this.angleRanges = angleRanges; - this.scaleRange = scaleRange; - this.occlusionRange = occlusionRange; - this.numMatchesRequested = numMatchesRequested; - this.minMatchScore = (float) minMatchScore; - } - - protected MatchGeometricPatternOptions(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected MatchGeometricPatternOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - mode = backing.getInt(0); - subpixelAccuracy = backing.getInt(4); - int angleRanges_numAngleRanges = backing.getInt(12); - long angleRanges_addr = getPointer(backing, 8); - angleRanges = new RangeFloat[angleRanges_numAngleRanges]; - if (angleRanges_numAngleRanges > 0 && angleRanges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numAngleRanges * 8); - for (int i = 0, off = 0; i < angleRanges_numAngleRanges; i++, off += 8) { - angleRanges[i] = new RangeFloat(bb, off); - angleRanges[i].read(); - } - } - scaleRange.read(); - occlusionRange.read(); - numMatchesRequested = backing.getInt(32); - minMatchScore = backing.getFloat(36); - } - - public void write() { - backing.putInt(0, mode); - backing.putInt(4, subpixelAccuracy); - angleRanges_buf = - ByteBuffer.allocateDirect(angleRanges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < angleRanges.length; i++, off += 8) { - angleRanges[i].setBuffer(angleRanges_buf, off); - angleRanges[i].write(); - } - backing.putInt(12, angleRanges.length); - putPointer(backing, 8, angleRanges_buf); - scaleRange.write(); - occlusionRange.write(); - backing.putInt(32, numMatchesRequested); - backing.putFloat(36, minMatchScore); - } - - public int size() { - return 40; - } - } - - public static class LearnGeometricPatternAdvancedOptions extends DisposedStruct { - public int minRectLength; // Specifies the minimum length for each side of a - // rectangular feature. - public double minRectAspectRatio; // Specifies the minimum aspect ratio of a - // rectangular feature. - public int minRadius; // Specifies the minimum radius for a circular - // feature. - public int minLineLength; // Specifies the minimum length for a linear - // feature. - public double minFeatureStrength; // Specifies the minimum strength for a - // feature. - public int maxFeaturesUsed; // Specifies the maximum number of features the - // function uses when learning. - public int maxPixelDistanceFromLine; // Specifies the maximum number of - // pixels between an edge pixel and a - // linear feature for the function to - // consider that edge pixel as part of - // the linear feature. - - private void init() { - - } - - public LearnGeometricPatternAdvancedOptions() { - super(40); - init(); - } - - public LearnGeometricPatternAdvancedOptions(int minRectLength, double minRectAspectRatio, - int minRadius, int minLineLength, double minFeatureStrength, int maxFeaturesUsed, - int maxPixelDistanceFromLine) { - super(40); - this.minRectLength = minRectLength; - this.minRectAspectRatio = minRectAspectRatio; - this.minRadius = minRadius; - this.minLineLength = minLineLength; - this.minFeatureStrength = minFeatureStrength; - this.maxFeaturesUsed = maxFeaturesUsed; - this.maxPixelDistanceFromLine = maxPixelDistanceFromLine; - } - - protected LearnGeometricPatternAdvancedOptions(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected LearnGeometricPatternAdvancedOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - minRectLength = backing.getInt(0); - minRectAspectRatio = backing.getDouble(8); - minRadius = backing.getInt(16); - minLineLength = backing.getInt(20); - minFeatureStrength = backing.getDouble(24); - maxFeaturesUsed = backing.getInt(32); - maxPixelDistanceFromLine = backing.getInt(36); - } - - public void write() { - backing.putInt(0, minRectLength); - backing.putDouble(8, minRectAspectRatio); - backing.putInt(16, minRadius); - backing.putInt(20, minLineLength); - backing.putDouble(24, minFeatureStrength); - backing.putInt(32, maxFeaturesUsed); - backing.putInt(36, maxPixelDistanceFromLine); - } - - public int size() { - return 40; - } - } - - public static class FitEllipseOptions extends DisposedStruct { - public int rejectOutliers; // Whether to use every given point or only a - // subset of the points to fit the ellipse. - public double minScore; // Specifies the required quality of the fitted - // ellipse. - public double pixelRadius; // The acceptable distance, in pixels, that a - // point determined to belong to the ellipse can - // be from the circumference of the ellipse. - public int maxIterations; // Specifies the number of refinement iterations - // you allow the function to perform on the - // initial subset of points. - - private void init() { - - } - - public FitEllipseOptions() { - super(32); - init(); - } - - public FitEllipseOptions(int rejectOutliers, double minScore, double pixelRadius, - int maxIterations) { - super(32); - this.rejectOutliers = rejectOutliers; - this.minScore = minScore; - this.pixelRadius = pixelRadius; - this.maxIterations = maxIterations; - } - - protected FitEllipseOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected FitEllipseOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - rejectOutliers = backing.getInt(0); - minScore = backing.getDouble(8); - pixelRadius = backing.getDouble(16); - maxIterations = backing.getInt(24); - } - - public void write() { - backing.putInt(0, rejectOutliers); - backing.putDouble(8, minScore); - backing.putDouble(16, pixelRadius); - backing.putInt(24, maxIterations); - } - - public int size() { - return 32; - } - } - - public static class FitCircleOptions extends DisposedStruct { - public int rejectOutliers; // Whether to use every given point or only a - // subset of the points to fit the circle. - public double minScore; // Specifies the required quality of the fitted - // circle. - public double pixelRadius; // The acceptable distance, in pixels, that a - // point determined to belong to the circle can - // be from the circumference of the circle. - public int maxIterations; // Specifies the number of refinement iterations - // you allow the function to perform on the - // initial subset of points. - - private void init() { - - } - - public FitCircleOptions() { - super(32); - init(); - } - - public FitCircleOptions(int rejectOutliers, double minScore, double pixelRadius, - int maxIterations) { - super(32); - this.rejectOutliers = rejectOutliers; - this.minScore = minScore; - this.pixelRadius = pixelRadius; - this.maxIterations = maxIterations; - } - - protected FitCircleOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected FitCircleOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - rejectOutliers = backing.getInt(0); - minScore = backing.getDouble(8); - pixelRadius = backing.getDouble(16); - maxIterations = backing.getInt(24); - } - - public void write() { - backing.putInt(0, rejectOutliers); - backing.putDouble(8, minScore); - backing.putDouble(16, pixelRadius); - backing.putInt(24, maxIterations); - } - - public int size() { - return 32; - } - } - - public static class ConstructROIOptions2 extends DisposedStruct { - public int windowNumber; // The window number of the image window. - public String windowTitle; // Specifies the message string that the function - // displays in the title bar of the window. - public PaletteType type; // The palette type to use. - public RGBValue[] palette; // If type is IMAQ_PALETTE_USER, this array is - // the palette of colors to use with the window. - public int maxContours; // The maximum number of contours the user will be - // able to select. - private ByteBuffer windowTitle_buf; - private ByteBuffer palette_buf; - - private void init() { - palette = new RGBValue[0]; - } - - public ConstructROIOptions2() { - super(24); - init(); - } - - public ConstructROIOptions2(int windowNumber, String windowTitle, PaletteType type, - RGBValue[] palette, int maxContours) { - super(24); - this.windowNumber = windowNumber; - this.windowTitle = windowTitle; - this.type = type; - this.palette = palette; - this.maxContours = maxContours; - } - - protected ConstructROIOptions2(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ConstructROIOptions2(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - windowNumber = backing.getInt(0); - long windowTitle_addr = getPointer(backing, 4); - if (windowTitle_addr == 0) - windowTitle = null; - else { - ByteBuffer bb = newDirectByteBuffer(windowTitle_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - windowTitle = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - windowTitle = ""; - } - } - - type = PaletteType.fromValue(backing.getInt(8)); - int palette_numColors = backing.getInt(16); - long palette_addr = getPointer(backing, 12); - palette = new RGBValue[palette_numColors]; - if (palette_numColors > 0 && palette_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(palette_addr, palette_numColors * 4); - for (int i = 0, off = 0; i < palette_numColors; i++, off += 4) { - palette[i] = new RGBValue(bb, off); - palette[i].read(); - } - } - maxContours = backing.getInt(20); - } - - public void write() { - backing.putInt(0, windowNumber); - if (windowTitle != null) { - byte[] windowTitle_bytes; - try { - windowTitle_bytes = windowTitle.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - windowTitle_bytes = new byte[0]; - } - windowTitle_buf = ByteBuffer.allocateDirect(windowTitle_bytes.length + 1); - putBytes(windowTitle_buf, windowTitle_bytes, 0, windowTitle_bytes.length).put( - windowTitle_bytes.length, (byte) 0); - } - putPointer(backing, 4, windowTitle == null ? 0 : getByteBufferAddress(windowTitle_buf)); - if (type != null) - backing.putInt(8, type.getValue()); - palette_buf = ByteBuffer.allocateDirect(palette.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < palette.length; i++, off += 4) { - palette[i].setBuffer(palette_buf, off); - palette[i].write(); - } - backing.putInt(16, palette.length); - putPointer(backing, 12, palette_buf); - backing.putInt(20, maxContours); - } - - public int size() { - return 24; - } - } - - public static class HSLValue extends DisposedStruct { - public short L; // The color luminance. - public short S; // The color saturation. - public short H; // The color hue. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public HSLValue() { - super(4); - init(); - } - - public HSLValue(int L, int S, int H, int alpha) { - super(4); - this.L = (short) L; - this.S = (short) S; - this.H = (short) H; - this.alpha = (short) alpha; - } - - protected HSLValue(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected HSLValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - L = (short) (backing.get(0) & 0xff); - S = (short) (backing.get(1) & 0xff); - H = (short) (backing.get(2) & 0xff); - alpha = (short) (backing.get(3) & 0xff); - } - - public void write() { - backing.put(0, (byte) (L & 0xff)); - backing.put(1, (byte) (S & 0xff)); - backing.put(2, (byte) (H & 0xff)); - backing.put(3, (byte) (alpha & 0xff)); - } - - public int size() { - return 4; - } - } - - public static class HSVValue extends DisposedStruct { - public short V; // The color value. - public short S; // The color saturation. - public short H; // The color hue. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public HSVValue() { - super(4); - init(); - } - - public HSVValue(int V, int S, int H, int alpha) { - super(4); - this.V = (short) V; - this.S = (short) S; - this.H = (short) H; - this.alpha = (short) alpha; - } - - protected HSVValue(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected HSVValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - V = (short) (backing.get(0) & 0xff); - S = (short) (backing.get(1) & 0xff); - H = (short) (backing.get(2) & 0xff); - alpha = (short) (backing.get(3) & 0xff); - } - - public void write() { - backing.put(0, (byte) (V & 0xff)); - backing.put(1, (byte) (S & 0xff)); - backing.put(2, (byte) (H & 0xff)); - backing.put(3, (byte) (alpha & 0xff)); - } - - public int size() { - return 4; - } - } - - public static class HSIValue extends DisposedStruct { - public short I; // The color intensity. - public short S; // The color saturation. - public short H; // The color hue. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public HSIValue() { - super(4); - init(); - } - - public HSIValue(int I, int S, int H, int alpha) { - super(4); - this.I = (short) I; - this.S = (short) S; - this.H = (short) H; - this.alpha = (short) alpha; - } - - protected HSIValue(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected HSIValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - I = (short) (backing.get(0) & 0xff); - S = (short) (backing.get(1) & 0xff); - H = (short) (backing.get(2) & 0xff); - alpha = (short) (backing.get(3) & 0xff); - } - - public void write() { - backing.put(0, (byte) (I & 0xff)); - backing.put(1, (byte) (S & 0xff)); - backing.put(2, (byte) (H & 0xff)); - backing.put(3, (byte) (alpha & 0xff)); - } - - public int size() { - return 4; - } - } - - public static class CIELabValue extends DisposedStruct { - public double b; // The yellow/blue information of the color. - public double a; // The red/green information of the color. - public double L; // The color lightness. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public CIELabValue() { - super(32); - init(); - } - - public CIELabValue(double b, double a, double L, int alpha) { - super(32); - this.b = b; - this.a = a; - this.L = L; - this.alpha = (short) alpha; - } - - protected CIELabValue(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected CIELabValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - b = backing.getDouble(0); - a = backing.getDouble(8); - L = backing.getDouble(16); - alpha = (short) (backing.get(24) & 0xff); - } - - public void write() { - backing.putDouble(0, b); - backing.putDouble(8, a); - backing.putDouble(16, L); - backing.put(24, (byte) (alpha & 0xff)); - } - - public int size() { - return 32; - } - } - - public static class CIEXYZValue extends DisposedStruct { - public double Z; // The Z color information. - public double Y; // The color luminance. - public double X; // The X color information. - public short alpha; // The alpha value of the color, which represents extra - // information about a color image, such as gamma - // correction. - - private void init() { - - } - - public CIEXYZValue() { - super(32); - init(); - } - - public CIEXYZValue(double Z, double Y, double X, int alpha) { - super(32); - this.Z = Z; - this.Y = Y; - this.X = X; - this.alpha = (short) alpha; - } - - protected CIEXYZValue(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected CIEXYZValue(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - Z = backing.getDouble(0); - Y = backing.getDouble(8); - X = backing.getDouble(16); - alpha = (short) (backing.get(24) & 0xff); - } - - public void write() { - backing.putDouble(0, Z); - backing.putDouble(8, Y); - backing.putDouble(16, X); - backing.put(24, (byte) (alpha & 0xff)); - } - - public int size() { - return 32; - } - } - - public static class BestEllipse2 extends DisposedStruct { - public PointFloat center; // The coordinate location of the center of the - // ellipse. - public PointFloat majorAxisStart; // The coordinate location of the start of - // the major axis of the ellipse. - public PointFloat majorAxisEnd; // The coordinate location of the end of the - // major axis of the ellipse. - public PointFloat minorAxisStart; // The coordinate location of the start of - // the minor axis of the ellipse. - public PointFloat minorAxisEnd; // The coordinate location of the end of the - // minor axis of the ellipse. - public double area; // The area of the ellipse. - public double perimeter; // The length of the perimeter of the ellipse. - public double error; // Represents the least square error of the fitted - // ellipse to the entire set of points. - public int valid; // This element is TRUE if the function achieved the - // minimum score within the number of allowed refinement - // iterations and FALSE if the function did not achieve - // the minimum score. - public int[] pointsUsed; // An array of the indexes for the points array - // indicating which points the function used to fit - // the ellipse. - private ByteBuffer pointsUsed_buf; - - private void init() { - center = new PointFloat(backing, 0); - majorAxisStart = new PointFloat(backing, 8); - majorAxisEnd = new PointFloat(backing, 16); - minorAxisStart = new PointFloat(backing, 24); - minorAxisEnd = new PointFloat(backing, 32); - pointsUsed = new int[0]; - } - - public BestEllipse2() { - super(80); - init(); - } - - public BestEllipse2(PointFloat center, PointFloat majorAxisStart, PointFloat majorAxisEnd, - PointFloat minorAxisStart, PointFloat minorAxisEnd, double area, double perimeter, - double error, int valid, int[] pointsUsed) { - super(80); - this.center = center; - this.majorAxisStart = majorAxisStart; - this.majorAxisEnd = majorAxisEnd; - this.minorAxisStart = minorAxisStart; - this.minorAxisEnd = minorAxisEnd; - this.area = area; - this.perimeter = perimeter; - this.error = error; - this.valid = valid; - this.pointsUsed = pointsUsed; - } - - protected BestEllipse2(ByteBuffer backing, int offset) { - super(backing, offset, 80); - init(); - } - - protected BestEllipse2(long nativeObj, boolean owned) { - super(nativeObj, owned, 80); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 80); - } - - public void read() { - center.read(); - majorAxisStart.read(); - majorAxisEnd.read(); - minorAxisStart.read(); - minorAxisEnd.read(); - area = backing.getDouble(40); - perimeter = backing.getDouble(48); - error = backing.getDouble(56); - valid = backing.getInt(64); - int pointsUsed_numPointsUsed = backing.getInt(72); - long pointsUsed_addr = getPointer(backing, 68); - pointsUsed = new int[pointsUsed_numPointsUsed]; - if (pointsUsed_numPointsUsed > 0 && pointsUsed_addr != 0) { - newDirectByteBuffer(pointsUsed_addr, pointsUsed_numPointsUsed * 4).asIntBuffer().get( - pointsUsed); - } - } - - public void write() { - center.write(); - majorAxisStart.write(); - majorAxisEnd.write(); - minorAxisStart.write(); - minorAxisEnd.write(); - backing.putDouble(40, area); - backing.putDouble(48, perimeter); - backing.putDouble(56, error); - backing.putInt(64, valid); - pointsUsed_buf = - ByteBuffer.allocateDirect(pointsUsed.length * 4).order(ByteOrder.nativeOrder()); - pointsUsed_buf.asIntBuffer().put(pointsUsed).rewind(); - backing.putInt(72, pointsUsed.length); - putPointer(backing, 68, pointsUsed_buf); - } - - public int size() { - return 80; - } - } - - public static class LearnPatternAdvancedOptions extends DisposedStruct { - public LearnPatternAdvancedShiftOptions shiftOptions; // Use this element to - // control the - // behavior of - // imaqLearnPattern2() - // during the - // shift-invariant - // learning phase. - public LearnPatternAdvancedRotationOptions rotationOptions; // Use this - // element to - // control the - // behavior of - // imaqLearnPattern2()during - // the - // rotation-invariant - // learning - // phase. - - private void init() { - - } - - public LearnPatternAdvancedOptions() { - super(8); - init(); - } - - public LearnPatternAdvancedOptions(LearnPatternAdvancedShiftOptions shiftOptions, - LearnPatternAdvancedRotationOptions rotationOptions) { - super(8); - this.shiftOptions = shiftOptions; - this.rotationOptions = rotationOptions; - } - - protected LearnPatternAdvancedOptions(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected LearnPatternAdvancedOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - long shiftOptions_addr = getPointer(backing, 0); - if (shiftOptions_addr == 0) - shiftOptions = null; - else - shiftOptions = new LearnPatternAdvancedShiftOptions(shiftOptions_addr, false); - long rotationOptions_addr = getPointer(backing, 4); - if (rotationOptions_addr == 0) - rotationOptions = null; - else - rotationOptions = new LearnPatternAdvancedRotationOptions(rotationOptions_addr, false); - } - - public void write() { - putPointer(backing, 0, shiftOptions); - putPointer(backing, 4, rotationOptions); - } - - public int size() { - return 8; - } - } - - public static class AVIInfo extends DisposedStruct { - public int width; // The width of each frame. - public int height; // The height of each frame. - public ImageType imageType; // The type of images this AVI contains. - public int numFrames; // The number of frames in the AVI. - public int framesPerSecond; // The number of frames per second this AVI - // should be shown at. - public String filterName; // The name of the compression filter used to - // create this AVI. - public int hasData; // Specifies whether this AVI has data attached to each - // frame or not. - public int maxDataSize; // If this AVI has data, the maximum size of the - // data in each frame. - private ByteBuffer filterName_buf; - - private void init() { - - } - - public AVIInfo() { - super(32); - init(); - } - - public AVIInfo(int width, int height, ImageType imageType, int numFrames, int framesPerSecond, - String filterName, int hasData, int maxDataSize) { - super(32); - this.width = width; - this.height = height; - this.imageType = imageType; - this.numFrames = numFrames; - this.framesPerSecond = framesPerSecond; - this.filterName = filterName; - this.hasData = hasData; - this.maxDataSize = maxDataSize; - } - - protected AVIInfo(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected AVIInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - width = backing.getInt(0); - height = backing.getInt(4); - imageType = ImageType.fromValue(backing.getInt(8)); - numFrames = backing.getInt(12); - framesPerSecond = backing.getInt(16); - long filterName_addr = getPointer(backing, 20); - if (filterName_addr == 0) - filterName = null; - else { - ByteBuffer bb = newDirectByteBuffer(filterName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - filterName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - filterName = ""; - } - } - - hasData = backing.getInt(24); - maxDataSize = backing.getInt(28); - } - - public void write() { - backing.putInt(0, width); - backing.putInt(4, height); - if (imageType != null) - backing.putInt(8, imageType.getValue()); - backing.putInt(12, numFrames); - backing.putInt(16, framesPerSecond); - if (filterName != null) { - byte[] filterName_bytes; - try { - filterName_bytes = filterName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - filterName_bytes = new byte[0]; - } - filterName_buf = ByteBuffer.allocateDirect(filterName_bytes.length + 1); - putBytes(filterName_buf, filterName_bytes, 0, filterName_bytes.length).put( - filterName_bytes.length, (byte) 0); - } - putPointer(backing, 20, filterName == null ? 0 : getByteBufferAddress(filterName_buf)); - backing.putInt(24, hasData); - backing.putInt(28, maxDataSize); - } - - public int size() { - return 32; - } - } - - public static class LearnPatternAdvancedShiftOptions extends DisposedStruct { - public int initialStepSize; // The largest number of image pixels to shift - // the sample across the inspection image during - // the initial phase of shift-invariant - // matching. - public int initialSampleSize; // Specifies the number of template pixels - // that you want to include in a sample for - // the initial phase of shift-invariant - // matching. - public double initialSampleSizeFactor; // Specifies the size of the sample - // for the initial phase of - // shift-invariant matching as a - // percent of the template size, in - // pixels. - public int finalSampleSize; // Specifies the number of template pixels you - // want to add to initialSampleSize for the - // final phase of shift-invariant matching. - public double finalSampleSizeFactor; // Specifies the size of the sample for - // the final phase of shift-invariant - // matching as a percent of the edge - // points in the template, in pixels. - public int subpixelSampleSize; // Specifies the number of template pixels - // that you want to include in a sample for - // the subpixel phase of shift-invariant - // matching. - public double subpixelSampleSizeFactor; // Specifies the size of the sample - // for the subpixel phase of - // shift-invariant matching as a - // percent of the template size, in - // pixels. - - private void init() { - - } - - public LearnPatternAdvancedShiftOptions() { - super(48); - init(); - } - - public LearnPatternAdvancedShiftOptions(int initialStepSize, int initialSampleSize, - double initialSampleSizeFactor, int finalSampleSize, double finalSampleSizeFactor, - int subpixelSampleSize, double subpixelSampleSizeFactor) { - super(48); - this.initialStepSize = initialStepSize; - this.initialSampleSize = initialSampleSize; - this.initialSampleSizeFactor = initialSampleSizeFactor; - this.finalSampleSize = finalSampleSize; - this.finalSampleSizeFactor = finalSampleSizeFactor; - this.subpixelSampleSize = subpixelSampleSize; - this.subpixelSampleSizeFactor = subpixelSampleSizeFactor; - } - - protected LearnPatternAdvancedShiftOptions(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected LearnPatternAdvancedShiftOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - initialStepSize = backing.getInt(0); - initialSampleSize = backing.getInt(4); - initialSampleSizeFactor = backing.getDouble(8); - finalSampleSize = backing.getInt(16); - finalSampleSizeFactor = backing.getDouble(24); - subpixelSampleSize = backing.getInt(32); - subpixelSampleSizeFactor = backing.getDouble(40); - } - - public void write() { - backing.putInt(0, initialStepSize); - backing.putInt(4, initialSampleSize); - backing.putDouble(8, initialSampleSizeFactor); - backing.putInt(16, finalSampleSize); - backing.putDouble(24, finalSampleSizeFactor); - backing.putInt(32, subpixelSampleSize); - backing.putDouble(40, subpixelSampleSizeFactor); - } - - public int size() { - return 48; - } - } - - public static class LearnPatternAdvancedRotationOptions extends DisposedStruct { - public SearchStrategy searchStrategySupport; // Specifies the aggressiveness - // of the rotation search - // strategy available during - // the matching phase. - public int initialStepSize; // The largest number of image pixels to shift - // the sample across the inspection image during - // the initial phase of matching. - public int initialSampleSize; // Specifies the number of template pixels - // that you want to include in a sample for - // the initial phase of rotation-invariant - // matching. - public double initialSampleSizeFactor; // Specifies the size of the sample - // for the initial phase of - // rotation-invariant matching as a - // percent of the template size, in - // pixels. - public int initialAngularAccuracy; // Sets the angle accuracy, in degrees, - // to use during the initial phase of - // rotation-invariant matching. - public int finalSampleSize; // Specifies the number of template pixels you - // want to add to initialSampleSize for the - // final phase of rotation-invariant matching. - public double finalSampleSizeFactor; // Specifies the size of the sample for - // the final phase of - // rotation-invariant matching as a - // percent of the edge points in the - // template, in pixels. - public int finalAngularAccuracy; // Sets the angle accuracy, in degrees, to - // use during the final phase of the - // rotation-invariant matching. - public int subpixelSampleSize; // Specifies the number of template pixels - // that you want to include in a sample for - // the subpixel phase of rotation-invariant - // matching. - public double subpixelSampleSizeFactor; // Specifies the size of the sample - // for the subpixel phase of - // rotation-invariant matching as a - // percent of the template size, in - // pixels. - - private void init() { - - } - - public LearnPatternAdvancedRotationOptions() { - super(56); - init(); - } - - public LearnPatternAdvancedRotationOptions(SearchStrategy searchStrategySupport, - int initialStepSize, int initialSampleSize, double initialSampleSizeFactor, - int initialAngularAccuracy, int finalSampleSize, double finalSampleSizeFactor, - int finalAngularAccuracy, int subpixelSampleSize, double subpixelSampleSizeFactor) { - super(56); - this.searchStrategySupport = searchStrategySupport; - this.initialStepSize = initialStepSize; - this.initialSampleSize = initialSampleSize; - this.initialSampleSizeFactor = initialSampleSizeFactor; - this.initialAngularAccuracy = initialAngularAccuracy; - this.finalSampleSize = finalSampleSize; - this.finalSampleSizeFactor = finalSampleSizeFactor; - this.finalAngularAccuracy = finalAngularAccuracy; - this.subpixelSampleSize = subpixelSampleSize; - this.subpixelSampleSizeFactor = subpixelSampleSizeFactor; - } - - protected LearnPatternAdvancedRotationOptions(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected LearnPatternAdvancedRotationOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - searchStrategySupport = SearchStrategy.fromValue(backing.getInt(0)); - initialStepSize = backing.getInt(4); - initialSampleSize = backing.getInt(8); - initialSampleSizeFactor = backing.getDouble(16); - initialAngularAccuracy = backing.getInt(24); - finalSampleSize = backing.getInt(28); - finalSampleSizeFactor = backing.getDouble(32); - finalAngularAccuracy = backing.getInt(40); - subpixelSampleSize = backing.getInt(44); - subpixelSampleSizeFactor = backing.getDouble(48); - } - - public void write() { - if (searchStrategySupport != null) - backing.putInt(0, searchStrategySupport.getValue()); - backing.putInt(4, initialStepSize); - backing.putInt(8, initialSampleSize); - backing.putDouble(16, initialSampleSizeFactor); - backing.putInt(24, initialAngularAccuracy); - backing.putInt(28, finalSampleSize); - backing.putDouble(32, finalSampleSizeFactor); - backing.putInt(40, finalAngularAccuracy); - backing.putInt(44, subpixelSampleSize); - backing.putDouble(48, subpixelSampleSizeFactor); - } - - public int size() { - return 56; - } - } - - public static class MatchPatternAdvancedOptions extends DisposedStruct { - public int subpixelIterations; // Defines the maximum number of incremental - // improvements used to refine matching using - // subpixel information. - public double subpixelTolerance; // Defines the maximum amount of change, in - // pixels, between consecutive incremental - // improvements in the match position that - // you want to trigger the end of the - // refinement process. - public int initialMatchListLength; // Specifies the maximum size of the - // match list. - public int matchListReductionFactor; // Specifies the reduction of the match - // list as matches are refined. - public int initialStepSize; // Specifies the number of pixels to shift the - // sample across the inspection image during the - // initial phase of shift-invariant matching. - public SearchStrategy searchStrategy; // Specifies the aggressiveness of the - // rotation search strategy. - public int intermediateAngularAccuracy; // Specifies the accuracy to use - // during the intermediate phase of - // rotation-invariant matching. - - private void init() { - - } - - public MatchPatternAdvancedOptions() { - super(40); - init(); - } - - public MatchPatternAdvancedOptions(int subpixelIterations, double subpixelTolerance, - int initialMatchListLength, int matchListReductionFactor, int initialStepSize, - SearchStrategy searchStrategy, int intermediateAngularAccuracy) { - super(40); - this.subpixelIterations = subpixelIterations; - this.subpixelTolerance = subpixelTolerance; - this.initialMatchListLength = initialMatchListLength; - this.matchListReductionFactor = matchListReductionFactor; - this.initialStepSize = initialStepSize; - this.searchStrategy = searchStrategy; - this.intermediateAngularAccuracy = intermediateAngularAccuracy; - } - - protected MatchPatternAdvancedOptions(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected MatchPatternAdvancedOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - subpixelIterations = backing.getInt(0); - subpixelTolerance = backing.getDouble(8); - initialMatchListLength = backing.getInt(16); - matchListReductionFactor = backing.getInt(20); - initialStepSize = backing.getInt(24); - searchStrategy = SearchStrategy.fromValue(backing.getInt(28)); - intermediateAngularAccuracy = backing.getInt(32); - } - - public void write() { - backing.putInt(0, subpixelIterations); - backing.putDouble(8, subpixelTolerance); - backing.putInt(16, initialMatchListLength); - backing.putInt(20, matchListReductionFactor); - backing.putInt(24, initialStepSize); - if (searchStrategy != null) - backing.putInt(28, searchStrategy.getValue()); - backing.putInt(32, intermediateAngularAccuracy); - } - - public int size() { - return 40; - } - } - - public static class ParticleFilterCriteria2 extends DisposedStruct { - public MeasurementType parameter; // The morphological measurement that the - // function uses for filtering. - public float lower; // The lower bound of the criteria range. - public float upper; // The upper bound of the criteria range. - public int calibrated; // Set this element to TRUE to take calibrated - // measurements. - public int exclude; // Set this element to TRUE to indicate that a match - // occurs when the measurement is outside the criteria - // range. - - private void init() { - - } - - public ParticleFilterCriteria2() { - super(20); - init(); - } - - public ParticleFilterCriteria2(MeasurementType parameter, double lower, double upper, - int calibrated, int exclude) { - super(20); - this.parameter = parameter; - this.lower = (float) lower; - this.upper = (float) upper; - this.calibrated = calibrated; - this.exclude = exclude; - } - - protected ParticleFilterCriteria2(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected ParticleFilterCriteria2(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - parameter = MeasurementType.fromValue(backing.getInt(0)); - lower = backing.getFloat(4); - upper = backing.getFloat(8); - calibrated = backing.getInt(12); - exclude = backing.getInt(16); - } - - public void write() { - if (parameter != null) - backing.putInt(0, parameter.getValue()); - backing.putFloat(4, lower); - backing.putFloat(8, upper); - backing.putInt(12, calibrated); - backing.putInt(16, exclude); - } - - public int size() { - return 20; - } - } - - public static class BestCircle2 extends DisposedStruct { - public PointFloat center; // The coordinate location of the center of the - // circle. - public double radius; // The radius of the circle. - public double area; // The area of the circle. - public double perimeter; // The length of the perimeter of the circle. - public double error; // Represents the least square error of the fitted - // circle to the entire set of points. - public int valid; // This element is TRUE if the function achieved the - // minimum score within the number of allowed refinement - // iterations and FALSE if the function did not achieve - // the minimum score. - public int[] pointsUsed; // An array of the indexes for the points array - // indicating which points the function used to fit - // the circle. - private ByteBuffer pointsUsed_buf; - - private void init() { - center = new PointFloat(backing, 0); - pointsUsed = new int[0]; - } - - public BestCircle2() { - super(56); - init(); - } - - public BestCircle2(PointFloat center, double radius, double area, double perimeter, - double error, int valid, int[] pointsUsed) { - super(56); - this.center = center; - this.radius = radius; - this.area = area; - this.perimeter = perimeter; - this.error = error; - this.valid = valid; - this.pointsUsed = pointsUsed; - } - - protected BestCircle2(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected BestCircle2(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - center.read(); - radius = backing.getDouble(8); - area = backing.getDouble(16); - perimeter = backing.getDouble(24); - error = backing.getDouble(32); - valid = backing.getInt(40); - int pointsUsed_numPointsUsed = backing.getInt(48); - long pointsUsed_addr = getPointer(backing, 44); - pointsUsed = new int[pointsUsed_numPointsUsed]; - if (pointsUsed_numPointsUsed > 0 && pointsUsed_addr != 0) { - newDirectByteBuffer(pointsUsed_addr, pointsUsed_numPointsUsed * 4).asIntBuffer().get( - pointsUsed); - } - } - - public void write() { - center.write(); - backing.putDouble(8, radius); - backing.putDouble(16, area); - backing.putDouble(24, perimeter); - backing.putDouble(32, error); - backing.putInt(40, valid); - pointsUsed_buf = - ByteBuffer.allocateDirect(pointsUsed.length * 4).order(ByteOrder.nativeOrder()); - pointsUsed_buf.asIntBuffer().put(pointsUsed).rewind(); - backing.putInt(48, pointsUsed.length); - putPointer(backing, 44, pointsUsed_buf); - } - - public int size() { - return 56; - } - } - - public static class OCRSpacingOptions extends DisposedStruct { - public int minCharSpacing; // The minimum number of pixels that must be - // between two characters for NI Vision to train - // or read the characters separately. - public int minCharSize; // The minimum number of pixels required for an - // object to be a potentially identifiable - // character. - public int maxCharSize; // The maximum number of pixels required for an - // object to be a potentially identifiable - // character. - public int maxHorizontalElementSpacing; // The maximum horizontal spacing, - // in pixels, allowed between - // character elements to train or - // read the character elements as a - // single character. - public int maxVerticalElementSpacing; // The maximum vertical element - // spacing in pixels. - public int minBoundingRectWidth; // The minimum possible width, in pixels, - // for a character bounding rectangle. - public int maxBoundingRectWidth; // The maximum possible width, in pixels, - // for a character bounding rectangle. - public int minBoundingRectHeight; // The minimum possible height, in pixels, - // for a character bounding rectangle. - public int maxBoundingRectHeight; // The maximum possible height, in pixels, - // for a character bounding rectangle. - public int autoSplit; // Set this element to TRUE to automatically adjust - // the location of the character bounding rectangle - // when characters overlap vertically. - - private void init() { - - } - - public OCRSpacingOptions() { - super(40); - init(); - } - - public OCRSpacingOptions(int minCharSpacing, int minCharSize, int maxCharSize, - int maxHorizontalElementSpacing, int maxVerticalElementSpacing, int minBoundingRectWidth, - int maxBoundingRectWidth, int minBoundingRectHeight, int maxBoundingRectHeight, - int autoSplit) { - super(40); - this.minCharSpacing = minCharSpacing; - this.minCharSize = minCharSize; - this.maxCharSize = maxCharSize; - this.maxHorizontalElementSpacing = maxHorizontalElementSpacing; - this.maxVerticalElementSpacing = maxVerticalElementSpacing; - this.minBoundingRectWidth = minBoundingRectWidth; - this.maxBoundingRectWidth = maxBoundingRectWidth; - this.minBoundingRectHeight = minBoundingRectHeight; - this.maxBoundingRectHeight = maxBoundingRectHeight; - this.autoSplit = autoSplit; - } - - protected OCRSpacingOptions(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected OCRSpacingOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - minCharSpacing = backing.getInt(0); - minCharSize = backing.getInt(4); - maxCharSize = backing.getInt(8); - maxHorizontalElementSpacing = backing.getInt(12); - maxVerticalElementSpacing = backing.getInt(16); - minBoundingRectWidth = backing.getInt(20); - maxBoundingRectWidth = backing.getInt(24); - minBoundingRectHeight = backing.getInt(28); - maxBoundingRectHeight = backing.getInt(32); - autoSplit = backing.getInt(36); - } - - public void write() { - backing.putInt(0, minCharSpacing); - backing.putInt(4, minCharSize); - backing.putInt(8, maxCharSize); - backing.putInt(12, maxHorizontalElementSpacing); - backing.putInt(16, maxVerticalElementSpacing); - backing.putInt(20, minBoundingRectWidth); - backing.putInt(24, maxBoundingRectWidth); - backing.putInt(28, minBoundingRectHeight); - backing.putInt(32, maxBoundingRectHeight); - backing.putInt(36, autoSplit); - } - - public int size() { - return 40; - } - } - - public static class OCRProcessingOptions extends DisposedStruct { - public ThresholdMode mode; // The thresholding mode. - public int lowThreshold; // The low threshold value when you set mode to - // IMAQ_FIXED_RANGE. - public int highThreshold; // The high threshold value when you set mode to - // IMAQ_FIXED_RANGE. - public int blockCount; // The number of blocks for threshold calculation - // algorithms that require blocks. - public int fastThreshold; // Set this element to TRUE to use a faster, less - // accurate threshold calculation algorithm. - public int biModalCalculation; // Set this element to TRUE to calculate both - // the low and high threshold values when - // using the fast thresholding method. - public int darkCharacters; // Set this element to TRUE to read or train dark - // characters on a light background. - public int removeParticlesTouchingROI; // Set this element to TRUE to remove - // the particles touching the ROI. - public int erosionCount; // The number of erosions to perform. - - private void init() { - - } - - public OCRProcessingOptions() { - super(36); - init(); - } - - public OCRProcessingOptions(ThresholdMode mode, int lowThreshold, int highThreshold, - int blockCount, int fastThreshold, int biModalCalculation, int darkCharacters, - int removeParticlesTouchingROI, int erosionCount) { - super(36); - this.mode = mode; - this.lowThreshold = lowThreshold; - this.highThreshold = highThreshold; - this.blockCount = blockCount; - this.fastThreshold = fastThreshold; - this.biModalCalculation = biModalCalculation; - this.darkCharacters = darkCharacters; - this.removeParticlesTouchingROI = removeParticlesTouchingROI; - this.erosionCount = erosionCount; - } - - protected OCRProcessingOptions(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected OCRProcessingOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - mode = ThresholdMode.fromValue(backing.getInt(0)); - lowThreshold = backing.getInt(4); - highThreshold = backing.getInt(8); - blockCount = backing.getInt(12); - fastThreshold = backing.getInt(16); - biModalCalculation = backing.getInt(20); - darkCharacters = backing.getInt(24); - removeParticlesTouchingROI = backing.getInt(28); - erosionCount = backing.getInt(32); - } - - public void write() { - if (mode != null) - backing.putInt(0, mode.getValue()); - backing.putInt(4, lowThreshold); - backing.putInt(8, highThreshold); - backing.putInt(12, blockCount); - backing.putInt(16, fastThreshold); - backing.putInt(20, biModalCalculation); - backing.putInt(24, darkCharacters); - backing.putInt(28, removeParticlesTouchingROI); - backing.putInt(32, erosionCount); - } - - public int size() { - return 36; - } - } - - public static class ReadTextOptions extends DisposedStruct { - public String[] validChars; // An array of strings that specifies the valid - // characters. - public byte substitutionChar; // The character to substitute for objects - // that the function cannot match with any of - // the trained characters. - public ReadStrategy readStrategy; // The read strategy, which determines how - // closely the function analyzes images in - // the reading process to match objects - // with trained characters. - public int acceptanceLevel; // The minimum acceptance level at which an - // object is considered a trained character. - public int aspectRatio; // The maximum aspect ratio variance percentage for - // valid characters. - public ReadResolution readResolution; // The read resolution, which - // determines how much of the trained - // character data the function uses to - // match objects to trained - // characters. - private ByteBuffer validChars_buf; - private ByteBuffer[] validChars_bufs; - - private void init() { - validChars = new String[0]; - } - - public ReadTextOptions() { - super(65304); - init(); - } - - public ReadTextOptions(String[] validChars, byte substitutionChar, ReadStrategy readStrategy, - int acceptanceLevel, int aspectRatio, ReadResolution readResolution) { - super(65304); - this.validChars = validChars; - this.substitutionChar = substitutionChar; - this.readStrategy = readStrategy; - this.acceptanceLevel = acceptanceLevel; - this.aspectRatio = aspectRatio; - this.readResolution = readResolution; - } - - protected ReadTextOptions(ByteBuffer backing, int offset) { - super(backing, offset, 65304); - init(); - } - - protected ReadTextOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 65304); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 65304); - } - - public void read() { - int validChars_numValidChars = backing.getInt(65280); - long validChars_addr = getPointer(backing, 0); - validChars = new String[validChars_numValidChars]; - if (validChars_numValidChars > 0 && validChars_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(validChars_addr, validChars_numValidChars * 4); - for (int i = 0, off = 0; i < validChars_numValidChars; i++, off += 4) { - long addr = getPointer(bb, off); - if (addr == 0) - validChars[i] = null; - else { - ByteBuffer bb2 = newDirectByteBuffer(addr, 1000); // FIXME - while (bb2.get() != 0) { - } - byte[] bytes = new byte[bb2.position() - 1]; - bb2.rewind(); - getBytes(bb2, bytes, 0, bytes.length); - try { - validChars[i] = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - validChars[i] = ""; - } - } - } - } - substitutionChar = backing.get(65284); - readStrategy = ReadStrategy.fromValue(backing.getInt(65288)); - acceptanceLevel = backing.getInt(65292); - aspectRatio = backing.getInt(65296); - readResolution = ReadResolution.fromValue(backing.getInt(65300)); - } - - public void write() { - validChars_buf = - ByteBuffer.allocateDirect(validChars.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < validChars.length; i++, off += 4) { - if (validChars[i] == null) - putPointer(validChars_buf, off, 0); - else { - byte[] bytes; - try { - bytes = validChars[i].getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - validChars_bufs[i] = ByteBuffer.allocateDirect(bytes.length + 1); - putBytes(validChars_bufs[i], bytes, 0, bytes.length).put(bytes.length, (byte) 0); - putPointer(validChars_buf, off, getByteBufferAddress(validChars_bufs[i])); - } - } - backing.putInt(65280, validChars.length); - putPointer(backing, 0, validChars_buf); - backing.put(65284, substitutionChar); - if (readStrategy != null) - backing.putInt(65288, readStrategy.getValue()); - backing.putInt(65292, acceptanceLevel); - backing.putInt(65296, aspectRatio); - if (readResolution != null) - backing.putInt(65300, readResolution.getValue()); - } - - public int size() { - return 65304; - } - } - - public static class CharInfo extends DisposedStruct { - public String charValue; // Retrieves the character value of the - // corresponding character in the character set. - public Image charImage; // The image you used to train this character. - public Image internalImage; // The internal representation that NI Vision - // uses to match objects to this character. - private ByteBuffer charValue_buf; - - private void init() { - - } - - public CharInfo() { - super(12); - init(); - } - - public CharInfo(String charValue, Image charImage, Image internalImage) { - super(12); - this.charValue = charValue; - this.charImage = charImage; - this.internalImage = internalImage; - } - - protected CharInfo(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected CharInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - long charValue_addr = getPointer(backing, 0); - if (charValue_addr == 0) - charValue = null; - else { - ByteBuffer bb = newDirectByteBuffer(charValue_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - charValue = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - charValue = ""; - } - } - - long charImage_addr = getPointer(backing, 4); - if (charImage_addr == 0) - charImage = null; - else - charImage = new Image(charImage_addr, false); - long internalImage_addr = getPointer(backing, 8); - if (internalImage_addr == 0) - internalImage = null; - else - internalImage = new Image(internalImage_addr, false); - } - - public void write() { - if (charValue != null) { - byte[] charValue_bytes; - try { - charValue_bytes = charValue.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - charValue_bytes = new byte[0]; - } - charValue_buf = ByteBuffer.allocateDirect(charValue_bytes.length + 1); - putBytes(charValue_buf, charValue_bytes, 0, charValue_bytes.length).put( - charValue_bytes.length, (byte) 0); - } - putPointer(backing, 0, charValue == null ? 0 : getByteBufferAddress(charValue_buf)); - putPointer(backing, 4, charImage); - putPointer(backing, 8, internalImage); - } - - public int size() { - return 12; - } - } - - public static class Rect extends DisposedStruct { - public int top; // Location of the top edge of the rectangle. - public int left; // Location of the left edge of the rectangle. - public int height; // Height of the rectangle. - public int width; // Width of the rectangle. - - private void init() { - - } - - public Rect() { - super(16); - init(); - } - - public Rect(int top, int left, int height, int width) { - super(16); - this.top = top; - this.left = left; - this.height = height; - this.width = width; - } - - protected Rect(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected Rect(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - top = backing.getInt(0); - left = backing.getInt(4); - height = backing.getInt(8); - width = backing.getInt(12); - } - - public void write() { - backing.putInt(0, top); - backing.putInt(4, left); - backing.putInt(8, height); - backing.putInt(12, width); - } - - public int size() { - return 16; - } - } - - public static class CharReport extends DisposedStruct { - public String character; // The character value. - public PointFloat[] corner; // An array of four points that describes the - // rectangle that surrounds the character. - public int reserved; // This element is reserved. - public int lowThreshold; // The minimum value of the threshold range used - // for this character. - public int highThreshold; // The maximum value of the threshold range used - // for this character. - private ByteBuffer character_buf; - - private void init() { - corner = new PointFloat[4]; - - for (int i = 0, off = 4; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public CharReport() { - super(48); - init(); - } - - public CharReport(String character, PointFloat[] corner, int reserved, int lowThreshold, - int highThreshold) { - super(48); - this.character = character; - this.corner = corner; - this.reserved = reserved; - this.lowThreshold = lowThreshold; - this.highThreshold = highThreshold; - } - - protected CharReport(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected CharReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - long character_addr = getPointer(backing, 0); - if (character_addr == 0) - character = null; - else { - ByteBuffer bb = newDirectByteBuffer(character_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - character = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - character = ""; - } - } - - for (PointFloat it : corner) { - it.read(); - } - reserved = backing.getInt(36); - lowThreshold = backing.getInt(40); - highThreshold = backing.getInt(44); - } - - public void write() { - if (character != null) { - byte[] character_bytes; - try { - character_bytes = character.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - character_bytes = new byte[0]; - } - character_buf = ByteBuffer.allocateDirect(character_bytes.length + 1); - putBytes(character_buf, character_bytes, 0, character_bytes.length).put( - character_bytes.length, (byte) 0); - } - putPointer(backing, 0, character == null ? 0 : getByteBufferAddress(character_buf)); - for (PointFloat it : corner) { - it.write(); - } - backing.putInt(36, reserved); - backing.putInt(40, lowThreshold); - backing.putInt(44, highThreshold); - } - - public int size() { - return 48; - } - } - - public static class ReadTextReport extends DisposedStruct { - public String readString; // The read string. - public CharReport[] characterReport; // An array of reports describing the - // properties of each identified - // character. - private ByteBuffer readString_buf; - private ByteBuffer characterReport_buf; - - private void init() { - characterReport = new CharReport[0]; - } - - public ReadTextReport() { - super(12); - init(); - } - - public ReadTextReport(String readString, CharReport[] characterReport) { - super(12); - this.readString = readString; - this.characterReport = characterReport; - } - - protected ReadTextReport(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ReadTextReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - long readString_addr = getPointer(backing, 0); - if (readString_addr == 0) - readString = null; - else { - ByteBuffer bb = newDirectByteBuffer(readString_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - readString = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - readString = ""; - } - } - - int characterReport_numCharacterReports = backing.getInt(8); - long characterReport_addr = getPointer(backing, 4); - characterReport = new CharReport[characterReport_numCharacterReports]; - if (characterReport_numCharacterReports > 0 && characterReport_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(characterReport_addr, characterReport_numCharacterReports * 48); - for (int i = 0, off = 0; i < characterReport_numCharacterReports; i++, off += 48) { - characterReport[i] = new CharReport(bb, off); - characterReport[i].read(); - } - } - } - - public void write() { - if (readString != null) { - byte[] readString_bytes; - try { - readString_bytes = readString.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - readString_bytes = new byte[0]; - } - readString_buf = ByteBuffer.allocateDirect(readString_bytes.length + 1); - putBytes(readString_buf, readString_bytes, 0, readString_bytes.length).put( - readString_bytes.length, (byte) 0); - } - putPointer(backing, 0, readString == null ? 0 : getByteBufferAddress(readString_buf)); - characterReport_buf = - ByteBuffer.allocateDirect(characterReport.length * 48).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < characterReport.length; i++, off += 48) { - characterReport[i].setBuffer(characterReport_buf, off); - characterReport[i].write(); - } - backing.putInt(8, characterReport.length); - putPointer(backing, 4, characterReport_buf); - } - - public int size() { - return 12; - } - } - - public static class Point extends DisposedStruct { - public int x; // The x-coordinate of the point. - public int y; // The y-coordinate of the point. - - private void init() { - - } - - public Point() { - super(8); - init(); - } - - public Point(int x, int y) { - super(8); - this.x = x; - this.y = y; - } - - protected Point(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected Point(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - x = backing.getInt(0); - y = backing.getInt(4); - } - - public void write() { - backing.putInt(0, x); - backing.putInt(4, y); - } - - public int size() { - return 8; - } - } - - public static class Annulus extends DisposedStruct { - public Point center; // The coordinate location of the center of the - // annulus. - public int innerRadius; // The internal radius of the annulus. - public int outerRadius; // The external radius of the annulus. - public double startAngle; // The start angle, in degrees, of the annulus. - public double endAngle; // The end angle, in degrees, of the annulus. - - private void init() { - center = new Point(backing, 0); - } - - public Annulus() { - super(32); - init(); - } - - public Annulus(Point center, int innerRadius, int outerRadius, double startAngle, - double endAngle) { - super(32); - this.center = center; - this.innerRadius = innerRadius; - this.outerRadius = outerRadius; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected Annulus(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected Annulus(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - center.read(); - innerRadius = backing.getInt(8); - outerRadius = backing.getInt(12); - startAngle = backing.getDouble(16); - endAngle = backing.getDouble(24); - } - - public void write() { - center.write(); - backing.putInt(8, innerRadius); - backing.putInt(12, outerRadius); - backing.putDouble(16, startAngle); - backing.putDouble(24, endAngle); - } - - public int size() { - return 32; - } - } - - public static class EdgeLocationReport extends DisposedStruct { - public PointFloat[] edges; // The coordinate location of all edges detected - // by the search line. - private ByteBuffer edges_buf; - - private void init() { - edges = new PointFloat[0]; - } - - public EdgeLocationReport() { - super(8); - init(); - } - - public EdgeLocationReport(PointFloat[] edges) { - super(8); - this.edges = edges; - } - - protected EdgeLocationReport(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected EdgeLocationReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int edges_numEdges = backing.getInt(4); - long edges_addr = getPointer(backing, 0); - edges = new PointFloat[edges_numEdges]; - if (edges_numEdges > 0 && edges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(edges_addr, edges_numEdges * 8); - for (int i = 0, off = 0; i < edges_numEdges; i++, off += 8) { - edges[i] = new PointFloat(bb, off); - edges[i].read(); - } - } - } - - public void write() { - edges_buf = ByteBuffer.allocateDirect(edges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < edges.length; i++, off += 8) { - edges[i].setBuffer(edges_buf, off); - edges[i].write(); - } - backing.putInt(4, edges.length); - putPointer(backing, 0, edges_buf); - } - - public int size() { - return 8; - } - } - - public static class EdgeOptions extends DisposedStruct { - public int threshold; // Specifies the threshold value for the contrast of - // the edge. - public int width; // The number of pixels that the function averages to find - // the contrast at either side of the edge. - public int steepness; // The span, in pixels, of the slope of the edge - // projected along the path specified by the input - // points. - public InterpolationMethod subpixelType; // The method for interpolating. - public int subpixelDivisions; // The number of samples the function obtains - // from a pixel. - - private void init() { - - } - - public EdgeOptions() { - super(20); - init(); - } - - public EdgeOptions(int threshold, int width, int steepness, InterpolationMethod subpixelType, - int subpixelDivisions) { - super(20); - this.threshold = threshold; - this.width = width; - this.steepness = steepness; - this.subpixelType = subpixelType; - this.subpixelDivisions = subpixelDivisions; - } - - protected EdgeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected EdgeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - threshold = backing.getInt(0); - width = backing.getInt(4); - steepness = backing.getInt(8); - subpixelType = InterpolationMethod.fromValue(backing.getInt(12)); - subpixelDivisions = backing.getInt(16); - } - - public void write() { - backing.putInt(0, threshold); - backing.putInt(4, width); - backing.putInt(8, steepness); - if (subpixelType != null) - backing.putInt(12, subpixelType.getValue()); - backing.putInt(16, subpixelDivisions); - } - - public int size() { - return 20; - } - } - - public static class EdgeReport extends DisposedStruct { - public float location; // The location of the edge from the first point in - // the points array. - public float contrast; // The contrast at the edge. - public PolarityType polarity; // The polarity of the edge. - public float reserved; // This element is reserved. - public PointFloat coordinate; // The coordinates of the edge. - - private void init() { - coordinate = new PointFloat(backing, 20); - } - - public EdgeReport() { - super(32); - init(); - } - - public EdgeReport(double location, double contrast, PolarityType polarity, double reserved, - PointFloat coordinate) { - super(32); - this.location = (float) location; - this.contrast = (float) contrast; - this.polarity = polarity; - this.reserved = (float) reserved; - this.coordinate = coordinate; - } - - protected EdgeReport(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected EdgeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - location = backing.getFloat(0); - contrast = backing.getFloat(4); - polarity = PolarityType.fromValue(backing.getInt(8)); - reserved = backing.getFloat(16); - coordinate.read(); - } - - public void write() { - backing.putFloat(0, location); - backing.putFloat(4, contrast); - if (polarity != null) - backing.putInt(8, polarity.getValue()); - backing.putFloat(16, reserved); - coordinate.write(); - } - - public int size() { - return 32; - } - } - - public static class ExtremeReport extends DisposedStruct { - public double location; // The locations of the extreme. - public double amplitude; // The amplitude of the extreme. - public double secondDerivative; // The second derivative of the extreme. - - private void init() { - - } - - public ExtremeReport() { - super(24); - init(); - } - - public ExtremeReport(double location, double amplitude, double secondDerivative) { - super(24); - this.location = location; - this.amplitude = amplitude; - this.secondDerivative = secondDerivative; - } - - protected ExtremeReport(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected ExtremeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - location = backing.getDouble(0); - amplitude = backing.getDouble(8); - secondDerivative = backing.getDouble(16); - } - - public void write() { - backing.putDouble(0, location); - backing.putDouble(8, amplitude); - backing.putDouble(16, secondDerivative); - } - - public int size() { - return 24; - } - } - - public static class FitLineOptions extends DisposedStruct { - public float minScore; // Specifies the required quality of the fitted line. - public float pixelRadius; // Specifies the neighborhood pixel relationship - // for the initial subset of points being used. - public int numRefinements; // Specifies the number of refinement iterations - // you allow the function to perform on the - // initial subset of points. - - private void init() { - - } - - public FitLineOptions() { - super(12); - init(); - } - - public FitLineOptions(double minScore, double pixelRadius, int numRefinements) { - super(12); - this.minScore = (float) minScore; - this.pixelRadius = (float) pixelRadius; - this.numRefinements = numRefinements; - } - - protected FitLineOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected FitLineOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - minScore = backing.getFloat(0); - pixelRadius = backing.getFloat(4); - numRefinements = backing.getInt(8); - } - - public void write() { - backing.putFloat(0, minScore); - backing.putFloat(4, pixelRadius); - backing.putInt(8, numRefinements); - } - - public int size() { - return 12; - } - } - - public static class DisplayMapping extends DisposedStruct { - public MappingMethod method; // Describes the method for converting 16-bit - // pixels to 8-bit pixels. - public int minimumValue; // When method is IMAQ_RANGE, minimumValue - // represents the value that is mapped to 0. - public int maximumValue; // When method is IMAQ_RANGE, maximumValue - // represents the value that is mapped to 255. - public int shiftCount; // When method is IMAQ_DOWNSHIFT, shiftCount - // represents the number of bits the function - // right-shifts the 16-bit pixel values. - - private void init() { - - } - - public DisplayMapping() { - super(16); - init(); - } - - public DisplayMapping(MappingMethod method, int minimumValue, int maximumValue, int shiftCount) { - super(16); - this.method = method; - this.minimumValue = minimumValue; - this.maximumValue = maximumValue; - this.shiftCount = shiftCount; - } - - protected DisplayMapping(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected DisplayMapping(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - method = MappingMethod.fromValue(backing.getInt(0)); - minimumValue = backing.getInt(4); - maximumValue = backing.getInt(8); - shiftCount = backing.getInt(12); - } - - public void write() { - if (method != null) - backing.putInt(0, method.getValue()); - backing.putInt(4, minimumValue); - backing.putInt(8, maximumValue); - backing.putInt(12, shiftCount); - } - - public int size() { - return 16; - } - } - - public static class DetectExtremesOptions extends DisposedStruct { - public double threshold; // Defines which extremes are too small. - public int width; // Specifies the number of consecutive data points the - // function uses in the quadratic least-squares fit. - - private void init() { - - } - - public DetectExtremesOptions() { - super(16); - init(); - } - - public DetectExtremesOptions(double threshold, int width) { - super(16); - this.threshold = threshold; - this.width = width; - } - - protected DetectExtremesOptions(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected DetectExtremesOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - threshold = backing.getDouble(0); - width = backing.getInt(8); - } - - public void write() { - backing.putDouble(0, threshold); - backing.putInt(8, width); - } - - public int size() { - return 16; - } - } - - public static class ImageInfo extends DisposedStruct { - public CalibrationUnit imageUnit; // If you set calibration information with - // imaqSetSimpleCalibrationInfo(), - // imageUnit is the calibration unit. - public float stepX; // If you set calibration information with - // imaqSetCalibrationInfo(), stepX is the distance in - // the calibration unit between two pixels in the x - // direction. - public float stepY; // If you set calibration information with - // imaqSetCalibrationInfo(), stepY is the distance in - // the calibration unit between two pixels in the y - // direction. - public ImageType imageType; // The type of the image. - public int xRes; // The number of columns in the image. - public int yRes; // The number of rows in the image. - public int xOffset; // If you set mask offset information with - // imaqSetMaskOffset(), xOffset is the offset of the - // mask origin in the x direction. - public int yOffset; // If you set mask offset information with - // imaqSetMaskOffset(), yOffset is the offset of the - // mask origin in the y direction. - public int border; // The number of border pixels around the image. - public int pixelsPerLine; // The number of pixels stored for each line of - // the image. - - private void init() { - - } - - public ImageInfo() { - super(52); - init(); - } - - public ImageInfo(CalibrationUnit imageUnit, double stepX, double stepY, ImageType imageType, - int xRes, int yRes, int xOffset, int yOffset, int border, int pixelsPerLine) { - super(52); - this.imageUnit = imageUnit; - this.stepX = (float) stepX; - this.stepY = (float) stepY; - this.imageType = imageType; - this.xRes = xRes; - this.yRes = yRes; - this.xOffset = xOffset; - this.yOffset = yOffset; - this.border = border; - this.pixelsPerLine = pixelsPerLine; - } - - protected ImageInfo(ByteBuffer backing, int offset) { - super(backing, offset, 52); - init(); - } - - protected ImageInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 52); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 52); - } - - public void read() { - imageUnit = CalibrationUnit.fromValue(backing.getInt(0)); - stepX = backing.getFloat(4); - stepY = backing.getFloat(8); - imageType = ImageType.fromValue(backing.getInt(12)); - xRes = backing.getInt(16); - yRes = backing.getInt(20); - xOffset = backing.getInt(24); - yOffset = backing.getInt(28); - border = backing.getInt(32); - pixelsPerLine = backing.getInt(36); - } - - public void write() { - if (imageUnit != null) - backing.putInt(0, imageUnit.getValue()); - backing.putFloat(4, stepX); - backing.putFloat(8, stepY); - if (imageType != null) - backing.putInt(12, imageType.getValue()); - backing.putInt(16, xRes); - backing.putInt(20, yRes); - backing.putInt(24, xOffset); - backing.putInt(28, yOffset); - backing.putInt(32, border); - backing.putInt(36, pixelsPerLine); - } - - public int size() { - return 52; - } - } - - public static class LCDOptions extends DisposedStruct { - public int litSegments; // Set this parameter to TRUE if the segments are - // brighter than the background. - public float threshold; // Determines whether a segment is ON or OFF. - public int sign; // Indicates whether the function must read the sign of the - // indicator. - public int decimalPoint; // Determines whether to look for a decimal - // separator after each digit. - - private void init() { - - } - - public LCDOptions() { - super(16); - init(); - } - - public LCDOptions(int litSegments, double threshold, int sign, int decimalPoint) { - super(16); - this.litSegments = litSegments; - this.threshold = (float) threshold; - this.sign = sign; - this.decimalPoint = decimalPoint; - } - - protected LCDOptions(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected LCDOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - litSegments = backing.getInt(0); - threshold = backing.getFloat(4); - sign = backing.getInt(8); - decimalPoint = backing.getInt(12); - } - - public void write() { - backing.putInt(0, litSegments); - backing.putFloat(4, threshold); - backing.putInt(8, sign); - backing.putInt(12, decimalPoint); - } - - public int size() { - return 16; - } - } - - public static class LCDReport extends DisposedStruct { - public String text; // A string of the characters of the LCD. - public LCDSegments[] segmentInfo; // An array of LCDSegment structures - // describing which segments of each digit - // are on. - private ByteBuffer text_buf; - private ByteBuffer segmentInfo_buf; - - private void init() { - segmentInfo = new LCDSegments[0]; - } - - public LCDReport() { - super(16); - init(); - } - - public LCDReport(String text, LCDSegments[] segmentInfo) { - super(16); - this.text = text; - this.segmentInfo = segmentInfo; - } - - protected LCDReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected LCDReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - long text_addr = getPointer(backing, 0); - if (text_addr == 0) - text = null; - else { - ByteBuffer bb = newDirectByteBuffer(text_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - text = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - text = ""; - } - } - - int segmentInfo_numCharacters = backing.getInt(8); - long segmentInfo_addr = getPointer(backing, 4); - segmentInfo = new LCDSegments[segmentInfo_numCharacters]; - if (segmentInfo_numCharacters > 0 && segmentInfo_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(segmentInfo_addr, segmentInfo_numCharacters * 4); - for (int i = 0, off = 0; i < segmentInfo_numCharacters; i++, off += 4) { - segmentInfo[i] = new LCDSegments(bb, off); - segmentInfo[i].read(); - } - } - } - - public void write() { - if (text != null) { - byte[] text_bytes; - try { - text_bytes = text.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - text_bytes = new byte[0]; - } - text_buf = ByteBuffer.allocateDirect(text_bytes.length + 1); - putBytes(text_buf, text_bytes, 0, text_bytes.length).put(text_bytes.length, (byte) 0); - } - putPointer(backing, 0, text == null ? 0 : getByteBufferAddress(text_buf)); - segmentInfo_buf = - ByteBuffer.allocateDirect(segmentInfo.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < segmentInfo.length; i++, off += 4) { - segmentInfo[i].setBuffer(segmentInfo_buf, off); - segmentInfo[i].write(); - } - backing.putInt(8, segmentInfo.length); - putPointer(backing, 4, segmentInfo_buf); - } - - public int size() { - return 16; - } - } - - public static class LCDSegments extends DisposedStruct { - - - private void init() { - - } - - public LCDSegments() { - super(4); - init(); - } - - protected LCDSegments(ByteBuffer backing, int offset) { - super(backing, offset, 4); - init(); - } - - protected LCDSegments(long nativeObj, boolean owned) { - super(nativeObj, owned, 4); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 4); - } - - public void read() { - - } - - public void write() { - - } - - public int size() { - return 4; - } - } - - public static class LearnCalibrationOptions extends DisposedStruct { - public CalibrationMode mode; // Specifies the type of algorithm you want to - // use to reduce distortion in your image. - public ScalingMethod method; // Defines the scaling method correction - // functions use to correct the image. - public CalibrationROI roi; // Specifies the ROI correction functions use - // when correcting an image. - public int learnMap; // Set this element to TRUE if you want the function to - // calculate and store an error map during the learning - // process. - public int learnTable; // Set this element to TRUE if you want the function - // to calculate and store the correction table. - - private void init() { - - } - - public LearnCalibrationOptions() { - super(20); - init(); - } - - public LearnCalibrationOptions(CalibrationMode mode, ScalingMethod method, CalibrationROI roi, - int learnMap, int learnTable) { - super(20); - this.mode = mode; - this.method = method; - this.roi = roi; - this.learnMap = learnMap; - this.learnTable = learnTable; - } - - protected LearnCalibrationOptions(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected LearnCalibrationOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - mode = CalibrationMode.fromValue(backing.getInt(0)); - method = ScalingMethod.fromValue(backing.getInt(4)); - roi = CalibrationROI.fromValue(backing.getInt(8)); - learnMap = backing.getInt(12); - learnTable = backing.getInt(16); - } - - public void write() { - if (mode != null) - backing.putInt(0, mode.getValue()); - if (method != null) - backing.putInt(4, method.getValue()); - if (roi != null) - backing.putInt(8, roi.getValue()); - backing.putInt(12, learnMap); - backing.putInt(16, learnTable); - } - - public int size() { - return 20; - } - } - - public static class LearnColorPatternOptions extends DisposedStruct { - public LearningMode learnMode; // Specifies the invariance mode the function - // uses when learning the pattern. - public ImageFeatureMode featureMode; // Specifies the features the function - // uses when learning the color - // pattern. - public int threshold; // Specifies the saturation threshold the function - // uses to distinguish between two colors that have - // the same hue values. - public ColorIgnoreMode ignoreMode; // Specifies whether the function - // excludes certain colors from the color - // features of the template image. - public ColorInformation[] colorsToIgnore; // An array of ColorInformation - // structures providing a set of - // colors to exclude from the - // color features of the template - // image. - private ByteBuffer colorsToIgnore_buf; - - private void init() { - colorsToIgnore = new ColorInformation[0]; - } - - public LearnColorPatternOptions() { - super(24); - init(); - } - - public LearnColorPatternOptions(LearningMode learnMode, ImageFeatureMode featureMode, - int threshold, ColorIgnoreMode ignoreMode, ColorInformation[] colorsToIgnore) { - super(24); - this.learnMode = learnMode; - this.featureMode = featureMode; - this.threshold = threshold; - this.ignoreMode = ignoreMode; - this.colorsToIgnore = colorsToIgnore; - } - - protected LearnColorPatternOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected LearnColorPatternOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - learnMode = LearningMode.fromValue(backing.getInt(0)); - featureMode = ImageFeatureMode.fromValue(backing.getInt(4)); - threshold = backing.getInt(8); - ignoreMode = ColorIgnoreMode.fromValue(backing.getInt(12)); - int colorsToIgnore_numColorsToIgnore = backing.getInt(20); - long colorsToIgnore_addr = getPointer(backing, 16); - colorsToIgnore = new ColorInformation[colorsToIgnore_numColorsToIgnore]; - if (colorsToIgnore_numColorsToIgnore > 0 && colorsToIgnore_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(colorsToIgnore_addr, colorsToIgnore_numColorsToIgnore * 12); - for (int i = 0, off = 0; i < colorsToIgnore_numColorsToIgnore; i++, off += 12) { - colorsToIgnore[i] = new ColorInformation(bb, off); - colorsToIgnore[i].read(); - } - } - } - - public void write() { - if (learnMode != null) - backing.putInt(0, learnMode.getValue()); - if (featureMode != null) - backing.putInt(4, featureMode.getValue()); - backing.putInt(8, threshold); - if (ignoreMode != null) - backing.putInt(12, ignoreMode.getValue()); - colorsToIgnore_buf = - ByteBuffer.allocateDirect(colorsToIgnore.length * 12).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < colorsToIgnore.length; i++, off += 12) { - colorsToIgnore[i].setBuffer(colorsToIgnore_buf, off); - colorsToIgnore[i].write(); - } - backing.putInt(20, colorsToIgnore.length); - putPointer(backing, 16, colorsToIgnore_buf); - } - - public int size() { - return 24; - } - } - - public static class Line extends DisposedStruct { - public Point start; // The coordinate location of the start of the line. - public Point end; // The coordinate location of the end of the line. - - private void init() { - start = new Point(backing, 0); - end = new Point(backing, 8); - } - - public Line() { - super(16); - init(); - } - - public Line(Point start, Point end) { - super(16); - this.start = start; - this.end = end; - } - - protected Line(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected Line(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - start.read(); - end.read(); - } - - public void write() { - start.write(); - end.write(); - } - - public int size() { - return 16; - } - } - - public static class LinearAverages extends DisposedStruct { - public float[] columnAverages; // An array containing the mean pixel value - // of each column. - public float[] rowAverages; // An array containing the mean pixel value of - // each row. - public float[] risingDiagAverages; // An array containing the mean pixel - // value of each diagonal running from - // the lower left to the upper right of - // the inspected area of the image. - public float[] fallingDiagAverages; // An array containing the mean pixel - // value of each diagonal running from - // the upper left to the lower right of - // the inspected area of the image. - private ByteBuffer columnAverages_buf; - private ByteBuffer rowAverages_buf; - private ByteBuffer risingDiagAverages_buf; - private ByteBuffer fallingDiagAverages_buf; - - private void init() { - columnAverages = new float[0]; - rowAverages = new float[0]; - risingDiagAverages = new float[0]; - fallingDiagAverages = new float[0]; - } - - public LinearAverages() { - super(32); - init(); - } - - public LinearAverages(float[] columnAverages, float[] rowAverages, float[] risingDiagAverages, - float[] fallingDiagAverages) { - super(32); - this.columnAverages = columnAverages; - this.rowAverages = rowAverages; - this.risingDiagAverages = risingDiagAverages; - this.fallingDiagAverages = fallingDiagAverages; - } - - protected LinearAverages(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected LinearAverages(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - int columnAverages_columnCount = backing.getInt(4); - long columnAverages_addr = getPointer(backing, 0); - columnAverages = new float[columnAverages_columnCount]; - if (columnAverages_columnCount > 0 && columnAverages_addr != 0) { - newDirectByteBuffer(columnAverages_addr, columnAverages_columnCount * 4).asFloatBuffer() - .get(columnAverages); - } - int rowAverages_rowCount = backing.getInt(12); - long rowAverages_addr = getPointer(backing, 8); - rowAverages = new float[rowAverages_rowCount]; - if (rowAverages_rowCount > 0 && rowAverages_addr != 0) { - newDirectByteBuffer(rowAverages_addr, rowAverages_rowCount * 4).asFloatBuffer().get( - rowAverages); - } - int risingDiagAverages_risingDiagCount = backing.getInt(20); - long risingDiagAverages_addr = getPointer(backing, 16); - risingDiagAverages = new float[risingDiagAverages_risingDiagCount]; - if (risingDiagAverages_risingDiagCount > 0 && risingDiagAverages_addr != 0) { - newDirectByteBuffer(risingDiagAverages_addr, risingDiagAverages_risingDiagCount * 4) - .asFloatBuffer().get(risingDiagAverages); - } - int fallingDiagAverages_fallingDiagCount = backing.getInt(28); - long fallingDiagAverages_addr = getPointer(backing, 24); - fallingDiagAverages = new float[fallingDiagAverages_fallingDiagCount]; - if (fallingDiagAverages_fallingDiagCount > 0 && fallingDiagAverages_addr != 0) { - newDirectByteBuffer(fallingDiagAverages_addr, fallingDiagAverages_fallingDiagCount * 4) - .asFloatBuffer().get(fallingDiagAverages); - } - } - - public void write() { - columnAverages_buf = - ByteBuffer.allocateDirect(columnAverages.length * 4).order(ByteOrder.nativeOrder()); - columnAverages_buf.asFloatBuffer().put(columnAverages).rewind(); - backing.putInt(4, columnAverages.length); - putPointer(backing, 0, columnAverages_buf); - rowAverages_buf = - ByteBuffer.allocateDirect(rowAverages.length * 4).order(ByteOrder.nativeOrder()); - rowAverages_buf.asFloatBuffer().put(rowAverages).rewind(); - backing.putInt(12, rowAverages.length); - putPointer(backing, 8, rowAverages_buf); - risingDiagAverages_buf = - ByteBuffer.allocateDirect(risingDiagAverages.length * 4).order(ByteOrder.nativeOrder()); - risingDiagAverages_buf.asFloatBuffer().put(risingDiagAverages).rewind(); - backing.putInt(20, risingDiagAverages.length); - putPointer(backing, 16, risingDiagAverages_buf); - fallingDiagAverages_buf = - ByteBuffer.allocateDirect(fallingDiagAverages.length * 4).order(ByteOrder.nativeOrder()); - fallingDiagAverages_buf.asFloatBuffer().put(fallingDiagAverages).rewind(); - backing.putInt(28, fallingDiagAverages.length); - putPointer(backing, 24, fallingDiagAverages_buf); - } - - public int size() { - return 32; - } - } - - public static class LineProfile extends DisposedStruct { - public float[] profileData; // An array containing the value of each pixel - // in the line. - public Rect boundingBox; // The bounding rectangle of the line. - public float min; // The smallest pixel value in the line profile. - public float max; // The largest pixel value in the line profile. - public float mean; // The mean value of the pixels in the line profile. - public float stdDev; // The standard deviation of the line profile. - private ByteBuffer profileData_buf; - - private void init() { - profileData = new float[0]; - boundingBox = new Rect(backing, 4); - } - - public LineProfile() { - super(40); - init(); - } - - public LineProfile(float[] profileData, Rect boundingBox, double min, double max, double mean, - double stdDev) { - super(40); - this.profileData = profileData; - this.boundingBox = boundingBox; - this.min = (float) min; - this.max = (float) max; - this.mean = (float) mean; - this.stdDev = (float) stdDev; - } - - protected LineProfile(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected LineProfile(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - int profileData_dataCount = backing.getInt(36); - long profileData_addr = getPointer(backing, 0); - profileData = new float[profileData_dataCount]; - if (profileData_dataCount > 0 && profileData_addr != 0) { - newDirectByteBuffer(profileData_addr, profileData_dataCount * 4).asFloatBuffer().get( - profileData); - } - boundingBox.read(); - min = backing.getFloat(20); - max = backing.getFloat(24); - mean = backing.getFloat(28); - stdDev = backing.getFloat(32); - } - - public void write() { - profileData_buf = - ByteBuffer.allocateDirect(profileData.length * 4).order(ByteOrder.nativeOrder()); - profileData_buf.asFloatBuffer().put(profileData).rewind(); - backing.putInt(36, profileData.length); - putPointer(backing, 0, profileData_buf); - boundingBox.write(); - backing.putFloat(20, min); - backing.putFloat(24, max); - backing.putFloat(28, mean); - backing.putFloat(32, stdDev); - } - - public int size() { - return 40; - } - } - - public static class MatchColorPatternOptions extends DisposedStruct { - public MatchingMode matchMode; // Specifies the method to use when looking - // for the color pattern in the image. - public ImageFeatureMode featureMode; // Specifies the features to use when - // looking for the color pattern in the - // image. - public int minContrast; // Specifies the minimum contrast expected in the - // image. - public int subpixelAccuracy; // Set this parameter to TRUE to return areas - // in the image that match the pattern area - // with subpixel accuracy. - public RotationAngleRange[] angleRanges; // An array of angle ranges, in - // degrees, where each range - // specifies how much you expect - // the pattern to be rotated in the - // image. - public double colorWeight; // Determines the percent contribution of the - // color score to the final color pattern - // matching score. - public ColorSensitivity sensitivity; // Specifies the sensitivity of the - // color information in the image. - public SearchStrategy strategy; // Specifies how the color features of the - // image are used during the search phase. - public int numMatchesRequested; // Number of valid matches expected. - public float minMatchScore; // The minimum score a match can have for the - // function to consider the match valid. - private ByteBuffer angleRanges_buf; - - private void init() { - angleRanges = new RotationAngleRange[0]; - } - - public MatchColorPatternOptions() { - super(48); - init(); - } - - public MatchColorPatternOptions(MatchingMode matchMode, ImageFeatureMode featureMode, - int minContrast, int subpixelAccuracy, RotationAngleRange[] angleRanges, - double colorWeight, ColorSensitivity sensitivity, SearchStrategy strategy, - int numMatchesRequested, double minMatchScore) { - super(48); - this.matchMode = matchMode; - this.featureMode = featureMode; - this.minContrast = minContrast; - this.subpixelAccuracy = subpixelAccuracy; - this.angleRanges = angleRanges; - this.colorWeight = colorWeight; - this.sensitivity = sensitivity; - this.strategy = strategy; - this.numMatchesRequested = numMatchesRequested; - this.minMatchScore = (float) minMatchScore; - } - - protected MatchColorPatternOptions(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected MatchColorPatternOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - matchMode = MatchingMode.fromValue(backing.getInt(0)); - featureMode = ImageFeatureMode.fromValue(backing.getInt(4)); - minContrast = backing.getInt(8); - subpixelAccuracy = backing.getInt(12); - int angleRanges_numRanges = backing.getInt(20); - long angleRanges_addr = getPointer(backing, 16); - angleRanges = new RotationAngleRange[angleRanges_numRanges]; - if (angleRanges_numRanges > 0 && angleRanges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numRanges * 8); - for (int i = 0, off = 0; i < angleRanges_numRanges; i++, off += 8) { - angleRanges[i] = new RotationAngleRange(bb, off); - angleRanges[i].read(); - } - } - colorWeight = backing.getDouble(24); - sensitivity = ColorSensitivity.fromValue(backing.getInt(32)); - strategy = SearchStrategy.fromValue(backing.getInt(36)); - numMatchesRequested = backing.getInt(40); - minMatchScore = backing.getFloat(44); - } - - public void write() { - if (matchMode != null) - backing.putInt(0, matchMode.getValue()); - if (featureMode != null) - backing.putInt(4, featureMode.getValue()); - backing.putInt(8, minContrast); - backing.putInt(12, subpixelAccuracy); - angleRanges_buf = - ByteBuffer.allocateDirect(angleRanges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < angleRanges.length; i++, off += 8) { - angleRanges[i].setBuffer(angleRanges_buf, off); - angleRanges[i].write(); - } - backing.putInt(20, angleRanges.length); - putPointer(backing, 16, angleRanges_buf); - backing.putDouble(24, colorWeight); - if (sensitivity != null) - backing.putInt(32, sensitivity.getValue()); - if (strategy != null) - backing.putInt(36, strategy.getValue()); - backing.putInt(40, numMatchesRequested); - backing.putFloat(44, minMatchScore); - } - - public int size() { - return 48; - } - } - - public static class HistogramReport extends DisposedStruct { - public int[] histogram; // An array describing the number of pixels that - // fell into each class. - public float min; // The smallest pixel value that the function classified. - public float max; // The largest pixel value that the function classified. - public float start; // The smallest pixel value that fell into the first - // class. - public float width; // The size of each class. - public float mean; // The mean value of the pixels that the function - // classified. - public float stdDev; // The standard deviation of the pixels that the - // function classified. - public int numPixels; // The number of pixels that the function classified. - private ByteBuffer histogram_buf; - - private void init() { - histogram = new int[0]; - } - - public HistogramReport() { - super(36); - init(); - } - - public HistogramReport(int[] histogram, double min, double max, double start, double width, - double mean, double stdDev, int numPixels) { - super(36); - this.histogram = histogram; - this.min = (float) min; - this.max = (float) max; - this.start = (float) start; - this.width = (float) width; - this.mean = (float) mean; - this.stdDev = (float) stdDev; - this.numPixels = numPixels; - } - - protected HistogramReport(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected HistogramReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - int histogram_histogramCount = backing.getInt(4); - long histogram_addr = getPointer(backing, 0); - histogram = new int[histogram_histogramCount]; - if (histogram_histogramCount > 0 && histogram_addr != 0) { - newDirectByteBuffer(histogram_addr, histogram_histogramCount * 4).asIntBuffer().get( - histogram); - } - min = backing.getFloat(8); - max = backing.getFloat(12); - start = backing.getFloat(16); - width = backing.getFloat(20); - mean = backing.getFloat(24); - stdDev = backing.getFloat(28); - numPixels = backing.getInt(32); - } - - public void write() { - histogram_buf = - ByteBuffer.allocateDirect(histogram.length * 4).order(ByteOrder.nativeOrder()); - histogram_buf.asIntBuffer().put(histogram).rewind(); - backing.putInt(4, histogram.length); - putPointer(backing, 0, histogram_buf); - backing.putFloat(8, min); - backing.putFloat(12, max); - backing.putFloat(16, start); - backing.putFloat(20, width); - backing.putFloat(24, mean); - backing.putFloat(28, stdDev); - backing.putInt(32, numPixels); - } - - public int size() { - return 36; - } - } - - public static class ArcInfo extends DisposedStruct { - public Rect boundingBox; // The coordinate location of the bounding box of - // the arc. - public double startAngle; // The counterclockwise angle from the x-axis in - // degrees to the start of the arc. - public double endAngle; // The counterclockwise angle from the x-axis in - // degrees to the end of the arc. - - private void init() { - boundingBox = new Rect(backing, 0); - } - - public ArcInfo() { - super(32); - init(); - } - - public ArcInfo(Rect boundingBox, double startAngle, double endAngle) { - super(32); - this.boundingBox = boundingBox; - this.startAngle = startAngle; - this.endAngle = endAngle; - } - - protected ArcInfo(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected ArcInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - boundingBox.read(); - startAngle = backing.getDouble(16); - endAngle = backing.getDouble(24); - } - - public void write() { - boundingBox.write(); - backing.putDouble(16, startAngle); - backing.putDouble(24, endAngle); - } - - public int size() { - return 32; - } - } - - public static class AxisReport extends DisposedStruct { - public PointFloat origin; // The origin of the coordinate system, which is - // the intersection of the two axes of the - // coordinate system. - public PointFloat mainAxisEnd; // The end of the main axis, which is the - // result of the computation of the - // intersection of the main axis with the - // rectangular search area. - public PointFloat secondaryAxisEnd; // The end of the secondary axis, which - // is the result of the computation of - // the intersection of the secondary - // axis with the rectangular search - // area. - - private void init() { - origin = new PointFloat(backing, 0); - mainAxisEnd = new PointFloat(backing, 8); - secondaryAxisEnd = new PointFloat(backing, 16); - } - - public AxisReport() { - super(24); - init(); - } - - public AxisReport(PointFloat origin, PointFloat mainAxisEnd, PointFloat secondaryAxisEnd) { - super(24); - this.origin = origin; - this.mainAxisEnd = mainAxisEnd; - this.secondaryAxisEnd = secondaryAxisEnd; - } - - protected AxisReport(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected AxisReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - origin.read(); - mainAxisEnd.read(); - secondaryAxisEnd.read(); - } - - public void write() { - origin.write(); - mainAxisEnd.write(); - secondaryAxisEnd.write(); - } - - public int size() { - return 24; - } - } - - public static class BarcodeInfo extends DisposedStruct { - public String outputString; // A string containing the decoded barcode data. - public int size; // The size of the output string. - public byte outputChar1; // The contents of this character depend on the - // barcode type. - public byte outputChar2; // The contents of this character depend on the - // barcode type. - public double confidenceLevel; // A quality measure of the decoded barcode - // ranging from 0 to 100, with 100 being the - // best. - public BarcodeType type; // The type of barcode. - private ByteBuffer outputString_buf; - - private void init() { - - } - - public BarcodeInfo() { - super(32); - init(); - } - - public BarcodeInfo(String outputString, int size, byte outputChar1, byte outputChar2, - double confidenceLevel, BarcodeType type) { - super(32); - this.outputString = outputString; - this.size = size; - this.outputChar1 = outputChar1; - this.outputChar2 = outputChar2; - this.confidenceLevel = confidenceLevel; - this.type = type; - } - - protected BarcodeInfo(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected BarcodeInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - long outputString_addr = getPointer(backing, 0); - if (outputString_addr == 0) - outputString = null; - else { - ByteBuffer bb = newDirectByteBuffer(outputString_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - outputString = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - outputString = ""; - } - } - - size = backing.getInt(4); - outputChar1 = backing.get(8); - outputChar2 = backing.get(9); - confidenceLevel = backing.getDouble(16); - type = BarcodeType.fromValue(backing.getInt(24)); - } - - public void write() { - if (outputString != null) { - byte[] outputString_bytes; - try { - outputString_bytes = outputString.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - outputString_bytes = new byte[0]; - } - outputString_buf = ByteBuffer.allocateDirect(outputString_bytes.length + 1); - putBytes(outputString_buf, outputString_bytes, 0, outputString_bytes.length).put( - outputString_bytes.length, (byte) 0); - } - putPointer(backing, 0, outputString == null ? 0 : getByteBufferAddress(outputString_buf)); - backing.putInt(4, size); - backing.put(8, outputChar1); - backing.put(9, outputChar2); - backing.putDouble(16, confidenceLevel); - if (type != null) - backing.putInt(24, type.getValue()); - } - - public int size() { - return 32; - } - } - - public static class BCGOptions extends DisposedStruct { - public float brightness; // Adjusts the brightness of the image. - public float contrast; // Adjusts the contrast of the image. - public float gamma; // Performs gamma correction. - - private void init() { - - } - - public BCGOptions() { - super(12); - init(); - } - - public BCGOptions(double brightness, double contrast, double gamma) { - super(12); - this.brightness = (float) brightness; - this.contrast = (float) contrast; - this.gamma = (float) gamma; - } - - protected BCGOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected BCGOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - brightness = backing.getFloat(0); - contrast = backing.getFloat(4); - gamma = backing.getFloat(8); - } - - public void write() { - backing.putFloat(0, brightness); - backing.putFloat(4, contrast); - backing.putFloat(8, gamma); - } - - public int size() { - return 12; - } - } - - public static class BestCircle extends DisposedStruct { - public PointFloat center; // The coordinate location of the center of the - // circle. - public double radius; // The radius of the circle. - public double area; // The area of the circle. - public double perimeter; // The length of the perimeter of the circle. - public double error; // Represents the least square error of the fitted - // circle to the entire set of points. - - private void init() { - center = new PointFloat(backing, 0); - } - - public BestCircle() { - super(40); - init(); - } - - public BestCircle(PointFloat center, double radius, double area, double perimeter, double error) { - super(40); - this.center = center; - this.radius = radius; - this.area = area; - this.perimeter = perimeter; - this.error = error; - } - - protected BestCircle(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected BestCircle(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - center.read(); - radius = backing.getDouble(8); - area = backing.getDouble(16); - perimeter = backing.getDouble(24); - error = backing.getDouble(32); - } - - public void write() { - center.write(); - backing.putDouble(8, radius); - backing.putDouble(16, area); - backing.putDouble(24, perimeter); - backing.putDouble(32, error); - } - - public int size() { - return 40; - } - } - - public static class BestEllipse extends DisposedStruct { - public PointFloat center; // The coordinate location of the center of the - // ellipse. - public PointFloat majorAxisStart; // The coordinate location of the start of - // the major axis of the ellipse. - public PointFloat majorAxisEnd; // The coordinate location of the end of the - // major axis of the ellipse. - public PointFloat minorAxisStart; // The coordinate location of the start of - // the minor axis of the ellipse. - public PointFloat minorAxisEnd; // The coordinate location of the end of the - // minor axis of the ellipse. - public double area; // The area of the ellipse. - public double perimeter; // The length of the perimeter of the ellipse. - - private void init() { - center = new PointFloat(backing, 0); - majorAxisStart = new PointFloat(backing, 8); - majorAxisEnd = new PointFloat(backing, 16); - minorAxisStart = new PointFloat(backing, 24); - minorAxisEnd = new PointFloat(backing, 32); - } - - public BestEllipse() { - super(56); - init(); - } - - public BestEllipse(PointFloat center, PointFloat majorAxisStart, PointFloat majorAxisEnd, - PointFloat minorAxisStart, PointFloat minorAxisEnd, double area, double perimeter) { - super(56); - this.center = center; - this.majorAxisStart = majorAxisStart; - this.majorAxisEnd = majorAxisEnd; - this.minorAxisStart = minorAxisStart; - this.minorAxisEnd = minorAxisEnd; - this.area = area; - this.perimeter = perimeter; - } - - protected BestEllipse(ByteBuffer backing, int offset) { - super(backing, offset, 56); - init(); - } - - protected BestEllipse(long nativeObj, boolean owned) { - super(nativeObj, owned, 56); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 56); - } - - public void read() { - center.read(); - majorAxisStart.read(); - majorAxisEnd.read(); - minorAxisStart.read(); - minorAxisEnd.read(); - area = backing.getDouble(40); - perimeter = backing.getDouble(48); - } - - public void write() { - center.write(); - majorAxisStart.write(); - majorAxisEnd.write(); - minorAxisStart.write(); - minorAxisEnd.write(); - backing.putDouble(40, area); - backing.putDouble(48, perimeter); - } - - public int size() { - return 56; - } - } - - public static class BestLine extends DisposedStruct { - public PointFloat start; // The coordinate location of the start of the - // line. - public PointFloat end; // The coordinate location of the end of the line. - public LineEquation equation; // Defines the three coefficients of the - // equation of the best fit line. - public int valid; // This element is TRUE if the function achieved the - // minimum score within the number of allowed refinement - // iterations and FALSE if the function did not achieve - // the minimum score. - public double error; // Represents the least square error of the fitted line - // to the entire set of points. - public int[] pointsUsed; // An array of the indexes for the points array - // indicating which points the function used to fit - // the line. - private ByteBuffer pointsUsed_buf; - - private void init() { - start = new PointFloat(backing, 0); - end = new PointFloat(backing, 8); - equation = new LineEquation(backing, 16); - pointsUsed = new int[0]; - } - - public BestLine() { - super(64); - init(); - } - - public BestLine(PointFloat start, PointFloat end, LineEquation equation, int valid, - double error, int[] pointsUsed) { - super(64); - this.start = start; - this.end = end; - this.equation = equation; - this.valid = valid; - this.error = error; - this.pointsUsed = pointsUsed; - } - - protected BestLine(ByteBuffer backing, int offset) { - super(backing, offset, 64); - init(); - } - - protected BestLine(long nativeObj, boolean owned) { - super(nativeObj, owned, 64); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 64); - } - - public void read() { - start.read(); - end.read(); - equation.read(); - valid = backing.getInt(40); - error = backing.getDouble(48); - int pointsUsed_numPointsUsed = backing.getInt(60); - long pointsUsed_addr = getPointer(backing, 56); - pointsUsed = new int[pointsUsed_numPointsUsed]; - if (pointsUsed_numPointsUsed > 0 && pointsUsed_addr != 0) { - newDirectByteBuffer(pointsUsed_addr, pointsUsed_numPointsUsed * 4).asIntBuffer().get( - pointsUsed); - } - } - - public void write() { - start.write(); - end.write(); - equation.write(); - backing.putInt(40, valid); - backing.putDouble(48, error); - pointsUsed_buf = - ByteBuffer.allocateDirect(pointsUsed.length * 4).order(ByteOrder.nativeOrder()); - pointsUsed_buf.asIntBuffer().put(pointsUsed).rewind(); - backing.putInt(60, pointsUsed.length); - putPointer(backing, 56, pointsUsed_buf); - } - - public int size() { - return 64; - } - } - - public static class BrowserOptions extends DisposedStruct { - public int width; // The width to make the browser. - public int height; // The height to make the browser image. - public int imagesPerLine; // The number of images to place on a single line. - public RGBValue backgroundColor; // The background color of the browser. - public int frameSize; // Specifies the number of pixels with which to border - // each thumbnail. - public BrowserFrameStyle style; // The style for the frame around each - // thumbnail. - public float ratio; // Specifies the width to height ratio of each - // thumbnail. - public RGBValue focusColor; // The color to use to display focused cells. - - private void init() { - backgroundColor = new RGBValue(backing, 12); - focusColor = new RGBValue(backing, 28); - } - - public BrowserOptions() { - super(32); - init(); - } - - public BrowserOptions(int width, int height, int imagesPerLine, RGBValue backgroundColor, - int frameSize, BrowserFrameStyle style, double ratio, RGBValue focusColor) { - super(32); - this.width = width; - this.height = height; - this.imagesPerLine = imagesPerLine; - this.backgroundColor = backgroundColor; - this.frameSize = frameSize; - this.style = style; - this.ratio = (float) ratio; - this.focusColor = focusColor; - } - - protected BrowserOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected BrowserOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - width = backing.getInt(0); - height = backing.getInt(4); - imagesPerLine = backing.getInt(8); - backgroundColor.read(); - frameSize = backing.getInt(16); - style = BrowserFrameStyle.fromValue(backing.getInt(20)); - ratio = backing.getFloat(24); - focusColor.read(); - } - - public void write() { - backing.putInt(0, width); - backing.putInt(4, height); - backing.putInt(8, imagesPerLine); - backgroundColor.write(); - backing.putInt(16, frameSize); - if (style != null) - backing.putInt(20, style.getValue()); - backing.putFloat(24, ratio); - focusColor.write(); - } - - public int size() { - return 32; - } - } - - public static class CoordinateSystem extends DisposedStruct { - public PointFloat origin; // The origin of the coordinate system. - public float angle; // The angle, in degrees, of the x-axis of the - // coordinate system relative to the image x-axis. - public AxisOrientation axisOrientation; // The direction of the y-axis of - // the coordinate reference system. - - private void init() { - origin = new PointFloat(backing, 0); - } - - public CoordinateSystem() { - super(16); - init(); - } - - public CoordinateSystem(PointFloat origin, double angle, AxisOrientation axisOrientation) { - super(16); - this.origin = origin; - this.angle = (float) angle; - this.axisOrientation = axisOrientation; - } - - protected CoordinateSystem(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CoordinateSystem(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - origin.read(); - angle = backing.getFloat(8); - axisOrientation = AxisOrientation.fromValue(backing.getInt(12)); - } - - public void write() { - origin.write(); - backing.putFloat(8, angle); - if (axisOrientation != null) - backing.putInt(12, axisOrientation.getValue()); - } - - public int size() { - return 16; - } - } - - public static class CalibrationInfo extends DisposedStruct { - public int mapColumns; // The number of columns in the error map. - public int mapRows; // The number of rows in the error map. - public ROI userRoi; // Specifies the ROI the user provided when learning the - // calibration. - public ROI calibrationRoi; // Specifies the ROI that corresponds to the - // region of the image where the calibration - // information is accurate. - public LearnCalibrationOptions options; // Specifies the calibration options - // the user provided when learning - // the calibration. - public GridDescriptor grid; // Specifies the scaling constants for the - // image. - public CoordinateSystem system; // Specifies the coordinate system for the - // real world coordinates. - public RangeFloat range; // The range of the grayscale the function used to - // represent the circles in the grid image. - public float quality; // The quality score of the learning process, which is - // a value between 0-1000. - - private void init() { - options = new LearnCalibrationOptions(backing, 20); - grid = new GridDescriptor(backing, 40); - system = new CoordinateSystem(backing, 52); - range = new RangeFloat(backing, 68); - } - - public CalibrationInfo() { - super(80); - init(); - } - - public CalibrationInfo(int mapColumns, int mapRows, ROI userRoi, ROI calibrationRoi, - LearnCalibrationOptions options, GridDescriptor grid, CoordinateSystem system, - RangeFloat range, double quality) { - super(80); - this.mapColumns = mapColumns; - this.mapRows = mapRows; - this.userRoi = userRoi; - this.calibrationRoi = calibrationRoi; - this.options = options; - this.grid = grid; - this.system = system; - this.range = range; - this.quality = (float) quality; - } - - protected CalibrationInfo(ByteBuffer backing, int offset) { - super(backing, offset, 80); - init(); - } - - protected CalibrationInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 80); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 80); - } - - public void read() { - mapColumns = backing.getInt(4); - mapRows = backing.getInt(8); - long userRoi_addr = getPointer(backing, 12); - if (userRoi_addr == 0) - userRoi = null; - else - userRoi = new ROI(userRoi_addr, false); - long calibrationRoi_addr = getPointer(backing, 16); - if (calibrationRoi_addr == 0) - calibrationRoi = null; - else - calibrationRoi = new ROI(calibrationRoi_addr, false); - options.read(); - grid.read(); - system.read(); - range.read(); - quality = backing.getFloat(76); - } - - public void write() { - backing.putInt(4, mapColumns); - backing.putInt(8, mapRows); - putPointer(backing, 12, userRoi); - putPointer(backing, 16, calibrationRoi); - options.write(); - grid.write(); - system.write(); - range.write(); - backing.putFloat(76, quality); - } - - public int size() { - return 80; - } - } - - public static class CalibrationPoints extends DisposedStruct { - public PointFloat[] pixelCoordinates; // The array of pixel coordinates. - public PointFloat[] realWorldCoordinates; // The array of corresponding - // real-world coordinates. - private ByteBuffer pixelCoordinates_buf; - private ByteBuffer realWorldCoordinates_buf; - - private void init() { - pixelCoordinates = new PointFloat[0]; - realWorldCoordinates = new PointFloat[0]; - } - - public CalibrationPoints() { - super(12); - init(); - } - - public CalibrationPoints(PointFloat[] pixelCoordinates, PointFloat[] realWorldCoordinates) { - super(12); - this.pixelCoordinates = pixelCoordinates; - this.realWorldCoordinates = realWorldCoordinates; - } - - protected CalibrationPoints(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected CalibrationPoints(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - int pixelCoordinates_numCoordinates = backing.getInt(8); - long pixelCoordinates_addr = getPointer(backing, 0); - pixelCoordinates = new PointFloat[pixelCoordinates_numCoordinates]; - if (pixelCoordinates_numCoordinates > 0 && pixelCoordinates_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(pixelCoordinates_addr, pixelCoordinates_numCoordinates * 8); - for (int i = 0, off = 0; i < pixelCoordinates_numCoordinates; i++, off += 8) { - pixelCoordinates[i] = new PointFloat(bb, off); - pixelCoordinates[i].read(); - } - } - int realWorldCoordinates_numCoordinates = backing.getInt(8); - long realWorldCoordinates_addr = getPointer(backing, 4); - realWorldCoordinates = new PointFloat[realWorldCoordinates_numCoordinates]; - if (realWorldCoordinates_numCoordinates > 0 && realWorldCoordinates_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(realWorldCoordinates_addr, realWorldCoordinates_numCoordinates * 8); - for (int i = 0, off = 0; i < realWorldCoordinates_numCoordinates; i++, off += 8) { - realWorldCoordinates[i] = new PointFloat(bb, off); - realWorldCoordinates[i].read(); - } - } - } - - public void write() { - pixelCoordinates_buf = - ByteBuffer.allocateDirect(pixelCoordinates.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < pixelCoordinates.length; i++, off += 8) { - pixelCoordinates[i].setBuffer(pixelCoordinates_buf, off); - pixelCoordinates[i].write(); - } - backing.putInt(8, pixelCoordinates.length); - putPointer(backing, 0, pixelCoordinates_buf); - realWorldCoordinates_buf = - ByteBuffer.allocateDirect(realWorldCoordinates.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < realWorldCoordinates.length; i++, off += 8) { - realWorldCoordinates[i].setBuffer(realWorldCoordinates_buf, off); - realWorldCoordinates[i].write(); - } - backing.putInt(8, realWorldCoordinates.length); - putPointer(backing, 4, realWorldCoordinates_buf); - } - - public int size() { - return 12; - } - } - - public static class CaliperOptions extends DisposedStruct { - public TwoEdgePolarityType polarity; // Specifies the edge polarity of the - // edge pairs. - public float separation; // The distance between edge pairs. - public float separationDeviation; // Sets the range around the separation - // value. - - private void init() { - - } - - public CaliperOptions() { - super(12); - init(); - } - - public CaliperOptions(TwoEdgePolarityType polarity, double separation, - double separationDeviation) { - super(12); - this.polarity = polarity; - this.separation = (float) separation; - this.separationDeviation = (float) separationDeviation; - } - - protected CaliperOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected CaliperOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - polarity = TwoEdgePolarityType.fromValue(backing.getInt(0)); - separation = backing.getFloat(4); - separationDeviation = backing.getFloat(8); - } - - public void write() { - if (polarity != null) - backing.putInt(0, polarity.getValue()); - backing.putFloat(4, separation); - backing.putFloat(8, separationDeviation); - } - - public int size() { - return 12; - } - } - - public static class CaliperReport extends DisposedStruct { - public float edge1Contrast; // The contrast of the first edge. - public PointFloat edge1Coord; // The coordinates of the first edge. - public float edge2Contrast; // The contrast of the second edge. - public PointFloat edge2Coord; // The coordinates of the second edge. - public float separation; // The distance between the two edges. - - private void init() { - edge1Coord = new PointFloat(backing, 4); - edge2Coord = new PointFloat(backing, 16); - } - - public CaliperReport() { - super(32); - init(); - } - - public CaliperReport(double edge1Contrast, PointFloat edge1Coord, double edge2Contrast, - PointFloat edge2Coord, double separation) { - super(32); - this.edge1Contrast = (float) edge1Contrast; - this.edge1Coord = edge1Coord; - this.edge2Contrast = (float) edge2Contrast; - this.edge2Coord = edge2Coord; - this.separation = (float) separation; - } - - protected CaliperReport(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected CaliperReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - edge1Contrast = backing.getFloat(0); - edge1Coord.read(); - edge2Contrast = backing.getFloat(12); - edge2Coord.read(); - separation = backing.getFloat(24); - } - - public void write() { - backing.putFloat(0, edge1Contrast); - edge1Coord.write(); - backing.putFloat(12, edge2Contrast); - edge2Coord.write(); - backing.putFloat(24, separation); - } - - public int size() { - return 32; - } - } - - public static class DrawTextOptions extends DisposedStruct { - public String fontName; // The font name to use. - public int fontSize; // The size of the font. - public int bold; // Set this parameter to TRUE to bold text. - public int italic; // Set this parameter to TRUE to italicize text. - public int underline; // Set this parameter to TRUE to underline text. - public int strikeout; // Set this parameter to TRUE to strikeout text. - public TextAlignment textAlignment; // Sets the alignment of text. - public FontColor fontColor; // Sets the font color. - - private void init() { - - } - - public DrawTextOptions() { - super(60); - init(); - } - - public DrawTextOptions(String fontName, int fontSize, int bold, int italic, int underline, - int strikeout, TextAlignment textAlignment, FontColor fontColor) { - super(60); - this.fontName = fontName; - this.fontSize = fontSize; - this.bold = bold; - this.italic = italic; - this.underline = underline; - this.strikeout = strikeout; - this.textAlignment = textAlignment; - this.fontColor = fontColor; - } - - protected DrawTextOptions(ByteBuffer backing, int offset) { - super(backing, offset, 60); - init(); - } - - protected DrawTextOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 60); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 60); - } - - public void read() { - { - byte[] bytes = new byte[32]; - getBytes(backing, bytes, 0, 32); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - fontName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - fontName = ""; - } - } - fontSize = backing.getInt(32); - bold = backing.getInt(36); - italic = backing.getInt(40); - underline = backing.getInt(44); - strikeout = backing.getInt(48); - textAlignment = TextAlignment.fromValue(backing.getInt(52)); - fontColor = FontColor.fromValue(backing.getInt(56)); - } - - public void write() { - if (fontName != null) { - byte[] bytes; - try { - bytes = fontName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 0, bytes.length); - for (int i = bytes.length; i < 32; i++) - backing.put(i, (byte) 0); // fill with zero - } - backing.putInt(32, fontSize); - backing.putInt(36, bold); - backing.putInt(40, italic); - backing.putInt(44, underline); - backing.putInt(48, strikeout); - if (textAlignment != null) - backing.putInt(52, textAlignment.getValue()); - if (fontColor != null) - backing.putInt(56, fontColor.getValue()); - } - - public int size() { - return 60; - } - } - - public static class CircleReport extends DisposedStruct { - public Point center; // The coordinate point of the center of the circle. - public int radius; // The radius of the circle, in pixels. - public int area; // The area of the circle, in pixels. - - private void init() { - center = new Point(backing, 0); - } - - public CircleReport() { - super(16); - init(); - } - - public CircleReport(Point center, int radius, int area) { - super(16); - this.center = center; - this.radius = radius; - this.area = area; - } - - protected CircleReport(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CircleReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - center.read(); - radius = backing.getInt(8); - area = backing.getInt(12); - } - - public void write() { - center.write(); - backing.putInt(8, radius); - backing.putInt(12, area); - } - - public int size() { - return 16; - } - } - - public static class ClosedContour extends DisposedStruct { - public Point[] points; // The points that make up the closed contour. - private ByteBuffer points_buf; - - private void init() { - points = new Point[0]; - } - - public ClosedContour() { - super(8); - init(); - } - - public ClosedContour(Point[] points) { - super(8); - this.points = points; - } - - protected ClosedContour(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected ClosedContour(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int points_numPoints = backing.getInt(4); - long points_addr = getPointer(backing, 0); - points = new Point[points_numPoints]; - if (points_numPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints * 8); - for (int i = 0, off = 0; i < points_numPoints; i++, off += 8) { - points[i] = new Point(bb, off); - points[i].read(); - } - } - } - - public void write() { - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(4, points.length); - putPointer(backing, 0, points_buf); - } - - public int size() { - return 8; - } - } - - public static class ColorHistogramReport extends DisposedStruct { - public HistogramReport plane1; // The histogram report of the first color - // plane. - public HistogramReport plane2; // The histogram report of the second plane. - public HistogramReport plane3; // The histogram report of the third plane. - - private void init() { - plane1 = new HistogramReport(backing, 0); - plane2 = new HistogramReport(backing, 36); - plane3 = new HistogramReport(backing, 72); - } - - public ColorHistogramReport() { - super(108); - init(); - } - - public ColorHistogramReport(HistogramReport plane1, HistogramReport plane2, - HistogramReport plane3) { - super(108); - this.plane1 = plane1; - this.plane2 = plane2; - this.plane3 = plane3; - } - - protected ColorHistogramReport(ByteBuffer backing, int offset) { - super(backing, offset, 108); - init(); - } - - protected ColorHistogramReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 108); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 108); - } - - public void read() { - plane1.read(); - plane2.read(); - plane3.read(); - } - - public void write() { - plane1.write(); - plane2.write(); - plane3.write(); - } - - public int size() { - return 108; - } - } - - public static class ColorInformation extends DisposedStruct { - public int saturation; // The saturation level the function uses to learn - // the color information. - public double[] info; // An array of color information that represents the - // color spectrum analysis of a region of an image in - // a compact form. - private ByteBuffer info_buf; - - private void init() { - info = new double[0]; - } - - public ColorInformation() { - super(12); - init(); - } - - public ColorInformation(int saturation, double[] info) { - super(12); - this.saturation = saturation; - this.info = info; - } - - protected ColorInformation(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ColorInformation(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - saturation = backing.getInt(4); - int info_infoCount = backing.getInt(0); - long info_addr = getPointer(backing, 8); - info = new double[info_infoCount]; - if (info_infoCount > 0 && info_addr != 0) { - newDirectByteBuffer(info_addr, info_infoCount * 8).asDoubleBuffer().get(info); - } - } - - public void write() { - backing.putInt(4, saturation); - info_buf = ByteBuffer.allocateDirect(info.length * 8).order(ByteOrder.nativeOrder()); - info_buf.asDoubleBuffer().put(info).rewind(); - backing.putInt(0, info.length); - putPointer(backing, 8, info_buf); - } - - public int size() { - return 12; - } - } - - public static class Complex extends DisposedStruct { - public float r; // The real part of the value. - public float i; // The imaginary part of the value. - - private void init() { - - } - - public Complex() { - super(8); - init(); - } - - public Complex(double r, double i) { - super(8); - this.r = (float) r; - this.i = (float) i; - } - - protected Complex(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected Complex(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - r = backing.getFloat(0); - i = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, r); - backing.putFloat(4, i); - } - - public int size() { - return 8; - } - } - - public static class ConcentricRakeReport extends DisposedStruct { - public ArcInfo[] rakeArcs; // An array containing the location of each - // concentric arc line used for edge detection. - public PointFloat[] firstEdges; // The coordinate location of all edges - // detected as first edges. - public PointFloat[] lastEdges; // The coordinate location of all edges - // detected as last edges. - public EdgeLocationReport[] allEdges; // An array of reports describing the - // location of the edges located by - // each concentric rake arc line. - public int[] linesWithEdges; // An array of indices into the rakeArcs array - // indicating the concentric rake arc lines on - // which the function detected at least one - // edge. - private ByteBuffer rakeArcs_buf; - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer allEdges_buf; - private ByteBuffer linesWithEdges_buf; - - private void init() { - rakeArcs = new ArcInfo[0]; - firstEdges = new PointFloat[0]; - lastEdges = new PointFloat[0]; - allEdges = new EdgeLocationReport[0]; - linesWithEdges = new int[0]; - } - - public ConcentricRakeReport() { - super(36); - init(); - } - - public ConcentricRakeReport(ArcInfo[] rakeArcs, PointFloat[] firstEdges, - PointFloat[] lastEdges, EdgeLocationReport[] allEdges, int[] linesWithEdges) { - super(36); - this.rakeArcs = rakeArcs; - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.allEdges = allEdges; - this.linesWithEdges = linesWithEdges; - } - - protected ConcentricRakeReport(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected ConcentricRakeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - int rakeArcs_numArcs = backing.getInt(4); - long rakeArcs_addr = getPointer(backing, 0); - rakeArcs = new ArcInfo[rakeArcs_numArcs]; - if (rakeArcs_numArcs > 0 && rakeArcs_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(rakeArcs_addr, rakeArcs_numArcs * 32); - for (int i = 0, off = 0; i < rakeArcs_numArcs; i++, off += 32) { - rakeArcs[i] = new ArcInfo(bb, off); - rakeArcs[i].read(); - } - } - int firstEdges_numFirstEdges = backing.getInt(12); - long firstEdges_addr = getPointer(backing, 8); - firstEdges = new PointFloat[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 8); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 8) { - firstEdges[i] = new PointFloat(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(20); - long lastEdges_addr = getPointer(backing, 16); - lastEdges = new PointFloat[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 8); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 8) { - lastEdges[i] = new PointFloat(bb, off); - lastEdges[i].read(); - } - } - int allEdges_numLinesWithEdges = backing.getInt(32); - long allEdges_addr = getPointer(backing, 24); - allEdges = new EdgeLocationReport[allEdges_numLinesWithEdges]; - if (allEdges_numLinesWithEdges > 0 && allEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges * 8); - for (int i = 0, off = 0; i < allEdges_numLinesWithEdges; i++, off += 8) { - allEdges[i] = new EdgeLocationReport(bb, off); - allEdges[i].read(); - } - } - int linesWithEdges_numLinesWithEdges = backing.getInt(32); - long linesWithEdges_addr = getPointer(backing, 28); - linesWithEdges = new int[linesWithEdges_numLinesWithEdges]; - if (linesWithEdges_numLinesWithEdges > 0 && linesWithEdges_addr != 0) { - newDirectByteBuffer(linesWithEdges_addr, linesWithEdges_numLinesWithEdges * 4) - .asIntBuffer().get(linesWithEdges); - } - } - - public void write() { - rakeArcs_buf = ByteBuffer.allocateDirect(rakeArcs.length * 32).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < rakeArcs.length; i++, off += 32) { - rakeArcs[i].setBuffer(rakeArcs_buf, off); - rakeArcs[i].write(); - } - backing.putInt(4, rakeArcs.length); - putPointer(backing, 0, rakeArcs_buf); - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 8) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(12, firstEdges.length); - putPointer(backing, 8, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 8) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(20, lastEdges.length); - putPointer(backing, 16, lastEdges_buf); - allEdges_buf = ByteBuffer.allocateDirect(allEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allEdges.length; i++, off += 8) { - allEdges[i].setBuffer(allEdges_buf, off); - allEdges[i].write(); - } - backing.putInt(32, allEdges.length); - putPointer(backing, 24, allEdges_buf); - linesWithEdges_buf = - ByteBuffer.allocateDirect(linesWithEdges.length * 4).order(ByteOrder.nativeOrder()); - linesWithEdges_buf.asIntBuffer().put(linesWithEdges).rewind(); - backing.putInt(32, linesWithEdges.length); - putPointer(backing, 28, linesWithEdges_buf); - } - - public int size() { - return 36; - } - } - - public static class ConstructROIOptions extends DisposedStruct { - public int windowNumber; // The window number of the image window. - public String windowTitle; // Specifies the message string that the function - // displays in the title bar of the window. - public PaletteType type; // The palette type to use. - public RGBValue[] palette; // If type is IMAQ_PALETTE_USER, this array is - // the palette of colors to use with the window. - private ByteBuffer windowTitle_buf; - private ByteBuffer palette_buf; - - private void init() { - palette = new RGBValue[0]; - } - - public ConstructROIOptions() { - super(20); - init(); - } - - public ConstructROIOptions(int windowNumber, String windowTitle, PaletteType type, - RGBValue[] palette) { - super(20); - this.windowNumber = windowNumber; - this.windowTitle = windowTitle; - this.type = type; - this.palette = palette; - } - - protected ConstructROIOptions(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected ConstructROIOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - windowNumber = backing.getInt(0); - long windowTitle_addr = getPointer(backing, 4); - if (windowTitle_addr == 0) - windowTitle = null; - else { - ByteBuffer bb = newDirectByteBuffer(windowTitle_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - windowTitle = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - windowTitle = ""; - } - } - - type = PaletteType.fromValue(backing.getInt(8)); - int palette_numColors = backing.getInt(16); - long palette_addr = getPointer(backing, 12); - palette = new RGBValue[palette_numColors]; - if (palette_numColors > 0 && palette_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(palette_addr, palette_numColors * 4); - for (int i = 0, off = 0; i < palette_numColors; i++, off += 4) { - palette[i] = new RGBValue(bb, off); - palette[i].read(); - } - } - } - - public void write() { - backing.putInt(0, windowNumber); - if (windowTitle != null) { - byte[] windowTitle_bytes; - try { - windowTitle_bytes = windowTitle.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - windowTitle_bytes = new byte[0]; - } - windowTitle_buf = ByteBuffer.allocateDirect(windowTitle_bytes.length + 1); - putBytes(windowTitle_buf, windowTitle_bytes, 0, windowTitle_bytes.length).put( - windowTitle_bytes.length, (byte) 0); - } - putPointer(backing, 4, windowTitle == null ? 0 : getByteBufferAddress(windowTitle_buf)); - if (type != null) - backing.putInt(8, type.getValue()); - palette_buf = ByteBuffer.allocateDirect(palette.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < palette.length; i++, off += 4) { - palette[i].setBuffer(palette_buf, off); - palette[i].write(); - } - backing.putInt(16, palette.length); - putPointer(backing, 12, palette_buf); - } - - public int size() { - return 20; - } - } - - public static class ContourInfo extends DisposedStruct { - public ContourType type; // The contour type. - public Point[] points; // The points describing the contour. - public RGBValue contourColor; // The contour color. - private ByteBuffer points_buf; - - private void init() { - points = new Point[0]; - contourColor = new RGBValue(backing, 12); - } - - public ContourInfo() { - super(16); - init(); - } - - public ContourInfo(ContourType type, Point[] points, RGBValue contourColor) { - super(16); - this.type = type; - this.points = points; - this.contourColor = contourColor; - } - - protected ContourInfo(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ContourInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - type = ContourType.fromValue(backing.getInt(0)); - int points_numPoints = backing.getInt(4); - long points_addr = getPointer(backing, 8); - points = new Point[points_numPoints]; - if (points_numPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints * 8); - for (int i = 0, off = 0; i < points_numPoints; i++, off += 8) { - points[i] = new Point(bb, off); - points[i].read(); - } - } - contourColor.read(); - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(4, points.length); - putPointer(backing, 8, points_buf); - contourColor.write(); - } - - public int size() { - return 16; - } - } - - public static class ContourInfo2 extends DisposedStruct { - public ContourType type; // The contour type. - public RGBValue color; // The contour color. - public Point point; // Use this member when the contour is of type - // IMAQ_POINT. - public Line line; // Use this member when the contour is of type IMAQ_LINE. - public Rect rect; // Use this member when the contour is of type IMAQ_RECT. - public Rect ovalBoundingBox; // Use this member when the contour is of type - // IMAQ_OVAL. - public ClosedContour closedContour; // Use this member when the contour is - // of type IMAQ_CLOSED_CONTOUR. - public OpenContour openContour; // Use this member when the contour is of - // type IMAQ_OPEN_CONTOUR. - public Annulus annulus; // Use this member when the contour is of type - // IMAQ_ANNULUS. - public RotatedRect rotatedRect; // Use this member when the contour is of - // type IMAQ_ROTATED_RECT. - - private void init() { - color = new RGBValue(backing, 4); - } - - public ContourInfo2() { - super(12); - init(); - } - - public ContourInfo2(ContourType type, RGBValue color) { - super(12); - this.type = type; - this.color = color; - } - - protected ContourInfo2(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected ContourInfo2(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - type = ContourType.fromValue(backing.getInt(0)); - color.read(); - if (type == ContourType.POINT) { - long point_addr = getPointer(backing, 8); - if (point_addr == 0) - point = null; - else - point = new Point(point_addr, false); - } - if (type == ContourType.LINE) { - long line_addr = getPointer(backing, 8); - if (line_addr == 0) - line = null; - else - line = new Line(line_addr, false); - } - if (type == ContourType.RECT) { - long rect_addr = getPointer(backing, 8); - if (rect_addr == 0) - rect = null; - else - rect = new Rect(rect_addr, false); - } - if (type == ContourType.OVAL) { - long ovalBoundingBox_addr = getPointer(backing, 8); - if (ovalBoundingBox_addr == 0) - ovalBoundingBox = null; - else - ovalBoundingBox = new Rect(ovalBoundingBox_addr, false); - } - if (type == ContourType.CLOSED_CONTOUR) { - long closedContour_addr = getPointer(backing, 8); - if (closedContour_addr == 0) - closedContour = null; - else - closedContour = new ClosedContour(closedContour_addr, false); - } - if (type == ContourType.OPEN_CONTOUR) { - long openContour_addr = getPointer(backing, 8); - if (openContour_addr == 0) - openContour = null; - else - openContour = new OpenContour(openContour_addr, false); - } - if (type == ContourType.ANNULUS) { - long annulus_addr = getPointer(backing, 8); - if (annulus_addr == 0) - annulus = null; - else - annulus = new Annulus(annulus_addr, false); - } - if (type == ContourType.ROTATED_RECT) { - long rotatedRect_addr = getPointer(backing, 8); - if (rotatedRect_addr == 0) - rotatedRect = null; - else - rotatedRect = new RotatedRect(rotatedRect_addr, false); - } - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - color.write(); - if (type == ContourType.POINT) { - putPointer(backing, 8, point); - } - if (type == ContourType.LINE) { - putPointer(backing, 8, line); - } - if (type == ContourType.RECT) { - putPointer(backing, 8, rect); - } - if (type == ContourType.OVAL) { - putPointer(backing, 8, ovalBoundingBox); - } - if (type == ContourType.CLOSED_CONTOUR) { - putPointer(backing, 8, closedContour); - } - if (type == ContourType.OPEN_CONTOUR) { - putPointer(backing, 8, openContour); - } - if (type == ContourType.ANNULUS) { - putPointer(backing, 8, annulus); - } - if (type == ContourType.ROTATED_RECT) { - putPointer(backing, 8, rotatedRect); - } - } - - public int size() { - return 12; - } - } - - public static class ContourPoint extends DisposedStruct { - public double x; // The x-coordinate value in the image. - public double y; // The y-coordinate value in the image. - public double curvature; // The change in slope at this edge point of the - // segment. - public double xDisplacement; // The x displacement of the current edge pixel - // from a cubic spline fit of the current edge - // segment. - public double yDisplacement; // The y displacement of the current edge pixel - // from a cubic spline fit of the current edge - // segment. - - private void init() { - - } - - public ContourPoint() { - super(40); - init(); - } - - public ContourPoint(double x, double y, double curvature, double xDisplacement, - double yDisplacement) { - super(40); - this.x = x; - this.y = y; - this.curvature = curvature; - this.xDisplacement = xDisplacement; - this.yDisplacement = yDisplacement; - } - - protected ContourPoint(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected ContourPoint(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - x = backing.getDouble(0); - y = backing.getDouble(8); - curvature = backing.getDouble(16); - xDisplacement = backing.getDouble(24); - yDisplacement = backing.getDouble(32); - } - - public void write() { - backing.putDouble(0, x); - backing.putDouble(8, y); - backing.putDouble(16, curvature); - backing.putDouble(24, xDisplacement); - backing.putDouble(32, yDisplacement); - } - - public int size() { - return 40; - } - } - - public static class CoordinateTransform extends DisposedStruct { - public Point initialOrigin; // The origin of the initial coordinate system. - public float initialAngle; // The angle, in degrees, of the x-axis of the - // initial coordinate system relative to the - // image x-axis. - public Point finalOrigin; // The origin of the final coordinate system. - public float finalAngle; // The angle, in degrees, of the x-axis of the - // final coordinate system relative to the image - // x-axis. - - private void init() { - initialOrigin = new Point(backing, 0); - finalOrigin = new Point(backing, 12); - } - - public CoordinateTransform() { - super(24); - init(); - } - - public CoordinateTransform(Point initialOrigin, double initialAngle, Point finalOrigin, - double finalAngle) { - super(24); - this.initialOrigin = initialOrigin; - this.initialAngle = (float) initialAngle; - this.finalOrigin = finalOrigin; - this.finalAngle = (float) finalAngle; - } - - protected CoordinateTransform(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected CoordinateTransform(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - initialOrigin.read(); - initialAngle = backing.getFloat(8); - finalOrigin.read(); - finalAngle = backing.getFloat(20); - } - - public void write() { - initialOrigin.write(); - backing.putFloat(8, initialAngle); - finalOrigin.write(); - backing.putFloat(20, finalAngle); - } - - public int size() { - return 24; - } - } - - public static class CoordinateTransform2 extends DisposedStruct { - public CoordinateSystem referenceSystem; // Defines the coordinate system - // for input coordinates. - public CoordinateSystem measurementSystem; // Defines the coordinate system - // in which the function should - // perform measurements. - - private void init() { - referenceSystem = new CoordinateSystem(backing, 0); - measurementSystem = new CoordinateSystem(backing, 16); - } - - public CoordinateTransform2() { - super(32); - init(); - } - - public CoordinateTransform2(CoordinateSystem referenceSystem, CoordinateSystem measurementSystem) { - super(32); - this.referenceSystem = referenceSystem; - this.measurementSystem = measurementSystem; - } - - protected CoordinateTransform2(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected CoordinateTransform2(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - referenceSystem.read(); - measurementSystem.read(); - } - - public void write() { - referenceSystem.write(); - measurementSystem.write(); - } - - public int size() { - return 32; - } - } - - public static class CannyOptions extends DisposedStruct { - public float sigma; // The sigma of the Gaussian smoothing filter that the - // function applies to the image before edge detection. - public float upperThreshold; // The upper fraction of pixel values in the - // image from which the function chooses a seed - // or starting point of an edge segment. - public float lowerThreshold; // The function multiplies this value by - // upperThreshold to determine the lower - // threshold for all the pixels in an edge - // segment. - public int windowSize; // The window size of the Gaussian filter that the - // function applies to the image. - - private void init() { - - } - - public CannyOptions() { - super(16); - init(); - } - - public CannyOptions(double sigma, double upperThreshold, double lowerThreshold, int windowSize) { - super(16); - this.sigma = (float) sigma; - this.upperThreshold = (float) upperThreshold; - this.lowerThreshold = (float) lowerThreshold; - this.windowSize = windowSize; - } - - protected CannyOptions(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected CannyOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - sigma = backing.getFloat(0); - upperThreshold = backing.getFloat(4); - lowerThreshold = backing.getFloat(8); - windowSize = backing.getInt(12); - } - - public void write() { - backing.putFloat(0, sigma); - backing.putFloat(4, upperThreshold); - backing.putFloat(8, lowerThreshold); - backing.putInt(12, windowSize); - } - - public int size() { - return 16; - } - } - - public static class Range extends DisposedStruct { - public int minValue; // The minimum value of the range. - public int maxValue; // The maximum value of the range. - - private void init() { - - } - - public Range() { - super(8); - init(); - } - - public Range(int minValue, int maxValue) { - super(8); - this.minValue = minValue; - this.maxValue = maxValue; - } - - protected Range(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected Range(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - minValue = backing.getInt(0); - maxValue = backing.getInt(4); - } - - public void write() { - backing.putInt(0, minValue); - backing.putInt(4, maxValue); - } - - public int size() { - return 8; - } - } - - public static class UserPointSymbol extends DisposedStruct { - public int cols; // Number of columns in the symbol. - public int rows; // Number of rows in the symbol. - - private void init() { - - } - - public UserPointSymbol() { - super(12); - init(); - } - - public UserPointSymbol(int cols, int rows) { - super(12); - this.cols = cols; - this.rows = rows; - } - - protected UserPointSymbol(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected UserPointSymbol(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - cols = backing.getInt(0); - rows = backing.getInt(4); - } - - public void write() { - backing.putInt(0, cols); - backing.putInt(4, rows); - } - - public int size() { - return 12; - } - } - - public static class View3DOptions extends DisposedStruct { - public int sizeReduction; // A divisor the function uses when determining - // the final height and width of the 3D image. - public int maxHeight; // Defines the maximum height of a pixel from the - // image source drawn in 3D. - public Direction3D direction; // Defines the 3D orientation. - public float alpha; // Determines the angle between the horizontal and the - // baseline. - public float beta; // Determines the angle between the horizontal and the - // second baseline. - public int border; // Defines the border size. - public int background; // Defines the background color. - public Plane3D plane; // Indicates the view a function uses to show complex - // images. - - private void init() { - - } - - public View3DOptions() { - super(32); - init(); - } - - public View3DOptions(int sizeReduction, int maxHeight, Direction3D direction, double alpha, - double beta, int border, int background, Plane3D plane) { - super(32); - this.sizeReduction = sizeReduction; - this.maxHeight = maxHeight; - this.direction = direction; - this.alpha = (float) alpha; - this.beta = (float) beta; - this.border = border; - this.background = background; - this.plane = plane; - } - - protected View3DOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected View3DOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - sizeReduction = backing.getInt(0); - maxHeight = backing.getInt(4); - direction = Direction3D.fromValue(backing.getInt(8)); - alpha = backing.getFloat(12); - beta = backing.getFloat(16); - border = backing.getInt(20); - background = backing.getInt(24); - plane = Plane3D.fromValue(backing.getInt(28)); - } - - public void write() { - backing.putInt(0, sizeReduction); - backing.putInt(4, maxHeight); - if (direction != null) - backing.putInt(8, direction.getValue()); - backing.putFloat(12, alpha); - backing.putFloat(16, beta); - backing.putInt(20, border); - backing.putInt(24, background); - if (plane != null) - backing.putInt(28, plane.getValue()); - } - - public int size() { - return 32; - } - } - - public static class MatchPatternOptions extends DisposedStruct { - public MatchingMode mode; // Specifies the method to use when looking for - // the pattern in the image. - public int minContrast; // Specifies the minimum contrast expected in the - // image. - public int subpixelAccuracy; // Set this element to TRUE to return areas in - // the image that match the pattern area with - // subpixel accuracy. - public RotationAngleRange[] angleRanges; // An array of angle ranges, in - // degrees, where each range - // specifies how much you expect - // the pattern to be rotated in the - // image. - public int numMatchesRequested; // Number of valid matches expected. - public int matchFactor; // Controls the number of potential matches that the - // function examines. - public float minMatchScore; // The minimum score a match can have for the - // function to consider the match valid. - private ByteBuffer angleRanges_buf; - - private void init() { - angleRanges = new RotationAngleRange[0]; - } - - public MatchPatternOptions() { - super(32); - init(); - } - - public MatchPatternOptions(MatchingMode mode, int minContrast, int subpixelAccuracy, - RotationAngleRange[] angleRanges, int numMatchesRequested, int matchFactor, - double minMatchScore) { - super(32); - this.mode = mode; - this.minContrast = minContrast; - this.subpixelAccuracy = subpixelAccuracy; - this.angleRanges = angleRanges; - this.numMatchesRequested = numMatchesRequested; - this.matchFactor = matchFactor; - this.minMatchScore = (float) minMatchScore; - } - - protected MatchPatternOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected MatchPatternOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - mode = MatchingMode.fromValue(backing.getInt(0)); - minContrast = backing.getInt(4); - subpixelAccuracy = backing.getInt(8); - int angleRanges_numRanges = backing.getInt(16); - long angleRanges_addr = getPointer(backing, 12); - angleRanges = new RotationAngleRange[angleRanges_numRanges]; - if (angleRanges_numRanges > 0 && angleRanges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numRanges * 8); - for (int i = 0, off = 0; i < angleRanges_numRanges; i++, off += 8) { - angleRanges[i] = new RotationAngleRange(bb, off); - angleRanges[i].read(); - } - } - numMatchesRequested = backing.getInt(20); - matchFactor = backing.getInt(24); - minMatchScore = backing.getFloat(28); - } - - public void write() { - if (mode != null) - backing.putInt(0, mode.getValue()); - backing.putInt(4, minContrast); - backing.putInt(8, subpixelAccuracy); - angleRanges_buf = - ByteBuffer.allocateDirect(angleRanges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < angleRanges.length; i++, off += 8) { - angleRanges[i].setBuffer(angleRanges_buf, off); - angleRanges[i].write(); - } - backing.putInt(16, angleRanges.length); - putPointer(backing, 12, angleRanges_buf); - backing.putInt(20, numMatchesRequested); - backing.putInt(24, matchFactor); - backing.putFloat(28, minMatchScore); - } - - public int size() { - return 32; - } - } - - public static class TIFFFileOptions extends DisposedStruct { - public int rowsPerStrip; // Indicates the number of rows that the function - // writes per strip. - public PhotometricMode photoInterp; // Designates which photometric - // interpretation to use. - public TIFFCompressionType compressionType; // Indicates the type of - // compression to use on the - // TIFF file. - - private void init() { - - } - - public TIFFFileOptions() { - super(12); - init(); - } - - public TIFFFileOptions(int rowsPerStrip, PhotometricMode photoInterp, - TIFFCompressionType compressionType) { - super(12); - this.rowsPerStrip = rowsPerStrip; - this.photoInterp = photoInterp; - this.compressionType = compressionType; - } - - protected TIFFFileOptions(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected TIFFFileOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - rowsPerStrip = backing.getInt(0); - photoInterp = PhotometricMode.fromValue(backing.getInt(4)); - compressionType = TIFFCompressionType.fromValue(backing.getInt(8)); - } - - public void write() { - backing.putInt(0, rowsPerStrip); - if (photoInterp != null) - backing.putInt(4, photoInterp.getValue()); - if (compressionType != null) - backing.putInt(8, compressionType.getValue()); - } - - public int size() { - return 12; - } - } - - public static class OpenContour extends DisposedStruct { - public Point[] points; // The points that make up the open contour. - private ByteBuffer points_buf; - - private void init() { - points = new Point[0]; - } - - public OpenContour() { - super(8); - init(); - } - - public OpenContour(Point[] points) { - super(8); - this.points = points; - } - - protected OpenContour(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected OpenContour(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - int points_numPoints = backing.getInt(4); - long points_addr = getPointer(backing, 0); - points = new Point[points_numPoints]; - if (points_numPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints * 8); - for (int i = 0, off = 0; i < points_numPoints; i++, off += 8) { - points[i] = new Point(bb, off); - points[i].read(); - } - } - } - - public void write() { - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(4, points.length); - putPointer(backing, 0, points_buf); - } - - public int size() { - return 8; - } - } - - public static class OverlayTextOptions extends DisposedStruct { - public String fontName; // The name of the font to use. - public int fontSize; // The size of the font. - public int bold; // Set this element to TRUE to bold the text. - public int italic; // Set this element to TRUE to italicize the text. - public int underline; // Set this element to TRUE to underline the text. - public int strikeout; // Set this element to TRUE to strikeout the text. - public TextAlignment horizontalTextAlignment; // Sets the alignment of the - // text. - public VerticalTextAlignment verticalTextAlignment; // Sets the vertical - // alignment for the - // text. - public RGBValue backgroundColor; // Sets the color for the text background - // pixels. - public double angle; // The counterclockwise angle, in degrees, of the text - // relative to the x-axis. - private ByteBuffer fontName_buf; - - private void init() { - backgroundColor = new RGBValue(backing, 32); - } - - public OverlayTextOptions() { - super(48); - init(); - } - - public OverlayTextOptions(String fontName, int fontSize, int bold, int italic, int underline, - int strikeout, TextAlignment horizontalTextAlignment, - VerticalTextAlignment verticalTextAlignment, RGBValue backgroundColor, double angle) { - super(48); - this.fontName = fontName; - this.fontSize = fontSize; - this.bold = bold; - this.italic = italic; - this.underline = underline; - this.strikeout = strikeout; - this.horizontalTextAlignment = horizontalTextAlignment; - this.verticalTextAlignment = verticalTextAlignment; - this.backgroundColor = backgroundColor; - this.angle = angle; - } - - protected OverlayTextOptions(ByteBuffer backing, int offset) { - super(backing, offset, 48); - init(); - } - - protected OverlayTextOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 48); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 48); - } - - public void read() { - long fontName_addr = getPointer(backing, 0); - if (fontName_addr == 0) - fontName = null; - else { - ByteBuffer bb = newDirectByteBuffer(fontName_addr, 1000); // FIXME - while (bb.get() != 0) { - } - byte[] bytes = new byte[bb.position() - 1]; - getBytes(bb, bytes, 0, bytes.length); - try { - fontName = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - fontName = ""; - } - } - - fontSize = backing.getInt(4); - bold = backing.getInt(8); - italic = backing.getInt(12); - underline = backing.getInt(16); - strikeout = backing.getInt(20); - horizontalTextAlignment = TextAlignment.fromValue(backing.getInt(24)); - verticalTextAlignment = VerticalTextAlignment.fromValue(backing.getInt(28)); - backgroundColor.read(); - angle = backing.getDouble(40); - } - - public void write() { - if (fontName != null) { - byte[] fontName_bytes; - try { - fontName_bytes = fontName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fontName_bytes = new byte[0]; - } - fontName_buf = ByteBuffer.allocateDirect(fontName_bytes.length + 1); - putBytes(fontName_buf, fontName_bytes, 0, fontName_bytes.length).put(fontName_bytes.length, - (byte) 0); - } - putPointer(backing, 0, fontName == null ? 0 : getByteBufferAddress(fontName_buf)); - backing.putInt(4, fontSize); - backing.putInt(8, bold); - backing.putInt(12, italic); - backing.putInt(16, underline); - backing.putInt(20, strikeout); - if (horizontalTextAlignment != null) - backing.putInt(24, horizontalTextAlignment.getValue()); - if (verticalTextAlignment != null) - backing.putInt(28, verticalTextAlignment.getValue()); - backgroundColor.write(); - backing.putDouble(40, angle); - } - - public int size() { - return 48; - } - } - - public static class ParticleFilterCriteria extends DisposedStruct { - public MeasurementValue parameter; // The morphological measurement that the - // function uses for filtering. - public float lower; // The lower bound of the criteria range. - public float upper; // The upper bound of the criteria range. - public int exclude; // Set this element to TRUE to indicate that a match - // occurs when the value is outside the criteria range. - - private void init() { - - } - - public ParticleFilterCriteria() { - super(16); - init(); - } - - public ParticleFilterCriteria(MeasurementValue parameter, double lower, double upper, - int exclude) { - super(16); - this.parameter = parameter; - this.lower = (float) lower; - this.upper = (float) upper; - this.exclude = exclude; - } - - protected ParticleFilterCriteria(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ParticleFilterCriteria(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - parameter = MeasurementValue.fromValue(backing.getInt(0)); - lower = backing.getFloat(4); - upper = backing.getFloat(8); - exclude = backing.getInt(12); - } - - public void write() { - if (parameter != null) - backing.putInt(0, parameter.getValue()); - backing.putFloat(4, lower); - backing.putFloat(8, upper); - backing.putInt(12, exclude); - } - - public int size() { - return 16; - } - } - - public static class ParticleReport extends DisposedStruct { - public int area; // The number of pixels in the particle. - public float calibratedArea; // The size of the particle, calibrated to the - // calibration information of the image. - public float perimeter; // The length of the perimeter, calibrated to the - // calibration information of the image. - public int numHoles; // The number of holes in the particle. - public int areaOfHoles; // The total surface area, in pixels, of all the - // holes in a particle. - public float perimeterOfHoles; // The length of the perimeter of all the - // holes in the particle calibrated to the - // calibration information of the image. - public Rect boundingBox; // The smallest rectangle that encloses the - // particle. - public float sigmaX; // The sum of the particle pixels on the x-axis. - public float sigmaY; // The sum of the particle pixels on the y-axis. - public float sigmaXX; // The sum of the particle pixels on the x-axis, - // squared. - public float sigmaYY; // The sum of the particle pixels on the y-axis, - // squared. - public float sigmaXY; // The sum of the particle pixels on the x-axis and - // y-axis. - public int longestLength; // The length of the longest horizontal line - // segment. - public Point longestPoint; // The location of the leftmost pixel of the - // longest segment in the particle. - public int projectionX; // The length of the particle when projected onto - // the x-axis. - public int projectionY; // The length of the particle when projected onto - // the y-axis. - public int connect8; // This element is TRUE if the function used - // connectivity-8 to determine if particles are - // touching. - - private void init() { - boundingBox = new Rect(backing, 24); - longestPoint = new Point(backing, 64); - } - - public ParticleReport() { - super(84); - init(); - } - - public ParticleReport(int area, double calibratedArea, double perimeter, int numHoles, - int areaOfHoles, double perimeterOfHoles, Rect boundingBox, double sigmaX, double sigmaY, - double sigmaXX, double sigmaYY, double sigmaXY, int longestLength, Point longestPoint, - int projectionX, int projectionY, int connect8) { - super(84); - this.area = area; - this.calibratedArea = (float) calibratedArea; - this.perimeter = (float) perimeter; - this.numHoles = numHoles; - this.areaOfHoles = areaOfHoles; - this.perimeterOfHoles = (float) perimeterOfHoles; - this.boundingBox = boundingBox; - this.sigmaX = (float) sigmaX; - this.sigmaY = (float) sigmaY; - this.sigmaXX = (float) sigmaXX; - this.sigmaYY = (float) sigmaYY; - this.sigmaXY = (float) sigmaXY; - this.longestLength = longestLength; - this.longestPoint = longestPoint; - this.projectionX = projectionX; - this.projectionY = projectionY; - this.connect8 = connect8; - } - - protected ParticleReport(ByteBuffer backing, int offset) { - super(backing, offset, 84); - init(); - } - - protected ParticleReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 84); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 84); - } - - public void read() { - area = backing.getInt(0); - calibratedArea = backing.getFloat(4); - perimeter = backing.getFloat(8); - numHoles = backing.getInt(12); - areaOfHoles = backing.getInt(16); - perimeterOfHoles = backing.getFloat(20); - boundingBox.read(); - sigmaX = backing.getFloat(40); - sigmaY = backing.getFloat(44); - sigmaXX = backing.getFloat(48); - sigmaYY = backing.getFloat(52); - sigmaXY = backing.getFloat(56); - longestLength = backing.getInt(60); - longestPoint.read(); - projectionX = backing.getInt(72); - projectionY = backing.getInt(76); - connect8 = backing.getInt(80); - } - - public void write() { - backing.putInt(0, area); - backing.putFloat(4, calibratedArea); - backing.putFloat(8, perimeter); - backing.putInt(12, numHoles); - backing.putInt(16, areaOfHoles); - backing.putFloat(20, perimeterOfHoles); - boundingBox.write(); - backing.putFloat(40, sigmaX); - backing.putFloat(44, sigmaY); - backing.putFloat(48, sigmaXX); - backing.putFloat(52, sigmaYY); - backing.putFloat(56, sigmaXY); - backing.putInt(60, longestLength); - longestPoint.write(); - backing.putInt(72, projectionX); - backing.putInt(76, projectionY); - backing.putInt(80, connect8); - } - - public int size() { - return 84; - } - } - - public static class PatternMatch extends DisposedStruct { - public PointFloat position; // The location of the center of the match. - public float rotation; // The rotation of the match relative to the template - // image, in degrees. - public float scale; // The size of the match relative to the size of the - // template image, expressed as a percentage. - public float score; // The accuracy of the match. - public PointFloat[] corner; // An array of four points describing the - // rectangle surrounding the template image. - - private void init() { - position = new PointFloat(backing, 0); - corner = new PointFloat[4]; - - for (int i = 0, off = 20; i < 4; i++, off += 8) - corner[i] = new PointFloat(backing, off); - } - - public PatternMatch() { - super(52); - init(); - } - - public PatternMatch(PointFloat position, double rotation, double scale, double score, - PointFloat[] corner) { - super(52); - this.position = position; - this.rotation = (float) rotation; - this.scale = (float) scale; - this.score = (float) score; - this.corner = corner; - } - - protected PatternMatch(ByteBuffer backing, int offset) { - super(backing, offset, 52); - init(); - } - - protected PatternMatch(long nativeObj, boolean owned) { - super(nativeObj, owned, 52); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 52); - } - - public void read() { - position.read(); - rotation = backing.getFloat(8); - scale = backing.getFloat(12); - score = backing.getFloat(16); - for (PointFloat it : corner) { - it.read(); - } - } - - public void write() { - position.write(); - backing.putFloat(8, rotation); - backing.putFloat(12, scale); - backing.putFloat(16, score); - for (PointFloat it : corner) { - it.write(); - } - } - - public int size() { - return 52; - } - } - - public static class QuantifyData extends DisposedStruct { - public float mean; // The mean value of the pixel values. - public float stdDev; // The standard deviation of the pixel values. - public float min; // The smallest pixel value. - public float max; // The largest pixel value. - public float calibratedArea; // The area, calibrated to the calibration - // information of the image. - public int pixelArea; // The area, in number of pixels. - public float relativeSize; // The proportion, expressed as a percentage, of - // the associated region relative to the whole - // image. - - private void init() { - - } - - public QuantifyData() { - super(28); - init(); - } - - public QuantifyData(double mean, double stdDev, double min, double max, double calibratedArea, - int pixelArea, double relativeSize) { - super(28); - this.mean = (float) mean; - this.stdDev = (float) stdDev; - this.min = (float) min; - this.max = (float) max; - this.calibratedArea = (float) calibratedArea; - this.pixelArea = pixelArea; - this.relativeSize = (float) relativeSize; - } - - protected QuantifyData(ByteBuffer backing, int offset) { - super(backing, offset, 28); - init(); - } - - protected QuantifyData(long nativeObj, boolean owned) { - super(nativeObj, owned, 28); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 28); - } - - public void read() { - mean = backing.getFloat(0); - stdDev = backing.getFloat(4); - min = backing.getFloat(8); - max = backing.getFloat(12); - calibratedArea = backing.getFloat(16); - pixelArea = backing.getInt(20); - relativeSize = backing.getFloat(24); - } - - public void write() { - backing.putFloat(0, mean); - backing.putFloat(4, stdDev); - backing.putFloat(8, min); - backing.putFloat(12, max); - backing.putFloat(16, calibratedArea); - backing.putInt(20, pixelArea); - backing.putFloat(24, relativeSize); - } - - public int size() { - return 28; - } - } - - public static class QuantifyReport extends DisposedStruct { - public QuantifyData global; // Statistical data of the whole image. - public QuantifyData[] regions; // An array of QuantifyData structures - // containing statistical data of each region - // of the image. - private ByteBuffer regions_buf; - - private void init() { - global = new QuantifyData(backing, 0); - regions = new QuantifyData[0]; - } - - public QuantifyReport() { - super(36); - init(); - } - - public QuantifyReport(QuantifyData global, QuantifyData[] regions) { - super(36); - this.global = global; - this.regions = regions; - } - - protected QuantifyReport(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected QuantifyReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - global.read(); - int regions_regionCount = backing.getInt(32); - long regions_addr = getPointer(backing, 28); - regions = new QuantifyData[regions_regionCount]; - if (regions_regionCount > 0 && regions_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(regions_addr, regions_regionCount * 28); - for (int i = 0, off = 0; i < regions_regionCount; i++, off += 28) { - regions[i] = new QuantifyData(bb, off); - regions[i].read(); - } - } - } - - public void write() { - global.write(); - regions_buf = ByteBuffer.allocateDirect(regions.length * 28).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < regions.length; i++, off += 28) { - regions[i].setBuffer(regions_buf, off); - regions[i].write(); - } - backing.putInt(32, regions.length); - putPointer(backing, 28, regions_buf); - } - - public int size() { - return 36; - } - } - - public static class RakeOptions extends DisposedStruct { - public int threshold; // Specifies the threshold value for the contrast of - // the edge. - public int width; // The number of pixels that the function averages to find - // the contrast at either side of the edge. - public int steepness; // The span, in pixels, of the slope of the edge - // projected along the path specified by the input - // points. - public int subsamplingRatio; // Specifies the number of pixels that separate - // two consecutive search lines. - public InterpolationMethod subpixelType; // The method for interpolating. - public int subpixelDivisions; // The number of samples the function obtains - // from a pixel. - - private void init() { - - } - - public RakeOptions() { - super(24); - init(); - } - - public RakeOptions(int threshold, int width, int steepness, int subsamplingRatio, - InterpolationMethod subpixelType, int subpixelDivisions) { - super(24); - this.threshold = threshold; - this.width = width; - this.steepness = steepness; - this.subsamplingRatio = subsamplingRatio; - this.subpixelType = subpixelType; - this.subpixelDivisions = subpixelDivisions; - } - - protected RakeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected RakeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - threshold = backing.getInt(0); - width = backing.getInt(4); - steepness = backing.getInt(8); - subsamplingRatio = backing.getInt(12); - subpixelType = InterpolationMethod.fromValue(backing.getInt(16)); - subpixelDivisions = backing.getInt(20); - } - - public void write() { - backing.putInt(0, threshold); - backing.putInt(4, width); - backing.putInt(8, steepness); - backing.putInt(12, subsamplingRatio); - if (subpixelType != null) - backing.putInt(16, subpixelType.getValue()); - backing.putInt(20, subpixelDivisions); - } - - public int size() { - return 24; - } - } - - public static class RakeReport extends DisposedStruct { - public LineFloat[] rakeLines; // The coordinate location of each of the rake - // lines used by the function. - public PointFloat[] firstEdges; // The coordinate location of all edges - // detected as first edges. - public PointFloat[] lastEdges; // The coordinate location of all edges - // detected as last edges. - public EdgeLocationReport[] allEdges; // An array of reports describing the - // location of the edges located by - // each rake line. - public int[] linesWithEdges; // An array of indices into the rakeLines array - // indicating the rake lines on which the - // function detected at least one edge. - private ByteBuffer rakeLines_buf; - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer allEdges_buf; - private ByteBuffer linesWithEdges_buf; - - private void init() { - rakeLines = new LineFloat[0]; - firstEdges = new PointFloat[0]; - lastEdges = new PointFloat[0]; - allEdges = new EdgeLocationReport[0]; - linesWithEdges = new int[0]; - } - - public RakeReport() { - super(36); - init(); - } - - public RakeReport(LineFloat[] rakeLines, PointFloat[] firstEdges, PointFloat[] lastEdges, - EdgeLocationReport[] allEdges, int[] linesWithEdges) { - super(36); - this.rakeLines = rakeLines; - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.allEdges = allEdges; - this.linesWithEdges = linesWithEdges; - } - - protected RakeReport(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected RakeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - int rakeLines_numRakeLines = backing.getInt(4); - long rakeLines_addr = getPointer(backing, 0); - rakeLines = new LineFloat[rakeLines_numRakeLines]; - if (rakeLines_numRakeLines > 0 && rakeLines_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(rakeLines_addr, rakeLines_numRakeLines * 16); - for (int i = 0, off = 0; i < rakeLines_numRakeLines; i++, off += 16) { - rakeLines[i] = new LineFloat(bb, off); - rakeLines[i].read(); - } - } - int firstEdges_numFirstEdges = backing.getInt(12); - long firstEdges_addr = getPointer(backing, 8); - firstEdges = new PointFloat[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 8); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 8) { - firstEdges[i] = new PointFloat(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(20); - long lastEdges_addr = getPointer(backing, 16); - lastEdges = new PointFloat[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 8); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 8) { - lastEdges[i] = new PointFloat(bb, off); - lastEdges[i].read(); - } - } - int allEdges_numLinesWithEdges = backing.getInt(32); - long allEdges_addr = getPointer(backing, 24); - allEdges = new EdgeLocationReport[allEdges_numLinesWithEdges]; - if (allEdges_numLinesWithEdges > 0 && allEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges * 8); - for (int i = 0, off = 0; i < allEdges_numLinesWithEdges; i++, off += 8) { - allEdges[i] = new EdgeLocationReport(bb, off); - allEdges[i].read(); - } - } - int linesWithEdges_numLinesWithEdges = backing.getInt(32); - long linesWithEdges_addr = getPointer(backing, 28); - linesWithEdges = new int[linesWithEdges_numLinesWithEdges]; - if (linesWithEdges_numLinesWithEdges > 0 && linesWithEdges_addr != 0) { - newDirectByteBuffer(linesWithEdges_addr, linesWithEdges_numLinesWithEdges * 4) - .asIntBuffer().get(linesWithEdges); - } - } - - public void write() { - rakeLines_buf = - ByteBuffer.allocateDirect(rakeLines.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < rakeLines.length; i++, off += 16) { - rakeLines[i].setBuffer(rakeLines_buf, off); - rakeLines[i].write(); - } - backing.putInt(4, rakeLines.length); - putPointer(backing, 0, rakeLines_buf); - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 8) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(12, firstEdges.length); - putPointer(backing, 8, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 8) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(20, lastEdges.length); - putPointer(backing, 16, lastEdges_buf); - allEdges_buf = ByteBuffer.allocateDirect(allEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allEdges.length; i++, off += 8) { - allEdges[i].setBuffer(allEdges_buf, off); - allEdges[i].write(); - } - backing.putInt(32, allEdges.length); - putPointer(backing, 24, allEdges_buf); - linesWithEdges_buf = - ByteBuffer.allocateDirect(linesWithEdges.length * 4).order(ByteOrder.nativeOrder()); - linesWithEdges_buf.asIntBuffer().put(linesWithEdges).rewind(); - backing.putInt(32, linesWithEdges.length); - putPointer(backing, 28, linesWithEdges_buf); - } - - public int size() { - return 36; - } - } - - public static class TransformReport extends DisposedStruct { - public PointFloat[] points; // An array of transformed coordinates. - public int[] validPoints; // An array of values that describe the validity - // of each of the coordinates according to the - // region of interest you calibrated using either - // imaqLearnCalibrationGrid() or - // imaqLearnCalibrationPoints(). - private ByteBuffer points_buf; - private ByteBuffer validPoints_buf; - - private void init() { - points = new PointFloat[0]; - validPoints = new int[0]; - } - - public TransformReport() { - super(12); - init(); - } - - public TransformReport(PointFloat[] points, int[] validPoints) { - super(12); - this.points = points; - this.validPoints = validPoints; - } - - protected TransformReport(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected TransformReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - int points_numPoints = backing.getInt(8); - long points_addr = getPointer(backing, 0); - points = new PointFloat[points_numPoints]; - if (points_numPoints > 0 && points_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints * 8); - for (int i = 0, off = 0; i < points_numPoints; i++, off += 8) { - points[i] = new PointFloat(bb, off); - points[i].read(); - } - } - int validPoints_numPoints = backing.getInt(8); - long validPoints_addr = getPointer(backing, 4); - validPoints = new int[validPoints_numPoints]; - if (validPoints_numPoints > 0 && validPoints_addr != 0) { - newDirectByteBuffer(validPoints_addr, validPoints_numPoints * 4).asIntBuffer().get( - validPoints); - } - } - - public void write() { - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - backing.putInt(8, points.length); - putPointer(backing, 0, points_buf); - validPoints_buf = - ByteBuffer.allocateDirect(validPoints.length * 4).order(ByteOrder.nativeOrder()); - validPoints_buf.asIntBuffer().put(validPoints).rewind(); - backing.putInt(8, validPoints.length); - putPointer(backing, 4, validPoints_buf); - } - - public int size() { - return 12; - } - } - - public static class ShapeReport extends DisposedStruct { - public Rect coordinates; // The bounding rectangle of the object. - public Point centroid; // The coordinate location of the centroid of the - // object. - public int size; // The size, in pixels, of the object. - public double score; // A value ranging between 1 and 1,000 that specifies - // how similar the object in the image is to the - // template. - - private void init() { - coordinates = new Rect(backing, 0); - centroid = new Point(backing, 16); - } - - public ShapeReport() { - super(40); - init(); - } - - public ShapeReport(Rect coordinates, Point centroid, int size, double score) { - super(40); - this.coordinates = coordinates; - this.centroid = centroid; - this.size = size; - this.score = score; - } - - protected ShapeReport(ByteBuffer backing, int offset) { - super(backing, offset, 40); - init(); - } - - protected ShapeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 40); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 40); - } - - public void read() { - coordinates.read(); - centroid.read(); - size = backing.getInt(24); - score = backing.getDouble(32); - } - - public void write() { - coordinates.write(); - centroid.write(); - backing.putInt(24, size); - backing.putDouble(32, score); - } - - public int size() { - return 40; - } - } - - public static class MeterArc extends DisposedStruct { - public PointFloat needleBase; // The coordinate location of the base of the - // meter needle. - public PointFloat[] arcCoordPoints; // An array of points describing the - // coordinate location of the meter arc. - public int needleColor; // This element is TRUE when the meter has a - // light-colored needle on a dark background. - private ByteBuffer arcCoordPoints_buf; - - private void init() { - needleBase = new PointFloat(backing, 0); - arcCoordPoints = new PointFloat[0]; - } - - public MeterArc() { - super(20); - init(); - } - - public MeterArc(PointFloat needleBase, PointFloat[] arcCoordPoints, int needleColor) { - super(20); - this.needleBase = needleBase; - this.arcCoordPoints = arcCoordPoints; - this.needleColor = needleColor; - } - - protected MeterArc(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected MeterArc(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - needleBase.read(); - int arcCoordPoints_numOfArcCoordPoints = backing.getInt(12); - long arcCoordPoints_addr = getPointer(backing, 8); - arcCoordPoints = new PointFloat[arcCoordPoints_numOfArcCoordPoints]; - if (arcCoordPoints_numOfArcCoordPoints > 0 && arcCoordPoints_addr != 0) { - ByteBuffer bb = - newDirectByteBuffer(arcCoordPoints_addr, arcCoordPoints_numOfArcCoordPoints * 8); - for (int i = 0, off = 0; i < arcCoordPoints_numOfArcCoordPoints; i++, off += 8) { - arcCoordPoints[i] = new PointFloat(bb, off); - arcCoordPoints[i].read(); - } - } - needleColor = backing.getInt(16); - } - - public void write() { - needleBase.write(); - arcCoordPoints_buf = - ByteBuffer.allocateDirect(arcCoordPoints.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < arcCoordPoints.length; i++, off += 8) { - arcCoordPoints[i].setBuffer(arcCoordPoints_buf, off); - arcCoordPoints[i].write(); - } - backing.putInt(12, arcCoordPoints.length); - putPointer(backing, 8, arcCoordPoints_buf); - backing.putInt(16, needleColor); - } - - public int size() { - return 20; - } - } - - public static class ThresholdData extends DisposedStruct { - public float rangeMin; // The lower boundary of the range to keep. - public float rangeMax; // The upper boundary of the range to keep. - public float newValue; // If useNewValue is TRUE, newValue is the - // replacement value for pixels within the range. - public int useNewValue; // If TRUE, the function sets pixel values within - // [rangeMin, rangeMax] to the value specified in - // newValue. - - private void init() { - - } - - public ThresholdData() { - super(16); - init(); - } - - public ThresholdData(double rangeMin, double rangeMax, double newValue, int useNewValue) { - super(16); - this.rangeMin = (float) rangeMin; - this.rangeMax = (float) rangeMax; - this.newValue = (float) newValue; - this.useNewValue = useNewValue; - } - - protected ThresholdData(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected ThresholdData(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - rangeMin = backing.getFloat(0); - rangeMax = backing.getFloat(4); - newValue = backing.getFloat(8); - useNewValue = backing.getInt(12); - } - - public void write() { - backing.putFloat(0, rangeMin); - backing.putFloat(4, rangeMax); - backing.putFloat(8, newValue); - backing.putInt(12, useNewValue); - } - - public int size() { - return 16; - } - } - - public static class StructuringElement extends DisposedStruct { - public int matrixCols; // Number of columns in the matrix. - public int matrixRows; // Number of rows in the matrix. - public int hexa; // Set this element to TRUE if you specify a hexagonal - // structuring element in kernel. - - private void init() { - - } - - public StructuringElement() { - super(16); - init(); - } - - public StructuringElement(int matrixCols, int matrixRows, int hexa) { - super(16); - this.matrixCols = matrixCols; - this.matrixRows = matrixRows; - this.hexa = hexa; - } - - protected StructuringElement(ByteBuffer backing, int offset) { - super(backing, offset, 16); - init(); - } - - protected StructuringElement(long nativeObj, boolean owned) { - super(nativeObj, owned, 16); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 16); - } - - public void read() { - matrixCols = backing.getInt(0); - matrixRows = backing.getInt(4); - hexa = backing.getInt(8); - } - - public void write() { - backing.putInt(0, matrixCols); - backing.putInt(4, matrixRows); - backing.putInt(8, hexa); - } - - public int size() { - return 16; - } - } - - public static class SpokeReport extends DisposedStruct { - public LineFloat[] spokeLines; // The coordinate location of each of the - // spoke lines used by the function. - public PointFloat[] firstEdges; // The coordinate location of all edges - // detected as first edges. - public PointFloat[] lastEdges; // The coordinate location of all edges - // detected as last edges. - public EdgeLocationReport[] allEdges; // An array of reports describing the - // location of the edges located by - // each spoke line. - public int[] linesWithEdges; // An array of indices into the spokeLines - // array indicating the rake lines on which the - // function detected at least one edge. - private ByteBuffer spokeLines_buf; - private ByteBuffer firstEdges_buf; - private ByteBuffer lastEdges_buf; - private ByteBuffer allEdges_buf; - private ByteBuffer linesWithEdges_buf; - - private void init() { - spokeLines = new LineFloat[0]; - firstEdges = new PointFloat[0]; - lastEdges = new PointFloat[0]; - allEdges = new EdgeLocationReport[0]; - linesWithEdges = new int[0]; - } - - public SpokeReport() { - super(36); - init(); - } - - public SpokeReport(LineFloat[] spokeLines, PointFloat[] firstEdges, PointFloat[] lastEdges, - EdgeLocationReport[] allEdges, int[] linesWithEdges) { - super(36); - this.spokeLines = spokeLines; - this.firstEdges = firstEdges; - this.lastEdges = lastEdges; - this.allEdges = allEdges; - this.linesWithEdges = linesWithEdges; - } - - protected SpokeReport(ByteBuffer backing, int offset) { - super(backing, offset, 36); - init(); - } - - protected SpokeReport(long nativeObj, boolean owned) { - super(nativeObj, owned, 36); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 36); - } - - public void read() { - int spokeLines_numSpokeLines = backing.getInt(4); - long spokeLines_addr = getPointer(backing, 0); - spokeLines = new LineFloat[spokeLines_numSpokeLines]; - if (spokeLines_numSpokeLines > 0 && spokeLines_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(spokeLines_addr, spokeLines_numSpokeLines * 16); - for (int i = 0, off = 0; i < spokeLines_numSpokeLines; i++, off += 16) { - spokeLines[i] = new LineFloat(bb, off); - spokeLines[i].read(); - } - } - int firstEdges_numFirstEdges = backing.getInt(12); - long firstEdges_addr = getPointer(backing, 8); - firstEdges = new PointFloat[firstEdges_numFirstEdges]; - if (firstEdges_numFirstEdges > 0 && firstEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges * 8); - for (int i = 0, off = 0; i < firstEdges_numFirstEdges; i++, off += 8) { - firstEdges[i] = new PointFloat(bb, off); - firstEdges[i].read(); - } - } - int lastEdges_numLastEdges = backing.getInt(20); - long lastEdges_addr = getPointer(backing, 16); - lastEdges = new PointFloat[lastEdges_numLastEdges]; - if (lastEdges_numLastEdges > 0 && lastEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges * 8); - for (int i = 0, off = 0; i < lastEdges_numLastEdges; i++, off += 8) { - lastEdges[i] = new PointFloat(bb, off); - lastEdges[i].read(); - } - } - int allEdges_numLinesWithEdges = backing.getInt(32); - long allEdges_addr = getPointer(backing, 24); - allEdges = new EdgeLocationReport[allEdges_numLinesWithEdges]; - if (allEdges_numLinesWithEdges > 0 && allEdges_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges * 8); - for (int i = 0, off = 0; i < allEdges_numLinesWithEdges; i++, off += 8) { - allEdges[i] = new EdgeLocationReport(bb, off); - allEdges[i].read(); - } - } - int linesWithEdges_numLinesWithEdges = backing.getInt(32); - long linesWithEdges_addr = getPointer(backing, 28); - linesWithEdges = new int[linesWithEdges_numLinesWithEdges]; - if (linesWithEdges_numLinesWithEdges > 0 && linesWithEdges_addr != 0) { - newDirectByteBuffer(linesWithEdges_addr, linesWithEdges_numLinesWithEdges * 4) - .asIntBuffer().get(linesWithEdges); - } - } - - public void write() { - spokeLines_buf = - ByteBuffer.allocateDirect(spokeLines.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < spokeLines.length; i++, off += 16) { - spokeLines[i].setBuffer(spokeLines_buf, off); - spokeLines[i].write(); - } - backing.putInt(4, spokeLines.length); - putPointer(backing, 0, spokeLines_buf); - firstEdges_buf = - ByteBuffer.allocateDirect(firstEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < firstEdges.length; i++, off += 8) { - firstEdges[i].setBuffer(firstEdges_buf, off); - firstEdges[i].write(); - } - backing.putInt(12, firstEdges.length); - putPointer(backing, 8, firstEdges_buf); - lastEdges_buf = - ByteBuffer.allocateDirect(lastEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < lastEdges.length; i++, off += 8) { - lastEdges[i].setBuffer(lastEdges_buf, off); - lastEdges[i].write(); - } - backing.putInt(20, lastEdges.length); - putPointer(backing, 16, lastEdges_buf); - allEdges_buf = ByteBuffer.allocateDirect(allEdges.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < allEdges.length; i++, off += 8) { - allEdges[i].setBuffer(allEdges_buf, off); - allEdges[i].write(); - } - backing.putInt(32, allEdges.length); - putPointer(backing, 24, allEdges_buf); - linesWithEdges_buf = - ByteBuffer.allocateDirect(linesWithEdges.length * 4).order(ByteOrder.nativeOrder()); - linesWithEdges_buf.asIntBuffer().put(linesWithEdges).rewind(); - backing.putInt(32, linesWithEdges.length); - putPointer(backing, 28, linesWithEdges_buf); - } - - public int size() { - return 36; - } - } - - public static class SimpleEdgeOptions extends DisposedStruct { - public LevelType type; // Determines how the function evaluates the - // threshold and hysteresis values. - public int threshold; // The pixel value at which an edge occurs. - public int hysteresis; // A value that helps determine edges in noisy - // images. - public EdgeProcess process; // Determines which edges the function looks - // for. - public int subpixel; // Set this element to TRUE to find edges with subpixel - // accuracy by interpolating between points to find the - // crossing of the given threshold. - - private void init() { - - } - - public SimpleEdgeOptions() { - super(20); - init(); - } - - public SimpleEdgeOptions(LevelType type, int threshold, int hysteresis, EdgeProcess process, - int subpixel) { - super(20); - this.type = type; - this.threshold = threshold; - this.hysteresis = hysteresis; - this.process = process; - this.subpixel = subpixel; - } - - protected SimpleEdgeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 20); - init(); - } - - protected SimpleEdgeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 20); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 20); - } - - public void read() { - type = LevelType.fromValue(backing.getInt(0)); - threshold = backing.getInt(4); - hysteresis = backing.getInt(8); - process = EdgeProcess.fromValue(backing.getInt(12)); - subpixel = backing.getInt(16); - } - - public void write() { - if (type != null) - backing.putInt(0, type.getValue()); - backing.putInt(4, threshold); - backing.putInt(8, hysteresis); - if (process != null) - backing.putInt(12, process.getValue()); - backing.putInt(16, subpixel); - } - - public int size() { - return 20; - } - } - - public static class SelectParticleCriteria extends DisposedStruct { - public MeasurementValue parameter; // The morphological measurement that the - // function uses for filtering. - public float lower; // The lower boundary of the criteria range. - public float upper; // The upper boundary of the criteria range. - - private void init() { - - } - - public SelectParticleCriteria() { - super(12); - init(); - } - - public SelectParticleCriteria(MeasurementValue parameter, double lower, double upper) { - super(12); - this.parameter = parameter; - this.lower = (float) lower; - this.upper = (float) upper; - } - - protected SelectParticleCriteria(ByteBuffer backing, int offset) { - super(backing, offset, 12); - init(); - } - - protected SelectParticleCriteria(long nativeObj, boolean owned) { - super(nativeObj, owned, 12); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 12); - } - - public void read() { - parameter = MeasurementValue.fromValue(backing.getInt(0)); - lower = backing.getFloat(4); - upper = backing.getFloat(8); - } - - public void write() { - if (parameter != null) - backing.putInt(0, parameter.getValue()); - backing.putFloat(4, lower); - backing.putFloat(8, upper); - } - - public int size() { - return 12; - } - } - - public static class SegmentInfo extends DisposedStruct { - public int numberOfPoints; // The number of points in the segment. - public int isOpen; // If TRUE, the contour is open. - public double weight; // The significance of the edge in terms of the gray - // values that constitute the edge. - public ContourPoint points; // The points of the segment. - - private void init() { - - } - - public SegmentInfo() { - super(24); - init(); - } - - public SegmentInfo(int numberOfPoints, int isOpen, double weight, ContourPoint points) { - super(24); - this.numberOfPoints = numberOfPoints; - this.isOpen = isOpen; - this.weight = weight; - this.points = points; - } - - protected SegmentInfo(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected SegmentInfo(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - numberOfPoints = backing.getInt(0); - isOpen = backing.getInt(4); - weight = backing.getDouble(8); - long points_addr = getPointer(backing, 16); - if (points_addr == 0) - points = null; - else - points = new ContourPoint(points_addr, false); - } - - public void write() { - backing.putInt(0, numberOfPoints); - backing.putInt(4, isOpen); - backing.putDouble(8, weight); - putPointer(backing, 16, points); - } - - public int size() { - return 24; - } - } - - public static class RotationAngleRange extends DisposedStruct { - public float lower; // The lowest amount of rotation, in degrees, a valid - // pattern can have. - public float upper; // The highest amount of rotation, in degrees, a valid - // pattern can have. - - private void init() { - - } - - public RotationAngleRange() { - super(8); - init(); - } - - public RotationAngleRange(double lower, double upper) { - super(8); - this.lower = (float) lower; - this.upper = (float) upper; - } - - protected RotationAngleRange(ByteBuffer backing, int offset) { - super(backing, offset, 8); - init(); - } - - protected RotationAngleRange(long nativeObj, boolean owned) { - super(nativeObj, owned, 8); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 8); - } - - public void read() { - lower = backing.getFloat(0); - upper = backing.getFloat(4); - } - - public void write() { - backing.putFloat(0, lower); - backing.putFloat(4, upper); - } - - public int size() { - return 8; - } - } - - public static class RotatedRect extends DisposedStruct { - public int top; // Location of the top edge of the rectangle before - // rotation. - public int left; // Location of the left edge of the rectangle before - // rotation. - public int height; // Height of the rectangle. - public int width; // Width of the rectangle. - public double angle; // The rotation, in degrees, of the rectangle. - - private void init() { - - } - - public RotatedRect() { - super(24); - init(); - } - - public RotatedRect(int top, int left, int height, int width, double angle) { - super(24); - this.top = top; - this.left = left; - this.height = height; - this.width = width; - this.angle = angle; - } - - protected RotatedRect(ByteBuffer backing, int offset) { - super(backing, offset, 24); - init(); - } - - protected RotatedRect(long nativeObj, boolean owned) { - super(nativeObj, owned, 24); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 24); - } - - public void read() { - top = backing.getInt(0); - left = backing.getInt(4); - height = backing.getInt(8); - width = backing.getInt(12); - angle = backing.getDouble(16); - } - - public void write() { - backing.putInt(0, top); - backing.putInt(4, left); - backing.putInt(8, height); - backing.putInt(12, width); - backing.putDouble(16, angle); - } - - public int size() { - return 24; - } - } - - public static class ROIProfile extends DisposedStruct { - public LineProfile report; // Quantifying information about the points along - // the edge of each contour in the ROI. - public Point pixels; // An array of the points along the edge of each - // contour in the ROI. - - private void init() { - report = new LineProfile(backing, 0); - } - - public ROIProfile() { - super(44); - init(); - } - - public ROIProfile(LineProfile report, Point pixels) { - super(44); - this.report = report; - this.pixels = pixels; - } - - protected ROIProfile(ByteBuffer backing, int offset) { - super(backing, offset, 44); - init(); - } - - protected ROIProfile(long nativeObj, boolean owned) { - super(nativeObj, owned, 44); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 44); - } - - public void read() { - report.read(); - long pixels_addr = getPointer(backing, 40); - if (pixels_addr == 0) - pixels = null; - else - pixels = new Point(pixels_addr, false); - } - - public void write() { - report.write(); - putPointer(backing, 40, pixels); - } - - public int size() { - return 44; - } - } - - public static class ToolWindowOptions extends DisposedStruct { - public int showSelectionTool; // If TRUE, the selection tool becomes - // visible. - public int showZoomTool; // If TRUE, the zoom tool becomes visible. - public int showPointTool; // If TRUE, the point tool becomes visible. - public int showLineTool; // If TRUE, the line tool becomes visible. - public int showRectangleTool; // If TRUE, the rectangle tool becomes - // visible. - public int showOvalTool; // If TRUE, the oval tool becomes visible. - public int showPolygonTool; // If TRUE, the polygon tool becomes visible. - public int showClosedFreehandTool; // If TRUE, the closed freehand tool - // becomes visible. - public int showPolyLineTool; // If TRUE, the polyline tool becomes visible. - public int showFreehandTool; // If TRUE, the freehand tool becomes visible. - public int showAnnulusTool; // If TRUE, the annulus becomes visible. - public int showRotatedRectangleTool; // If TRUE, the rotated rectangle tool - // becomes visible. - public int showPanTool; // If TRUE, the pan tool becomes visible. - public int showZoomOutTool; // If TRUE, the zoom out tool becomes visible. - - private void init() { - - } - - public ToolWindowOptions() { - super(68); - init(); - } - - public ToolWindowOptions(int showSelectionTool, int showZoomTool, int showPointTool, - int showLineTool, int showRectangleTool, int showOvalTool, int showPolygonTool, - int showClosedFreehandTool, int showPolyLineTool, int showFreehandTool, - int showAnnulusTool, int showRotatedRectangleTool, int showPanTool, int showZoomOutTool) { - super(68); - this.showSelectionTool = showSelectionTool; - this.showZoomTool = showZoomTool; - this.showPointTool = showPointTool; - this.showLineTool = showLineTool; - this.showRectangleTool = showRectangleTool; - this.showOvalTool = showOvalTool; - this.showPolygonTool = showPolygonTool; - this.showClosedFreehandTool = showClosedFreehandTool; - this.showPolyLineTool = showPolyLineTool; - this.showFreehandTool = showFreehandTool; - this.showAnnulusTool = showAnnulusTool; - this.showRotatedRectangleTool = showRotatedRectangleTool; - this.showPanTool = showPanTool; - this.showZoomOutTool = showZoomOutTool; - } - - protected ToolWindowOptions(ByteBuffer backing, int offset) { - super(backing, offset, 68); - init(); - } - - protected ToolWindowOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 68); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 68); - } - - public void read() { - showSelectionTool = backing.getInt(0); - showZoomTool = backing.getInt(4); - showPointTool = backing.getInt(8); - showLineTool = backing.getInt(12); - showRectangleTool = backing.getInt(16); - showOvalTool = backing.getInt(20); - showPolygonTool = backing.getInt(24); - showClosedFreehandTool = backing.getInt(28); - showPolyLineTool = backing.getInt(32); - showFreehandTool = backing.getInt(36); - showAnnulusTool = backing.getInt(40); - showRotatedRectangleTool = backing.getInt(44); - showPanTool = backing.getInt(48); - showZoomOutTool = backing.getInt(52); - } - - public void write() { - backing.putInt(0, showSelectionTool); - backing.putInt(4, showZoomTool); - backing.putInt(8, showPointTool); - backing.putInt(12, showLineTool); - backing.putInt(16, showRectangleTool); - backing.putInt(20, showOvalTool); - backing.putInt(24, showPolygonTool); - backing.putInt(28, showClosedFreehandTool); - backing.putInt(32, showPolyLineTool); - backing.putInt(36, showFreehandTool); - backing.putInt(40, showAnnulusTool); - backing.putInt(44, showRotatedRectangleTool); - backing.putInt(48, showPanTool); - backing.putInt(52, showZoomOutTool); - } - - public int size() { - return 68; - } - } - - public static class SpokeOptions extends DisposedStruct { - public int threshold; // Specifies the threshold value for the contrast of - // the edge. - public int width; // The number of pixels that the function averages to find - // the contrast at either side of the edge. - public int steepness; // The span, in pixels, of the slope of the edge - // projected along the path specified by the input - // points. - public double subsamplingRatio; // The angle, in degrees, between each - // radial search line in the spoke. - public InterpolationMethod subpixelType; // The method for interpolating. - public int subpixelDivisions; // The number of samples the function obtains - // from a pixel. - - private void init() { - - } - - public SpokeOptions() { - super(32); - init(); - } - - public SpokeOptions(int threshold, int width, int steepness, double subsamplingRatio, - InterpolationMethod subpixelType, int subpixelDivisions) { - super(32); - this.threshold = threshold; - this.width = width; - this.steepness = steepness; - this.subsamplingRatio = subsamplingRatio; - this.subpixelType = subpixelType; - this.subpixelDivisions = subpixelDivisions; - } - - protected SpokeOptions(ByteBuffer backing, int offset) { - super(backing, offset, 32); - init(); - } - - protected SpokeOptions(long nativeObj, boolean owned) { - super(nativeObj, owned, 32); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 32); - } - - public void read() { - threshold = backing.getInt(0); - width = backing.getInt(4); - steepness = backing.getInt(8); - subsamplingRatio = backing.getDouble(16); - subpixelType = InterpolationMethod.fromValue(backing.getInt(24)); - subpixelDivisions = backing.getInt(28); - } - - public void write() { - backing.putInt(0, threshold); - backing.putInt(4, width); - backing.putInt(8, steepness); - backing.putDouble(16, subsamplingRatio); - if (subpixelType != null) - backing.putInt(24, subpixelType.getValue()); - backing.putInt(28, subpixelDivisions); - } - - public int size() { - return 32; - } - } - - /** - * Globals - */ - public static final Rect NO_RECT = new Rect(0, 0, 0x7FFFFFFF, 0x7FFFFFFF); - public static final RotatedRect NO_ROTATED_RECT = - new RotatedRect(0, 0, 0x7FFFFFFF, 0x7FFFFFFF, 0); - public static final Point NO_POINT = new Point(-1, -1); - public static final PointFloat NO_POINT_FLOAT = new PointFloat(-1.0, -1.0); - public static final PointFloat NO_OFFSET = new PointFloat(0.0, 0.0); - public static final RGBValue RGB_TRANSPARENT = new RGBValue(0, 0, 0, 1); - public static final RGBValue RGB_RED = new RGBValue(0, 0, 255, 0); - public static final RGBValue RGB_BLUE = new RGBValue(255, 0, 0, 0); - public static final RGBValue RGB_GREEN = new RGBValue(0, 255, 0, 0); - public static final RGBValue RGB_YELLOW = new RGBValue(0, 255, 255, 0); - public static final RGBValue RGB_WHITE = new RGBValue(255, 255, 255, 0); - public static final RGBValue RGB_BLACK = new RGBValue(0, 0, 0, 0); - - /** - * Logical functions - */ - - public static void imaqAnd(Image dest, Image sourceA, Image sourceB) { - - _imaqAnd(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqAnd(long dest, long sourceA, long sourceB); - - public static void imaqCompare(Image dest, Image source, Image compareImage, - ComparisonFunction compare) { - - _imaqCompare(dest.getAddress(), source.getAddress(), compareImage.getAddress(), - compare.getValue()); - - } - - private static native void _imaqCompare(long dest, long source, long compareImage, int compare); - - public static void imaqLogicalDifference(Image dest, Image sourceA, Image sourceB) { - - _imaqLogicalDifference(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqLogicalDifference(long dest, long sourceA, long sourceB); - - public static void imaqNand(Image dest, Image sourceA, Image sourceB) { - - _imaqNand(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqNand(long dest, long sourceA, long sourceB); - - public static void imaqNor(Image dest, Image sourceA, Image sourceB) { - - _imaqNor(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqNor(long dest, long sourceA, long sourceB); - - public static void imaqOr(Image dest, Image sourceA, Image sourceB) { - - _imaqOr(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqOr(long dest, long sourceA, long sourceB); - - public static void imaqXnor(Image dest, Image sourceA, Image sourceB) { - - _imaqXnor(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqXnor(long dest, long sourceA, long sourceB); - - public static void imaqXor(Image dest, Image sourceA, Image sourceB) { - - _imaqXor(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqXor(long dest, long sourceA, long sourceB); - - /** - * Particle Analysis functions - */ - - public static int imaqCountParticles(Image image, int connectivity8) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqCountParticles(image.getAddress(), connectivity8, rv_addr + 0); - int numParticles; - numParticles = rv_buf.getInt(0); - return numParticles; - } - - private static native void _imaqCountParticles(long image, int connectivity8, long numParticles); - - public static double imaqMeasureParticle(Image image, int particleNumber, int calibrated, - MeasurementType measurement) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqMeasureParticle(image.getAddress(), particleNumber, calibrated, measurement.getValue(), - rv_addr + 0); - double value; - value = rv_buf.getDouble(0); - return value; - } - - private static native void _imaqMeasureParticle(long image, int particleNumber, int calibrated, - int measurement, long value); - - public static MeasureParticlesReport imaqMeasureParticles(Image image, - MeasureParticlesCalibrationMode calibrationMode, MeasurementType[] measurements) { - int numMeasurements = measurements.length; - ByteBuffer measurements_buf = null; - measurements_buf = - ByteBuffer.allocateDirect(measurements.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < measurements.length; i++, off += 4) { - if (measurements != null) - measurements_buf.putInt(off, measurements[i].getValue()); - } - long jn_rv = - _imaqMeasureParticles(image.getAddress(), calibrationMode.getValue(), - getByteBufferAddress(measurements_buf), numMeasurements); - - return new MeasureParticlesReport(jn_rv, true); - } - - private static native long _imaqMeasureParticles(long image, int calibrationMode, - long measurements, int numMeasurements); - - public static int imaqParticleFilter4(Image dest, Image source, - ParticleFilterCriteria2[] criteria, ParticleFilterOptions2 options, ROI roi) { - int criteriaCount = criteria.length; - ByteBuffer criteria_buf = null; - criteria_buf = ByteBuffer.allocateDirect(criteria.length * 20).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < criteria.length; i++, off += 20) { - criteria[i].setBuffer(criteria_buf, off); - criteria[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqParticleFilter4(dest.getAddress(), source.getAddress(), - getByteBufferAddress(criteria_buf), criteriaCount, options.getAddress(), roi == null ? 0 - : roi.getAddress(), rv_addr + 0); - int numParticles; - numParticles = rv_buf.getInt(0); - return numParticles; - } - - private static native void _imaqParticleFilter4(long dest, long source, long criteria, - int criteriaCount, long options, long roi, long numParticles); - - /** - * Morphology functions - */ - - public static void imaqConvexHull(Image dest, Image source, int connectivity8) { - - _imaqConvexHull(dest.getAddress(), source.getAddress(), connectivity8); - - } - - private static native void _imaqConvexHull(long dest, long source, int connectivity8); - - public static void imaqDanielssonDistance(Image dest, Image source) { - - _imaqDanielssonDistance(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqDanielssonDistance(long dest, long source); - - public static void imaqFillHoles(Image dest, Image source, int connectivity8) { - - _imaqFillHoles(dest.getAddress(), source.getAddress(), connectivity8); - - } - - private static native void _imaqFillHoles(long dest, long source, int connectivity8); - - public static class FindCirclesResult { - public CircleReport[] array; - private long array_addr; - - private FindCirclesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numCircles; - array_numCircles = rv_buf.getInt(0); - array = new CircleReport[array_numCircles]; - if (array_numCircles > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCircles * 16); - for (int i = 0, off = 0; i < array_numCircles; i++, off += 16) { - array[i] = new CircleReport(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static FindCirclesResult imaqFindCircles(Image dest, Image source, float minRadius, - float maxRadius) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqFindCircles(dest.getAddress(), source.getAddress(), minRadius, maxRadius, rv_addr + 0); - FindCirclesResult rv = new FindCirclesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqFindCircles(long dest, long source, float minRadius, - float maxRadius, long numCircles); - - public static int imaqLabel2(Image dest, Image source, int connectivity8) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLabel2(dest.getAddress(), source.getAddress(), connectivity8, rv_addr + 0); - int particleCount; - particleCount = rv_buf.getInt(0); - return particleCount; - } - - private static native void _imaqLabel2(long dest, long source, int connectivity8, - long particleCount); - - public static void imaqMorphology(Image dest, Image source, MorphologyMethod method, - StructuringElement structuringElement) { - - _imaqMorphology(dest.getAddress(), source.getAddress(), method.getValue(), - structuringElement == null ? 0 : structuringElement.getAddress()); - - } - - private static native void _imaqMorphology(long dest, long source, int method, - long structuringElement); - - public static void imaqRejectBorder(Image dest, Image source, int connectivity8) { - - _imaqRejectBorder(dest.getAddress(), source.getAddress(), connectivity8); - - } - - private static native void _imaqRejectBorder(long dest, long source, int connectivity8); - - public static void imaqSegmentation(Image dest, Image source) { - - _imaqSegmentation(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqSegmentation(long dest, long source); - - public static void imaqSeparation(Image dest, Image source, int erosions, - StructuringElement structuringElement) { - - _imaqSeparation(dest.getAddress(), source.getAddress(), erosions, - structuringElement == null ? 0 : structuringElement.getAddress()); - - } - - private static native void _imaqSeparation(long dest, long source, int erosions, - long structuringElement); - - public static void imaqSimpleDistance(Image dest, Image source, - StructuringElement structuringElement) { - - _imaqSimpleDistance(dest.getAddress(), source.getAddress(), structuringElement == null ? 0 - : structuringElement.getAddress()); - - } - - private static native void _imaqSimpleDistance(long dest, long source, long structuringElement); - - public static void imaqSizeFilter(Image dest, Image source, int connectivity8, int erosions, - SizeType keepSize, StructuringElement structuringElement) { - - _imaqSizeFilter(dest.getAddress(), source.getAddress(), connectivity8, erosions, - keepSize.getValue(), structuringElement == null ? 0 : structuringElement.getAddress()); - - } - - private static native void _imaqSizeFilter(long dest, long source, int connectivity8, - int erosions, int keepSize, long structuringElement); - - public static void imaqSkeleton(Image dest, Image source, SkeletonMethod method) { - - _imaqSkeleton(dest.getAddress(), source.getAddress(), method.getValue()); - - } - - private static native void _imaqSkeleton(long dest, long source, int method); - - /** - * Acquisition functions - */ - - /** - * Arithmetic functions - */ - - public static void imaqAbsoluteDifference(Image dest, Image sourceA, Image sourceB) { - - _imaqAbsoluteDifference(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqAbsoluteDifference(long dest, long sourceA, long sourceB); - - public static void imaqAdd(Image dest, Image sourceA, Image sourceB) { - - _imaqAdd(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqAdd(long dest, long sourceA, long sourceB); - - public static void imaqAverage(Image dest, Image sourceA, Image sourceB) { - - _imaqAverage(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqAverage(long dest, long sourceA, long sourceB); - - public static void imaqDivide2(Image dest, Image sourceA, Image sourceB, RoundingMode roundingMode) { - - _imaqDivide2(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress(), - roundingMode.getValue()); - - } - - private static native void _imaqDivide2(long dest, long sourceA, long sourceB, int roundingMode); - - public static void imaqMax(Image dest, Image sourceA, Image sourceB) { - - _imaqMax(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqMax(long dest, long sourceA, long sourceB); - - public static void imaqMin(Image dest, Image sourceA, Image sourceB) { - - _imaqMin(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqMin(long dest, long sourceA, long sourceB); - - public static void imaqModulo(Image dest, Image sourceA, Image sourceB) { - - _imaqModulo(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqModulo(long dest, long sourceA, long sourceB); - - public static void imaqMulDiv(Image dest, Image sourceA, Image sourceB, float value) { - - _imaqMulDiv(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress(), value); - - } - - private static native void _imaqMulDiv(long dest, long sourceA, long sourceB, float value); - - public static void imaqMultiply(Image dest, Image sourceA, Image sourceB) { - - _imaqMultiply(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqMultiply(long dest, long sourceA, long sourceB); - - public static void imaqSubtract(Image dest, Image sourceA, Image sourceB) { - - _imaqSubtract(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqSubtract(long dest, long sourceA, long sourceB); - - /** - * Caliper functions - */ - - public static class CaliperToolResult { - public CaliperReport[] array; - private long array_addr; - - private CaliperToolResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numEdgePairs; - array_numEdgePairs = rv_buf.getInt(0); - array = new CaliperReport[array_numEdgePairs]; - if (array_numEdgePairs > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numEdgePairs * 32); - for (int i = 0, off = 0; i < array_numEdgePairs; i++, off += 32) { - array[i] = new CaliperReport(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static CaliperToolResult imaqCaliperTool(Image image, Point[] points, - EdgeOptions edgeOptions, CaliperOptions caliperOptions) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqCaliperTool(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - edgeOptions.getAddress(), caliperOptions.getAddress(), rv_addr + 0); - CaliperToolResult rv = new CaliperToolResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqCaliperTool(long image, long points, int numPoints, - long edgeOptions, long caliperOptions, long numEdgePairs); - - public static class ConcentricRake2Result { - public EdgeOptions2 edgeOptions; - public ConcentricRakeReport2 val; - - private ConcentricRake2Result(ByteBuffer rv_buf) { - edgeOptions = new EdgeOptions2(rv_buf, 0); - edgeOptions.read(); - } - } - - public static ConcentricRake2Result imaqConcentricRake2(Image image, ROI roi, - ConcentricRakeDirection direction, EdgeProcess process, int stepSize) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqConcentricRake2(image.getAddress(), roi.getAddress(), direction.getValue(), - process.getValue(), stepSize, rv_addr + 0); - ConcentricRake2Result rv = new ConcentricRake2Result(rv_buf); - rv.val = new ConcentricRakeReport2(jn_rv, true); - return rv; - } - - private static native long _imaqConcentricRake2(long image, long roi, int direction, int process, - int stepSize, long edgeOptions); - - public static class DetectExtremesResult { - public ExtremeReport[] array; - private long array_addr; - - private DetectExtremesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numExtremes; - array_numExtremes = rv_buf.getInt(0); - array = new ExtremeReport[array_numExtremes]; - if (array_numExtremes > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numExtremes * 24); - for (int i = 0, off = 0; i < array_numExtremes; i++, off += 24) { - array[i] = new ExtremeReport(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static DetectExtremesResult imaqDetectExtremes(double[] pixels, DetectionMode mode, - DetectExtremesOptions options) { - int numPixels = pixels.length; - ByteBuffer pixels_buf = null; - pixels_buf = ByteBuffer.allocateDirect(pixels.length * 8).order(ByteOrder.nativeOrder()); - pixels_buf.asDoubleBuffer().put(pixels).rewind(); - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqDetectExtremes(getByteBufferAddress(pixels_buf), numPixels, mode.getValue(), - options.getAddress(), rv_addr + 0); - DetectExtremesResult rv = new DetectExtremesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqDetectExtremes(long pixels, int numPixels, int mode, - long options, long numExtremes); - - public static double imaqDetectRotation(Image referenceImage, Image testImage, - PointFloat referenceCenter, PointFloat testCenter, int radius, float precision) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqDetectRotation(referenceImage.getAddress(), testImage.getAddress(), - referenceCenter.getAddress(), testCenter.getAddress(), radius, precision, rv_addr + 0); - double angle; - angle = rv_buf.getDouble(0); - return angle; - } - - private static native void _imaqDetectRotation(long referenceImage, long testImage, - long referenceCenter, long testCenter, int radius, float precision, long angle); - - public static class EdgeTool4Result { - public EdgeOptions2 edgeOptions; - public EdgeReport2 val; - - private EdgeTool4Result(ByteBuffer rv_buf) { - edgeOptions = new EdgeOptions2(rv_buf, 0); - edgeOptions.read(); - } - } - - public static EdgeTool4Result imaqEdgeTool4(Image image, ROI roi, EdgeProcess processType, - int reverseDirection) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqEdgeTool4(image.getAddress(), roi.getAddress(), processType.getValue(), rv_addr + 0, - reverseDirection); - EdgeTool4Result rv = new EdgeTool4Result(rv_buf); - rv.val = new EdgeReport2(jn_rv, true); - return rv; - } - - private static native long _imaqEdgeTool4(long image, long roi, int processType, - long edgeOptions, int reverseDirection); - - public static FindEdgeReport imaqFindEdge2(Image image, ROI roi, CoordinateSystem baseSystem, - CoordinateSystem newSystem, FindEdgeOptions2 findEdgeOptions, - StraightEdgeOptions straightEdgeOptions) { - - long jn_rv = - _imaqFindEdge2(image.getAddress(), roi.getAddress(), baseSystem.getAddress(), - newSystem.getAddress(), findEdgeOptions.getAddress(), straightEdgeOptions.getAddress()); - - return new FindEdgeReport(jn_rv, true); - } - - private static native long _imaqFindEdge2(long image, long roi, long baseSystem, long newSystem, - long findEdgeOptions, long straightEdgeOptions); - - public static class FindTransformRect2Result { - public CoordinateSystem baseSystem; - public CoordinateSystem newSystem; - public AxisReport axisReport; - - private FindTransformRect2Result(ByteBuffer rv_buf) { - baseSystem = new CoordinateSystem(rv_buf, 0); - baseSystem.read(); - newSystem = new CoordinateSystem(rv_buf, 8); - newSystem.read(); - axisReport = new AxisReport(rv_buf, 16); - axisReport.read(); - } - } - - public static FindTransformRect2Result imaqFindTransformRect2(Image image, ROI roi, - FindTransformMode mode, FindTransformRectOptions2 findTransformOptions, - StraightEdgeOptions straightEdgeOptions) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqFindTransformRect2(image.getAddress(), roi.getAddress(), mode.getValue(), rv_addr + 0, - rv_addr + 8, findTransformOptions.getAddress(), straightEdgeOptions.getAddress(), - rv_addr + 16); - FindTransformRect2Result rv = new FindTransformRect2Result(rv_buf); - return rv; - } - - private static native void _imaqFindTransformRect2(long image, long roi, int mode, - long baseSystem, long newSystem, long findTransformOptions, long straightEdgeOptions, - long axisReport); - - public static class FindTransformRects2Result { - public CoordinateSystem baseSystem; - public CoordinateSystem newSystem; - public AxisReport axisReport; - - private FindTransformRects2Result(ByteBuffer rv_buf) { - baseSystem = new CoordinateSystem(rv_buf, 0); - baseSystem.read(); - newSystem = new CoordinateSystem(rv_buf, 8); - newSystem.read(); - axisReport = new AxisReport(rv_buf, 16); - axisReport.read(); - } - } - - public static FindTransformRects2Result imaqFindTransformRects2(Image image, ROI primaryROI, - ROI secondaryROI, FindTransformMode mode, FindTransformRectsOptions2 findTransformOptions, - StraightEdgeOptions primaryStraightEdgeOptions, - StraightEdgeOptions secondaryStraightEdgeOptions) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqFindTransformRects2(image.getAddress(), primaryROI.getAddress(), - secondaryROI.getAddress(), mode.getValue(), rv_addr + 0, rv_addr + 8, - findTransformOptions.getAddress(), primaryStraightEdgeOptions.getAddress(), - secondaryStraightEdgeOptions.getAddress(), rv_addr + 16); - FindTransformRects2Result rv = new FindTransformRects2Result(rv_buf); - return rv; - } - - private static native void _imaqFindTransformRects2(long image, long primaryROI, - long secondaryROI, int mode, long baseSystem, long newSystem, long findTransformOptions, - long primaryStraightEdgeOptions, long secondaryStraightEdgeOptions, long axisReport); - - public static float imaqLineGaugeTool2(Image image, Point start, Point end, - LineGaugeMethod method, EdgeOptions edgeOptions, CoordinateTransform2 transform) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLineGaugeTool2(image.getAddress(), start.getAddress(), end.getAddress(), - method.getValue(), edgeOptions.getAddress(), transform.getAddress(), rv_addr + 0); - float distance; - distance = rv_buf.getFloat(0); - return distance; - } - - private static native void _imaqLineGaugeTool2(long image, long start, long end, int method, - long edgeOptions, long transform, long distance); - - public static class Rake2Result { - public EdgeOptions2 edgeOptions; - public RakeReport2 val; - - private Rake2Result(ByteBuffer rv_buf) { - edgeOptions = new EdgeOptions2(rv_buf, 0); - edgeOptions.read(); - } - } - - public static Rake2Result imaqRake2(Image image, ROI roi, RakeDirection direction, - EdgeProcess process, int stepSize) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqRake2(image.getAddress(), roi.getAddress(), direction.getValue(), process.getValue(), - stepSize, rv_addr + 0); - Rake2Result rv = new Rake2Result(rv_buf); - rv.val = new RakeReport2(jn_rv, true); - return rv; - } - - private static native long _imaqRake2(long image, long roi, int direction, int process, - int stepSize, long edgeOptions); - - public static class SimpleEdgeResult { - public PointFloat[] array; - private long array_addr; - - private SimpleEdgeResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numEdges; - array_numEdges = rv_buf.getInt(0); - array = new PointFloat[array_numEdges]; - if (array_numEdges > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numEdges * 8); - for (int i = 0, off = 0; i < array_numEdges; i++, off += 8) { - array[i] = new PointFloat(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static SimpleEdgeResult imaqSimpleEdge(Image image, Point[] points, - SimpleEdgeOptions options) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqSimpleEdge(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - options.getAddress(), rv_addr + 0); - SimpleEdgeResult rv = new SimpleEdgeResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqSimpleEdge(long image, long points, int numPoints, long options, - long numEdges); - - public static class Spoke2Result { - public EdgeOptions2 edgeOptions; - public SpokeReport2 val; - - private Spoke2Result(ByteBuffer rv_buf) { - edgeOptions = new EdgeOptions2(rv_buf, 0); - edgeOptions.read(); - } - } - - public static Spoke2Result imaqSpoke2(Image image, ROI roi, SpokeDirection direction, - EdgeProcess process, int stepSize) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqSpoke2(image.getAddress(), roi.getAddress(), direction.getValue(), process.getValue(), - stepSize, rv_addr + 0); - Spoke2Result rv = new Spoke2Result(rv_buf); - rv.val = new SpokeReport2(jn_rv, true); - return rv; - } - - private static native long _imaqSpoke2(long image, long roi, int direction, int process, - int stepSize, long edgeOptions); - - public static StraightEdgeReport2 imaqStraightEdge(Image image, ROI roi, - SearchDirection searchDirection, EdgeOptions2 edgeOptions, - StraightEdgeOptions straightEdgeOptions) { - - long jn_rv = - _imaqStraightEdge(image.getAddress(), roi.getAddress(), searchDirection.getValue(), - edgeOptions.getAddress(), straightEdgeOptions.getAddress()); - - return new StraightEdgeReport2(jn_rv, true); - } - - private static native long _imaqStraightEdge(long image, long roi, int searchDirection, - long edgeOptions, long straightEdgeOptions); - - public static StraightEdgeReport2 imaqStraightEdge2(Image image, ROI roi, - SearchDirection searchDirection, EdgeOptions2 edgeOptions, - StraightEdgeOptions straightEdgeOptions, int optimizedMode) { - - long jn_rv = - _imaqStraightEdge2(image.getAddress(), roi.getAddress(), searchDirection.getValue(), - edgeOptions.getAddress(), straightEdgeOptions.getAddress(), optimizedMode); - - return new StraightEdgeReport2(jn_rv, true); - } - - private static native long _imaqStraightEdge2(long image, long roi, int searchDirection, - long edgeOptions, long straightEdgeOptions, int optimizedMode); - - /** - * Spatial Filters functions - */ - - public static void imaqCannyEdgeFilter(Image dest, Image source, CannyOptions options) { - - _imaqCannyEdgeFilter(dest.getAddress(), source.getAddress(), - options == null ? 0 : options.getAddress()); - - } - - private static native void _imaqCannyEdgeFilter(long dest, long source, long options); - - public static void imaqCorrelate(Image dest, Image source, Image templateImage, Rect rect) { - - _imaqCorrelate(dest.getAddress(), source.getAddress(), templateImage.getAddress(), - rect.getAddress()); - - } - - private static native void _imaqCorrelate(long dest, long source, long templateImage, long rect); - - public static void imaqEdgeFilter(Image dest, Image source, OutlineMethod method, Image mask) { - - _imaqEdgeFilter(dest.getAddress(), source.getAddress(), method.getValue(), mask == null ? 0 - : mask.getAddress()); - - } - - private static native void _imaqEdgeFilter(long dest, long source, int method, long mask); - - public static void imaqLowPass(Image dest, Image source, int width, int height, float tolerance, - Image mask) { - - _imaqLowPass(dest.getAddress(), source.getAddress(), width, height, tolerance, mask == null ? 0 - : mask.getAddress()); - - } - - private static native void _imaqLowPass(long dest, long source, int width, int height, - float tolerance, long mask); - - public static void imaqMedianFilter(Image dest, Image source, int width, int height, Image mask) { - - _imaqMedianFilter(dest.getAddress(), source.getAddress(), width, height, mask == null ? 0 - : mask.getAddress()); - - } - - private static native void _imaqMedianFilter(long dest, long source, int width, int height, - long mask); - - public static void imaqNthOrderFilter(Image dest, Image source, int width, int height, int n, - Image mask) { - - _imaqNthOrderFilter(dest.getAddress(), source.getAddress(), width, height, n, mask == null ? 0 - : mask.getAddress()); - - } - - private static native void _imaqNthOrderFilter(long dest, long source, int width, int height, - int n, long mask); - - /** - * Drawing functions - */ - - public static void imaqDrawLineOnImage(Image dest, Image source, DrawMode mode, Point start, - Point end, float newPixelValue) { - - _imaqDrawLineOnImage(dest.getAddress(), source.getAddress(), mode.getValue(), - start.getAddress(), end.getAddress(), newPixelValue); - - } - - private static native void _imaqDrawLineOnImage(long dest, long source, int mode, long start, - long end, float newPixelValue); - - public static void imaqDrawShapeOnImage(Image dest, Image source, Rect rect, DrawMode mode, - ShapeMode shape, float newPixelValue) { - - _imaqDrawShapeOnImage(dest.getAddress(), source.getAddress(), rect.getAddress(), - mode.getValue(), shape.getValue(), newPixelValue); - - } - - private static native void _imaqDrawShapeOnImage(long dest, long source, long rect, int mode, - int shape, float newPixelValue); - - /** - * Interlacing functions - */ - - public static void imaqInterlaceCombine(Image frame, Image odd, Image even) { - - _imaqInterlaceCombine(frame.getAddress(), odd.getAddress(), even.getAddress()); - - } - - private static native void _imaqInterlaceCombine(long frame, long odd, long even); - - public static void imaqInterlaceSeparate(Image frame, Image odd, Image even) { - - _imaqInterlaceSeparate(frame.getAddress(), odd == null ? 0 : odd.getAddress(), even == null ? 0 - : even.getAddress()); - - } - - private static native void _imaqInterlaceSeparate(long frame, long odd, long even); - - /** - * Image Information functions - */ - - public static class EnumerateCustomKeysResult { - public String[] array; - private long array_addr; - - private EnumerateCustomKeysResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_size; - array_size = rv_buf.getInt(0); - array = new String[array_size]; - if (array_size > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_size * 4); - for (int i = 0, off = 0; i < array_size; i++, off += 4) { - long addr = getPointer(bb, off); - if (addr == 0) - array[i] = null; - else { - ByteBuffer bb2 = newDirectByteBuffer(addr, 1000); // FIXME - while (bb2.get() != 0) { - } - byte[] bytes = new byte[bb2.position() - 1]; - bb2.rewind(); - getBytes(bb2, bytes, 0, bytes.length); - try { - array[i] = new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - array[i] = ""; - } - } - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static EnumerateCustomKeysResult imaqEnumerateCustomKeys(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqEnumerateCustomKeys(image.getAddress(), rv_addr + 0); - EnumerateCustomKeysResult rv = new EnumerateCustomKeysResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqEnumerateCustomKeys(long image, long size); - - public static int imaqGetBitDepth(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetBitDepth(image.getAddress(), rv_addr + 0); - int bitDepth; - bitDepth = rv_buf.getInt(0); - return bitDepth; - } - - private static native void _imaqGetBitDepth(long image, long bitDepth); - - public static int imaqGetBytesPerPixel(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetBytesPerPixel(image.getAddress(), rv_addr + 0); - int byteCount; - byteCount = rv_buf.getInt(0); - return byteCount; - } - - private static native void _imaqGetBytesPerPixel(long image, long byteCount); - - public static ImageInfo imaqGetImageInfo(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetImageInfo(image.getAddress(), rv_addr + 0); - ImageInfo info; - info = new ImageInfo(rv_buf, 0); - info.read(); - return info; - } - - private static native void _imaqGetImageInfo(long image, long info); - - public static class GetImageSizeResult { - public int width; - public int height; - - private GetImageSizeResult(ByteBuffer rv_buf) { - width = rv_buf.getInt(0); - height = rv_buf.getInt(8); - } - } - - public static GetImageSizeResult imaqGetImageSize(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetImageSize(image.getAddress(), rv_addr + 0, rv_addr + 8); - GetImageSizeResult rv = new GetImageSizeResult(rv_buf); - return rv; - } - - private static native void _imaqGetImageSize(long image, long width, long height); - - public static ImageType imaqGetImageType(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetImageType(image.getAddress(), rv_addr + 0); - ImageType type; - type = ImageType.fromValue(rv_buf.getInt(0)); - return type; - } - - private static native void _imaqGetImageType(long image, long type); - - public static Point imaqGetMaskOffset(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetMaskOffset(image.getAddress(), rv_addr + 0); - Point offset; - offset = new Point(rv_buf, 0); - offset.read(); - return offset; - } - - private static native void _imaqGetMaskOffset(long image, long offset); - - public static int imaqGetVisionInfoTypes(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetVisionInfoTypes(image.getAddress(), rv_addr + 0); - int present; - present = rv_buf.getInt(0); - return present; - } - - private static native void _imaqGetVisionInfoTypes(long image, long present); - - public static int imaqIsImageEmpty(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqIsImageEmpty(image.getAddress(), rv_addr + 0); - int empty; - empty = rv_buf.getInt(0); - return empty; - } - - private static native void _imaqIsImageEmpty(long image, long empty); - - public static RawData imaqReadCustomData(Image image, String key) { - ByteBuffer key_buf = null; - if (key != null) { - byte[] key_bytes; - try { - key_bytes = key.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - key_bytes = new byte[0]; - } - key_buf = ByteBuffer.allocateDirect(key_bytes.length + 1); - putBytes(key_buf, key_bytes, 0, key_bytes.length).put(key_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqReadCustomData(image.getAddress(), key == null ? 0 : getByteBufferAddress(key_buf), - rv_addr + 0); - int size; - RawData val; - size = rv_buf.getInt(0); - val = new RawData(jn_rv, false, size); - return val; - } - - private static native long _imaqReadCustomData(long image, long key, long size); - - public static void imaqRemoveCustomData(Image image, String key) { - ByteBuffer key_buf = null; - if (key != null) { - byte[] key_bytes; - try { - key_bytes = key.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - key_bytes = new byte[0]; - } - key_buf = ByteBuffer.allocateDirect(key_bytes.length + 1); - putBytes(key_buf, key_bytes, 0, key_bytes.length).put(key_bytes.length, (byte) 0); - } - _imaqRemoveCustomData(image.getAddress(), key == null ? 0 : getByteBufferAddress(key_buf)); - - } - - private static native void _imaqRemoveCustomData(long image, long key); - - public static void imaqRemoveVisionInfo2(Image image, int info) { - - _imaqRemoveVisionInfo2(image.getAddress(), info); - - } - - private static native void _imaqRemoveVisionInfo2(long image, int info); - - public static void imaqSetBitDepth(Image image, int bitDepth) { - - _imaqSetBitDepth(image.getAddress(), bitDepth); - - } - - private static native void _imaqSetBitDepth(long image, int bitDepth); - - public static void imaqSetImageSize(Image image, int width, int height) { - - _imaqSetImageSize(image.getAddress(), width, height); - - } - - private static native void _imaqSetImageSize(long image, int width, int height); - - public static void imaqSetMaskOffset(Image image, Point offset) { - - _imaqSetMaskOffset(image.getAddress(), offset.getAddress()); - - } - - private static native void _imaqSetMaskOffset(long image, long offset); - - public static void imaqWriteCustomData(Image image, String key, RawData data, int size) { - ByteBuffer key_buf = null; - if (key != null) { - byte[] key_bytes; - try { - key_bytes = key.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - key_bytes = new byte[0]; - } - key_buf = ByteBuffer.allocateDirect(key_bytes.length + 1); - putBytes(key_buf, key_bytes, 0, key_bytes.length).put(key_bytes.length, (byte) 0); - } - _imaqWriteCustomData(image.getAddress(), key == null ? 0 : getByteBufferAddress(key_buf), - data.getAddress(), size); - - } - - private static native void _imaqWriteCustomData(long image, long key, long data, int size); - - /** - * Display functions - */ - - /** - * Image Manipulation functions - */ - - public static void imaqCopyRect(Image dest, Image source, Rect rect, Point destLoc) { - - _imaqCopyRect(dest.getAddress(), source.getAddress(), rect.getAddress(), destLoc.getAddress()); - - } - - private static native void _imaqCopyRect(long dest, long source, long rect, long destLoc); - - public static void imaqDuplicate(Image dest, Image source) { - - _imaqDuplicate(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqDuplicate(long dest, long source); - - public static RawData imaqFlatten(Image image, FlattenType type, CompressionType compression, - int quality) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqFlatten(image.getAddress(), type.getValue(), compression.getValue(), quality, - rv_addr + 0); - int size; - RawData val; - size = rv_buf.getInt(0); - val = new RawData(jn_rv, true, size); - return val; - } - - private static native long _imaqFlatten(long image, int type, int compression, int quality, - long size); - - public static void imaqFlip(Image dest, Image source, FlipAxis axis) { - - _imaqFlip(dest.getAddress(), source.getAddress(), axis.getValue()); - - } - - private static native void _imaqFlip(long dest, long source, int axis); - - public static void imaqMask(Image dest, Image source, Image mask) { - - _imaqMask(dest.getAddress(), source.getAddress(), mask.getAddress()); - - } - - private static native void _imaqMask(long dest, long source, long mask); - - public static void imaqResample(Image dest, Image source, int newWidth, int newHeight, - InterpolationMethod method, Rect rect) { - - _imaqResample(dest.getAddress(), source.getAddress(), newWidth, newHeight, method.getValue(), - rect.getAddress()); - - } - - private static native void _imaqResample(long dest, long source, int newWidth, int newHeight, - int method, long rect); - - public static void imaqScale(Image dest, Image source, int xScale, int yScale, - ScalingMode scaleMode, Rect rect) { - - _imaqScale(dest.getAddress(), source.getAddress(), xScale, yScale, scaleMode.getValue(), - rect.getAddress()); - - } - - private static native void _imaqScale(long dest, long source, int xScale, int yScale, - int scaleMode, long rect); - - public static void imaqTranspose(Image dest, Image source) { - - _imaqTranspose(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqTranspose(long dest, long source); - - public static void imaqUnflatten(Image image, RawData data, int size) { - - _imaqUnflatten(image.getAddress(), data.getAddress(), size); - - } - - private static native void _imaqUnflatten(long image, long data, int size); - - public static void imaqUnwrapImage(Image dest, Image source, Annulus annulus, - RectOrientation orientation, InterpolationMethod method) { - - _imaqUnwrapImage(dest.getAddress(), source.getAddress(), annulus.getAddress(), - orientation.getValue(), method.getValue()); - - } - - private static native void _imaqUnwrapImage(long dest, long source, long annulus, - int orientation, int method); - - public static void imaqView3D(Image dest, Image source, View3DOptions options) { - - _imaqView3D(dest.getAddress(), source.getAddress(), options.getAddress()); - - } - - private static native void _imaqView3D(long dest, long source, long options); - - /** - * File I/O functions - */ - - public static class GetFileInfoResult { - public CalibrationUnit calibrationUnit; - public float calibrationX; - public float calibrationY; - public int width; - public int height; - public ImageType imageType; - - private GetFileInfoResult(ByteBuffer rv_buf) { - calibrationUnit = CalibrationUnit.fromValue(rv_buf.getInt(0)); - calibrationX = rv_buf.getFloat(8); - calibrationY = rv_buf.getFloat(16); - width = rv_buf.getInt(24); - height = rv_buf.getInt(32); - imageType = ImageType.fromValue(rv_buf.getInt(40)); - } - } - - public static GetFileInfoResult imaqGetFileInfo(String fileName) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer rv_buf = - ByteBuffer.allocateDirect(8 + 8 + 8 + 8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetFileInfo(fileName == null ? 0 : getByteBufferAddress(fileName_buf), rv_addr + 0, - rv_addr + 8, rv_addr + 16, rv_addr + 24, rv_addr + 32, rv_addr + 40); - GetFileInfoResult rv = new GetFileInfoResult(rv_buf); - return rv; - } - - private static native void _imaqGetFileInfo(long fileName, long calibrationUnit, - long calibrationX, long calibrationY, long width, long height, long imageType); - - public static void imaqReadFile(Image image, String fileName) { - ByteBuffer fileName_buf; - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - _imaqReadFile(image.getAddress(), getByteBufferAddress(fileName_buf), 0, 0); - } - - private static native void _imaqReadFile(long image, long fileName, long colorTable, - long numColors); - - public static class ReadVisionFileResult { - public RGBValue colorTable; - public int numColors; - - private ReadVisionFileResult(ByteBuffer rv_buf) { - colorTable = new RGBValue(rv_buf, 0); - colorTable.read(); - numColors = rv_buf.getInt(8); - } - } - - public static ReadVisionFileResult imaqReadVisionFile(Image image, String fileName) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqReadVisionFile(image.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), rv_addr + 0, rv_addr + 8); - ReadVisionFileResult rv = new ReadVisionFileResult(rv_buf); - return rv; - } - - private static native void _imaqReadVisionFile(long image, long fileName, long colorTable, - long numColors); - - public static void imaqWriteBMPFile(Image image, String fileName, int compress, - RGBValue colorTable) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWriteBMPFile(image.getAddress(), - fileName == null ? 0 : getByteBufferAddress(fileName_buf), compress, colorTable == null ? 0 - : colorTable.getAddress()); - - } - - private static native void _imaqWriteBMPFile(long image, long fileName, int compress, - long colorTable); - - public static void imaqWriteFile(Image image, String fileName, RGBValue colorTable) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWriteFile(image.getAddress(), fileName == null ? 0 : getByteBufferAddress(fileName_buf), - colorTable == null ? 0 : colorTable.getAddress()); - - } - - private static native void _imaqWriteFile(long image, long fileName, long colorTable); - - public static void imaqWriteJPEGFile(Image image, String fileName, int quality, RawData colorTable) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWriteJPEGFile(image.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), quality, - colorTable == null ? 0 : colorTable.getAddress()); - - } - - private static native void _imaqWriteJPEGFile(long image, long fileName, int quality, - long colorTable); - - public static void imaqWritePNGFile2(Image image, String fileName, int compressionSpeed, - RGBValue colorTable, int useBitDepth) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWritePNGFile2(image.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), compressionSpeed, - colorTable == null ? 0 : colorTable.getAddress(), useBitDepth); - - } - - private static native void _imaqWritePNGFile2(long image, long fileName, int compressionSpeed, - long colorTable, int useBitDepth); - - public static void imaqWriteTIFFFile(Image image, String fileName, TIFFFileOptions options, - RGBValue colorTable) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWriteTIFFFile(image.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), options == null ? 0 : options.getAddress(), - colorTable == null ? 0 : colorTable.getAddress()); - - } - - private static native void _imaqWriteTIFFFile(long image, long fileName, long options, - long colorTable); - - public static void imaqWriteVisionFile(Image image, String fileName, RGBValue colorTable) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - _imaqWriteVisionFile(image.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), colorTable.getAddress()); - - } - - private static native void _imaqWriteVisionFile(long image, long fileName, long colorTable); - - /** - * Analytic Geometry functions - */ - - public static CoordinateSystem imaqBuildCoordinateSystem(Point points, ReferenceMode mode, - AxisOrientation orientation) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqBuildCoordinateSystem(points.getAddress(), mode.getValue(), orientation.getValue(), - rv_addr + 0); - CoordinateSystem system; - system = new CoordinateSystem(rv_buf, 0); - system.read(); - return system; - } - - private static native void _imaqBuildCoordinateSystem(long points, int mode, int orientation, - long system); - - public static BestCircle2 imaqFitCircle2(PointFloat[] points, FitCircleOptions options) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - long jn_rv = _imaqFitCircle2(getByteBufferAddress(points_buf), numPoints, options.getAddress()); - - return new BestCircle2(jn_rv, true); - } - - private static native long _imaqFitCircle2(long points, int numPoints, long options); - - public static BestEllipse2 imaqFitEllipse2(PointFloat[] points, FitEllipseOptions options) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - long jn_rv = - _imaqFitEllipse2(getByteBufferAddress(points_buf), numPoints, options.getAddress()); - - return new BestEllipse2(jn_rv, true); - } - - private static native long _imaqFitEllipse2(long points, int numPoints, long options); - - public static BestLine imaqFitLine(PointFloat[] points, FitLineOptions options) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - long jn_rv = _imaqFitLine(getByteBufferAddress(points_buf), numPoints, options.getAddress()); - - return new BestLine(jn_rv, true); - } - - private static native long _imaqFitLine(long points, int numPoints, long options); - - public static float imaqGetAngle(PointFloat start1, PointFloat end1, PointFloat start2, - PointFloat end2) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetAngle(start1.getAddress(), end1.getAddress(), start2.getAddress(), end2.getAddress(), - rv_addr + 0); - float angle; - angle = rv_buf.getFloat(0); - return angle; - } - - private static native void _imaqGetAngle(long start1, long end1, long start2, long end2, - long angle); - - public static class GetBisectingLineResult { - public PointFloat bisectStart; - public PointFloat bisectEnd; - - private GetBisectingLineResult(ByteBuffer rv_buf) { - bisectStart = new PointFloat(rv_buf, 0); - bisectStart.read(); - bisectEnd = new PointFloat(rv_buf, 8); - bisectEnd.read(); - } - } - - public static GetBisectingLineResult imaqGetBisectingLine(PointFloat start1, PointFloat end1, - PointFloat start2, PointFloat end2) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetBisectingLine(start1.getAddress(), end1.getAddress(), start2.getAddress(), - end2.getAddress(), rv_addr + 0, rv_addr + 8); - GetBisectingLineResult rv = new GetBisectingLineResult(rv_buf); - return rv; - } - - private static native void _imaqGetBisectingLine(long start1, long end1, long start2, long end2, - long bisectStart, long bisectEnd); - - public static float imaqGetDistance(PointFloat point1, PointFloat point2) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetDistance(point1.getAddress(), point2.getAddress(), rv_addr + 0); - float distance; - distance = rv_buf.getFloat(0); - return distance; - } - - private static native void _imaqGetDistance(long point1, long point2, long distance); - - public static PointFloat imaqGetIntersection(PointFloat start1, PointFloat end1, - PointFloat start2, PointFloat end2) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetIntersection(start1.getAddress(), end1.getAddress(), start2.getAddress(), - end2.getAddress(), rv_addr + 0); - PointFloat intersection; - intersection = new PointFloat(rv_buf, 0); - intersection.read(); - return intersection; - } - - private static native void _imaqGetIntersection(long start1, long end1, long start2, long end2, - long intersection); - - public static class GetMidLineResult { - public PointFloat midLineStart; - public PointFloat midLineEnd; - - private GetMidLineResult(ByteBuffer rv_buf) { - midLineStart = new PointFloat(rv_buf, 0); - midLineStart.read(); - midLineEnd = new PointFloat(rv_buf, 8); - midLineEnd.read(); - } - } - - public static GetMidLineResult imaqGetMidLine(PointFloat refLineStart, PointFloat refLineEnd, - PointFloat point) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetMidLine(refLineStart.getAddress(), refLineEnd.getAddress(), point.getAddress(), - rv_addr + 0, rv_addr + 8); - GetMidLineResult rv = new GetMidLineResult(rv_buf); - return rv; - } - - private static native void _imaqGetMidLine(long refLineStart, long refLineEnd, long point, - long midLineStart, long midLineEnd); - - public static class GetPerpendicularLineResult { - public PointFloat perpLineStart; - public PointFloat perpLineEnd; - public double distance; - - private GetPerpendicularLineResult(ByteBuffer rv_buf) { - perpLineStart = new PointFloat(rv_buf, 0); - perpLineStart.read(); - perpLineEnd = new PointFloat(rv_buf, 8); - perpLineEnd.read(); - distance = rv_buf.getDouble(16); - } - } - - public static GetPerpendicularLineResult imaqGetPerpendicularLine(PointFloat refLineStart, - PointFloat refLineEnd, PointFloat point) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetPerpendicularLine(refLineStart.getAddress(), refLineEnd.getAddress(), - point.getAddress(), rv_addr + 0, rv_addr + 8, rv_addr + 16); - GetPerpendicularLineResult rv = new GetPerpendicularLineResult(rv_buf); - return rv; - } - - private static native void _imaqGetPerpendicularLine(long refLineStart, long refLineEnd, - long point, long perpLineStart, long perpLineEnd, long distance); - - public static class GetPointsOnContourResult { - public SegmentInfo[] array; - private long array_addr; - - private GetPointsOnContourResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numSegments; - array_numSegments = rv_buf.getInt(0); - array = new SegmentInfo[array_numSegments]; - if (array_numSegments > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numSegments * 24); - for (int i = 0, off = 0; i < array_numSegments; i++, off += 24) { - array[i] = new SegmentInfo(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static GetPointsOnContourResult imaqGetPointsOnContour(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqGetPointsOnContour(image.getAddress(), rv_addr + 0); - GetPointsOnContourResult rv = new GetPointsOnContourResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqGetPointsOnContour(long image, long numSegments); - - public static class GetPointsOnLineResult { - public Point[] array; - private long array_addr; - - private GetPointsOnLineResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numPoints; - array_numPoints = rv_buf.getInt(0); - array = new Point[array_numPoints]; - if (array_numPoints > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numPoints * 8); - for (int i = 0, off = 0; i < array_numPoints; i++, off += 8) { - array[i] = new Point(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static GetPointsOnLineResult imaqGetPointsOnLine(Point start, Point end) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqGetPointsOnLine(start.getAddress(), end.getAddress(), rv_addr + 0); - GetPointsOnLineResult rv = new GetPointsOnLineResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqGetPointsOnLine(long start, long end, long numPoints); - - public static float imaqGetPolygonArea(PointFloat points, int numPoints) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetPolygonArea(points.getAddress(), numPoints, rv_addr + 0); - float area; - area = rv_buf.getFloat(0); - return area; - } - - private static native void _imaqGetPolygonArea(long points, int numPoints, long area); - - public static class InterpolatePointsResult { - public float[] array; - private long array_addr; - - private InterpolatePointsResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_interpCount; - array_interpCount = rv_buf.getInt(0); - array = new float[array_interpCount]; - if (array_interpCount > 0 && array_addr != 0) { - newDirectByteBuffer(array_addr, array_interpCount * 4).asFloatBuffer().get(array); - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static InterpolatePointsResult imaqInterpolatePoints(Image image, Point[] points, - InterpolationMethod method, int subpixel) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqInterpolatePoints(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - method.getValue(), subpixel, rv_addr + 0); - InterpolatePointsResult rv = new InterpolatePointsResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqInterpolatePoints(long image, long points, int numPoints, - int method, int subpixel, long interpCount); - - /** - * Clipboard functions - */ - - /** - * Border functions - */ - - public static void imaqFillBorder(Image image, BorderMethod method) { - - _imaqFillBorder(image.getAddress(), method.getValue()); - - } - - private static native void _imaqFillBorder(long image, int method); - - public static int imaqGetBorderSize(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetBorderSize(image.getAddress(), rv_addr + 0); - int borderSize; - borderSize = rv_buf.getInt(0); - return borderSize; - } - - private static native void _imaqGetBorderSize(long image, long borderSize); - - public static void imaqSetBorderSize(Image image, int size) { - - _imaqSetBorderSize(image.getAddress(), size); - - } - - private static native void _imaqSetBorderSize(long image, int size); - - /** - * Image Management functions - */ - - public static void imaqArrayToImage(Image image, RawData array, int numCols, int numRows) { - - _imaqArrayToImage(image.getAddress(), array.getAddress(), numCols, numRows); - - } - - private static native void _imaqArrayToImage(long image, long array, int numCols, int numRows); - - public static Image imaqCreateImage(ImageType type, int borderSize) { - - long jn_rv = _imaqCreateImage(type.getValue(), borderSize); - - return new Image(jn_rv, true); - } - - private static native long _imaqCreateImage(int type, int borderSize); - - /** - * Color Processing functions - */ - - public static void imaqColorBCGTransform(Image dest, Image source, BCGOptions redOptions, - BCGOptions greenOptions, BCGOptions blueOptions, Image mask) { - - _imaqColorBCGTransform(dest.getAddress(), source.getAddress(), redOptions == null ? 0 - : redOptions.getAddress(), greenOptions == null ? 0 : greenOptions.getAddress(), - blueOptions == null ? 0 : blueOptions.getAddress(), mask == null ? 0 : mask.getAddress()); - - } - - private static native void _imaqColorBCGTransform(long dest, long source, long redOptions, - long greenOptions, long blueOptions, long mask); - - public static void imaqColorEqualize(Image dest, Image source, int colorEqualization) { - - _imaqColorEqualize(dest.getAddress(), source.getAddress(), colorEqualization); - - } - - private static native void _imaqColorEqualize(long dest, long source, int colorEqualization); - - public static ColorHistogramReport imaqColorHistogram2(Image image, int numClasses, - ColorMode mode, CIEXYZValue whiteReference, Image mask) { - - long jn_rv = - _imaqColorHistogram2(image.getAddress(), numClasses, mode.getValue(), - whiteReference.getAddress(), mask == null ? 0 : mask.getAddress()); - - return new ColorHistogramReport(jn_rv, true); - } - - private static native long _imaqColorHistogram2(long image, int numClasses, int mode, - long whiteReference, long mask); - - public static void imaqColorThreshold(Image dest, Image source, int replaceValue, ColorMode mode, - Range plane1Range, Range plane2Range, Range plane3Range) { - - _imaqColorThreshold(dest.getAddress(), source.getAddress(), replaceValue, mode.getValue(), - plane1Range == null ? 0 : plane1Range.getAddress(), - plane2Range == null ? 0 : plane2Range.getAddress(), - plane3Range == null ? 0 : plane3Range.getAddress()); - - } - - private static native void _imaqColorThreshold(long dest, long source, int replaceValue, - int mode, long plane1Range, long plane2Range, long plane3Range); - - public static SupervisedColorSegmentationReport imaqSupervisedColorSegmentation( - ClassifierSession session, Image labelImage, Image srcImage, ROI roi, ROILabel labelIn, - int numLabelIn, int maxDistance, int minIdentificationScore, - ColorSegmenationOptions segmentOptions) { - - long jn_rv = - _imaqSupervisedColorSegmentation(session.getAddress(), labelImage.getAddress(), - srcImage.getAddress(), roi.getAddress(), labelIn.getAddress(), numLabelIn, maxDistance, - minIdentificationScore, segmentOptions.getAddress()); - - return new SupervisedColorSegmentationReport(jn_rv, true); - } - - private static native long _imaqSupervisedColorSegmentation(long session, long labelImage, - long srcImage, long roi, long labelIn, int numLabelIn, int maxDistance, - int minIdentificationScore, long segmentOptions); - - public static int imaqGetColorSegmentationMaxDistance(ClassifierSession session, - ColorSegmenationOptions segmentOptions, SegmentationDistanceLevel distLevel) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetColorSegmentationMaxDistance(session.getAddress(), segmentOptions.getAddress(), - distLevel.getValue(), rv_addr + 0); - int maxDistance; - maxDistance = rv_buf.getInt(0); - return maxDistance; - } - - private static native void _imaqGetColorSegmentationMaxDistance(long session, - long segmentOptions, int distLevel, long maxDistance); - - /** - * Transform functions - */ - - public static void imaqBCGTransform(Image dest, Image source, BCGOptions options, Image mask) { - - _imaqBCGTransform(dest.getAddress(), source.getAddress(), options.getAddress(), - mask == null ? 0 : mask.getAddress()); - - } - - private static native void _imaqBCGTransform(long dest, long source, long options, long mask); - - public static void imaqEqualize(Image dest, Image source, float min, float max, Image mask) { - - _imaqEqualize(dest.getAddress(), source.getAddress(), min, max, - mask == null ? 0 : mask.getAddress()); - - } - - private static native void _imaqEqualize(long dest, long source, float min, float max, long mask); - - public static void imaqInverse(Image dest, Image source, Image mask) { - - _imaqInverse(dest.getAddress(), source.getAddress(), mask == null ? 0 : mask.getAddress()); - - } - - private static native void _imaqInverse(long dest, long source, long mask); - - public static void imaqMathTransform(Image dest, Image source, MathTransformMethod method, - float rangeMin, float rangeMax, float power, Image mask) { - - _imaqMathTransform(dest.getAddress(), source.getAddress(), method.getValue(), rangeMin, - rangeMax, power, mask == null ? 0 : mask.getAddress()); - - } - - private static native void _imaqMathTransform(long dest, long source, int method, float rangeMin, - float rangeMax, float power, long mask); - - public static int imaqWatershedTransform(Image dest, Image source, int connectivity8) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqWatershedTransform(dest.getAddress(), source.getAddress(), connectivity8, rv_addr + 0); - int zoneCount; - zoneCount = rv_buf.getInt(0); - return zoneCount; - } - - private static native void _imaqWatershedTransform(long dest, long source, int connectivity8, - long zoneCount); - - /** - * Window Management functions - */ - - /** - * Utilities functions - */ - - public static int imaqMulticoreOptions(MulticoreOperation operation) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqMulticoreOptions(operation.getValue(), rv_addr + 0); - int customNumCores; - customNumCores = rv_buf.getInt(0); - return customNumCores; - } - - private static native void _imaqMulticoreOptions(int operation, long customNumCores); - - /** - * Tool Window functions - */ - - /** - * Meter functions - */ - - public static MeterArc imaqGetMeterArc(int lightNeedle, MeterArcMode mode, ROI roi, - PointFloat base, PointFloat start, PointFloat end) { - - long jn_rv = - _imaqGetMeterArc(lightNeedle, mode.getValue(), roi.getAddress(), base.getAddress(), - start.getAddress(), end.getAddress()); - - return new MeterArc(jn_rv, true); - } - - private static native long _imaqGetMeterArc(int lightNeedle, int mode, long roi, long base, - long start, long end); - - public static class ReadMeterResult { - public double percentage; - public PointFloat endOfNeedle; - - private ReadMeterResult(ByteBuffer rv_buf) { - percentage = rv_buf.getDouble(0); - endOfNeedle = new PointFloat(rv_buf, 8); - endOfNeedle.read(); - } - } - - public static ReadMeterResult imaqReadMeter(Image image, MeterArc arcInfo) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqReadMeter(image.getAddress(), arcInfo.getAddress(), rv_addr + 0, rv_addr + 8); - ReadMeterResult rv = new ReadMeterResult(rv_buf); - return rv; - } - - private static native void _imaqReadMeter(long image, long arcInfo, long percentage, - long endOfNeedle); - - /** - * Calibration functions - */ - - public static void imaqCopyCalibrationInfo2(Image dest, Image source, Point offset) { - - _imaqCopyCalibrationInfo2(dest.getAddress(), source.getAddress(), offset.getAddress()); - - } - - private static native void _imaqCopyCalibrationInfo2(long dest, long source, long offset); - - public static CalibrationInfo imaqGetCalibrationInfo2(Image image) { - - long jn_rv = _imaqGetCalibrationInfo2(image.getAddress()); - - return new CalibrationInfo(jn_rv, true); - } - - private static native long _imaqGetCalibrationInfo2(long image); - - public static CalibrationInfo imaqGetCalibrationInfo3(Image image, int isGetErrorMap) { - - long jn_rv = _imaqGetCalibrationInfo3(image.getAddress(), isGetErrorMap); - - return new CalibrationInfo(jn_rv, true); - } - - private static native long _imaqGetCalibrationInfo3(long image, int isGetErrorMap); - - public static float imaqLearnCalibrationGrid(Image image, ROI roi, - LearnCalibrationOptions options, GridDescriptor grid, CoordinateSystem system, - RangeFloat range) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLearnCalibrationGrid(image.getAddress(), roi.getAddress(), options.getAddress(), - grid.getAddress(), system.getAddress(), range.getAddress(), rv_addr + 0); - float quality; - quality = rv_buf.getFloat(0); - return quality; - } - - private static native void _imaqLearnCalibrationGrid(long image, long roi, long options, - long grid, long system, long range, long quality); - - public static float imaqLearnCalibrationPoints(Image image, CalibrationPoints points, ROI roi, - LearnCalibrationOptions options, GridDescriptor grid, CoordinateSystem system) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLearnCalibrationPoints(image.getAddress(), points.getAddress(), roi.getAddress(), - options.getAddress(), grid.getAddress(), system.getAddress(), rv_addr + 0); - float quality; - quality = rv_buf.getFloat(0); - return quality; - } - - private static native void _imaqLearnCalibrationPoints(long image, long points, long roi, - long options, long grid, long system, long quality); - - public static void imaqSetCoordinateSystem(Image image, CoordinateSystem system) { - - _imaqSetCoordinateSystem(image.getAddress(), system.getAddress()); - - } - - private static native void _imaqSetCoordinateSystem(long image, long system); - - public static void imaqSetSimpleCalibration(Image image, ScalingMethod method, int learnTable, - GridDescriptor grid, CoordinateSystem system) { - - _imaqSetSimpleCalibration(image.getAddress(), method.getValue(), learnTable, grid.getAddress(), - system.getAddress()); - - } - - private static native void _imaqSetSimpleCalibration(long image, int method, int learnTable, - long grid, long system); - - public static TransformReport imaqTransformPixelToRealWorld(Image image, - PointFloat[] pixelCoordinates) { - int numCoordinates = pixelCoordinates.length; - ByteBuffer pixelCoordinates_buf = null; - pixelCoordinates_buf = - ByteBuffer.allocateDirect(pixelCoordinates.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < pixelCoordinates.length; i++, off += 8) { - pixelCoordinates[i].setBuffer(pixelCoordinates_buf, off); - pixelCoordinates[i].write(); - } - long jn_rv = - _imaqTransformPixelToRealWorld(image.getAddress(), - getByteBufferAddress(pixelCoordinates_buf), numCoordinates); - - return new TransformReport(jn_rv, true); - } - - private static native long _imaqTransformPixelToRealWorld(long image, long pixelCoordinates, - int numCoordinates); - - public static TransformReport imaqTransformRealWorldToPixel(Image image, - PointFloat[] realWorldCoordinates) { - int numCoordinates = realWorldCoordinates.length; - ByteBuffer realWorldCoordinates_buf = null; - realWorldCoordinates_buf = - ByteBuffer.allocateDirect(realWorldCoordinates.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < realWorldCoordinates.length; i++, off += 8) { - realWorldCoordinates[i].setBuffer(realWorldCoordinates_buf, off); - realWorldCoordinates[i].write(); - } - long jn_rv = - _imaqTransformRealWorldToPixel(image.getAddress(), - getByteBufferAddress(realWorldCoordinates_buf), numCoordinates); - - return new TransformReport(jn_rv, true); - } - - private static native long _imaqTransformRealWorldToPixel(long image, long realWorldCoordinates, - int numCoordinates); - - public static void imaqSetSimpleCalibration2(Image image, GridDescriptor gridDescriptor) { - - _imaqSetSimpleCalibration2(image.getAddress(), gridDescriptor.getAddress()); - - } - - private static native void _imaqSetSimpleCalibration2(long image, long gridDescriptor); - - public static CoordinateSystem imaqCalibrationSetAxisInfo(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqCalibrationSetAxisInfo(image.getAddress(), rv_addr + 0); - CoordinateSystem axisInfo; - axisInfo = new CoordinateSystem(rv_buf, 0); - axisInfo.read(); - return axisInfo; - } - - private static native void _imaqCalibrationSetAxisInfo(long image, long axisInfo); - - public static void imaqCalibrationGetThumbnailImage(Image templateImage, Image image, - CalibrationThumbnailType type, int index) { - - _imaqCalibrationGetThumbnailImage(templateImage.getAddress(), image.getAddress(), - type.getValue(), index); - - } - - private static native void _imaqCalibrationGetThumbnailImage(long templateImage, long image, - int type, int index); - - public static GetCalibrationInfoReport imaqCalibrationGetCalibrationInfo(Image image, - int isGetErrorMap) { - - long jn_rv = _imaqCalibrationGetCalibrationInfo(image.getAddress(), isGetErrorMap); - - return new GetCalibrationInfoReport(jn_rv, true); - } - - private static native long _imaqCalibrationGetCalibrationInfo(long image, int isGetErrorMap); - - public static GetCameraParametersReport imaqCalibrationGetCameraParameters(Image templateImage) { - - long jn_rv = _imaqCalibrationGetCameraParameters(templateImage.getAddress()); - - return new GetCameraParametersReport(jn_rv, true); - } - - private static native long _imaqCalibrationGetCameraParameters(long templateImage); - - public static void imaqCalibrationCompactInformation(Image image) { - - _imaqCalibrationCompactInformation(image.getAddress()); - - } - - private static native void _imaqCalibrationCompactInformation(long image); - - /** - * Pixel Manipulation functions - */ - - public static void imaqExtractColorPlanes(Image image, ColorMode mode, Image plane1, - Image plane2, Image plane3) { - - _imaqExtractColorPlanes(image.getAddress(), mode.getValue(), - plane1 == null ? 0 : plane1.getAddress(), plane2 == null ? 0 : plane2.getAddress(), - plane3 == null ? 0 : plane3.getAddress()); - - } - - private static native void _imaqExtractColorPlanes(long image, int mode, long plane1, - long plane2, long plane3); - - public static void imaqExtractComplexPlane(Image dest, Image source, ComplexPlane plane) { - - _imaqExtractComplexPlane(dest.getAddress(), source.getAddress(), plane.getValue()); - - } - - private static native void _imaqExtractComplexPlane(long dest, long source, int plane); - - public static void imaqReplaceColorPlanes(Image dest, Image source, ColorMode mode, Image plane1, - Image plane2, Image plane3) { - - _imaqReplaceColorPlanes(dest.getAddress(), source.getAddress(), mode.getValue(), - plane1 == null ? 0 : plane1.getAddress(), plane2 == null ? 0 : plane2.getAddress(), - plane3 == null ? 0 : plane3.getAddress()); - - } - - private static native void _imaqReplaceColorPlanes(long dest, long source, int mode, long plane1, - long plane2, long plane3); - - public static void imaqReplaceComplexPlane(Image dest, Image source, Image newValues, - ComplexPlane plane) { - - _imaqReplaceComplexPlane(dest.getAddress(), source.getAddress(), newValues.getAddress(), - plane.getValue()); - - } - - private static native void _imaqReplaceComplexPlane(long dest, long source, long newValues, - int plane); - - /** - * Color Matching functions - */ - - public static ColorInformation imaqLearnColor(Image image, ROI roi, ColorSensitivity sensitivity, - int saturation) { - - long jn_rv = - _imaqLearnColor(image.getAddress(), roi == null ? 0 : roi.getAddress(), - sensitivity.getValue(), saturation); - - return new ColorInformation(jn_rv, true); - } - - private static native long _imaqLearnColor(long image, long roi, int sensitivity, int saturation); - - public static class MatchColorResult { - public int[] array; - private long array_addr; - - private MatchColorResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numScores; - array_numScores = rv_buf.getInt(0); - array = new int[array_numScores]; - if (array_numScores > 0 && array_addr != 0) { - newDirectByteBuffer(array_addr, array_numScores * 4).asIntBuffer().get(array); - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchColorResult imaqMatchColor(Image image, ColorInformation info, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchColor(image.getAddress(), info.getAddress(), roi == null ? 0 : roi.getAddress(), - rv_addr + 0); - MatchColorResult rv = new MatchColorResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchColor(long image, long info, long roi, long numScores); - - /** - * Frequency Domain Analysis functions - */ - - public static void imaqAttenuate(Image dest, Image source, AttenuateMode highlow) { - - _imaqAttenuate(dest.getAddress(), source.getAddress(), highlow.getValue()); - - } - - private static native void _imaqAttenuate(long dest, long source, int highlow); - - public static void imaqConjugate(Image dest, Image source) { - - _imaqConjugate(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqConjugate(long dest, long source); - - public static void imaqFFT(Image dest, Image source) { - - _imaqFFT(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqFFT(long dest, long source); - - public static void imaqFlipFrequencies(Image dest, Image source) { - - _imaqFlipFrequencies(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqFlipFrequencies(long dest, long source); - - public static void imaqInverseFFT(Image dest, Image source) { - - _imaqInverseFFT(dest.getAddress(), source.getAddress()); - - } - - private static native void _imaqInverseFFT(long dest, long source); - - public static void imaqTruncate(Image dest, Image source, TruncateMode highlow, float ratioToKeep) { - - _imaqTruncate(dest.getAddress(), source.getAddress(), highlow.getValue(), ratioToKeep); - - } - - private static native void _imaqTruncate(long dest, long source, int highlow, float ratioToKeep); - - /** - * Barcode I/O functions - */ - - public static AIMGradeReport imaqGradeDataMatrixBarcodeAIM(Image image) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGradeDataMatrixBarcodeAIM(image.getAddress(), rv_addr + 0); - AIMGradeReport report; - report = new AIMGradeReport(rv_buf, 0); - report.read(); - return report; - } - - private static native void _imaqGradeDataMatrixBarcodeAIM(long image, long report); - - public static BarcodeInfo imaqReadBarcode(Image image, BarcodeType type, ROI roi, int validate) { - - long jn_rv = - _imaqReadBarcode(image.getAddress(), type.getValue(), roi == null ? 0 : roi.getAddress(), - validate); - - return new BarcodeInfo(jn_rv, true); - } - - private static native long _imaqReadBarcode(long image, int type, long roi, int validate); - - public static DataMatrixReport imaqReadDataMatrixBarcode2(Image image, ROI roi, - DataMatrixGradingMode prepareForGrading, DataMatrixDescriptionOptions descriptionOptions, - DataMatrixSizeOptions sizeOptions, DataMatrixSearchOptions searchOptions) { - - long jn_rv = - _imaqReadDataMatrixBarcode2(image.getAddress(), roi.getAddress(), - prepareForGrading.getValue(), descriptionOptions.getAddress(), - sizeOptions.getAddress(), searchOptions.getAddress()); - - return new DataMatrixReport(jn_rv, true); - } - - private static native long _imaqReadDataMatrixBarcode2(long image, long roi, - int prepareForGrading, long descriptionOptions, long sizeOptions, long searchOptions); - - public static class ReadPDF417BarcodeResult { - public Barcode2DInfo[] array; - private long array_addr; - - private ReadPDF417BarcodeResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numBarcodes; - array_numBarcodes = rv_buf.getInt(0); - array = new Barcode2DInfo[array_numBarcodes]; - if (array_numBarcodes > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numBarcodes * 64); - for (int i = 0, off = 0; i < array_numBarcodes; i++, off += 64) { - array[i] = new Barcode2DInfo(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static ReadPDF417BarcodeResult imaqReadPDF417Barcode(Image image, ROI roi, - Barcode2DSearchMode searchMode) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqReadPDF417Barcode(image.getAddress(), roi.getAddress(), searchMode.getValue(), - rv_addr + 0); - ReadPDF417BarcodeResult rv = new ReadPDF417BarcodeResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqReadPDF417Barcode(long image, long roi, int searchMode, - long numBarcodes); - - public static QRCodeReport imaqReadQRCode(Image image, ROI roi, QRGradingMode reserved, - QRCodeDescriptionOptions descriptionOptions, QRCodeSizeOptions sizeOptions, - QRCodeSearchOptions searchOptions) { - - long jn_rv = - _imaqReadQRCode(image.getAddress(), roi.getAddress(), reserved.getValue(), - descriptionOptions.getAddress(), sizeOptions.getAddress(), searchOptions.getAddress()); - - return new QRCodeReport(jn_rv, true); - } - - private static native long _imaqReadQRCode(long image, long roi, int reserved, - long descriptionOptions, long sizeOptions, long searchOptions); - - /** - * LCD functions - */ - - public static void imaqFindLCDSegments(ROI roi, Image image, LCDOptions options) { - - _imaqFindLCDSegments(roi.getAddress(), image.getAddress(), - options == null ? 0 : options.getAddress()); - - } - - private static native void _imaqFindLCDSegments(long roi, long image, long options); - - public static LCDReport imaqReadLCD(Image image, ROI roi, LCDOptions options) { - - long jn_rv = - _imaqReadLCD(image.getAddress(), roi.getAddress(), - options == null ? 0 : options.getAddress()); - - return new LCDReport(jn_rv, true); - } - - private static native long _imaqReadLCD(long image, long roi, long options); - - /** - * Shape Matching functions - */ - - public static class MatchShapeResult { - public ShapeReport[] array; - private long array_addr; - - private MatchShapeResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new ShapeReport[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 40); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 40) { - array[i] = new ShapeReport(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchShapeResult imaqMatchShape(Image dest, Image source, Image templateImage, - int scaleInvariant, int connectivity8, double tolerance) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchShape(dest.getAddress(), source.getAddress(), templateImage.getAddress(), - scaleInvariant, connectivity8, tolerance, rv_addr + 0); - MatchShapeResult rv = new MatchShapeResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchShape(long dest, long source, long templateImage, - int scaleInvariant, int connectivity8, double tolerance, long numMatches); - - /** - * Contours functions - */ - - public static int imaqAddAnnulusContour(ROI roi, Annulus annulus) { - - int jn_rv = _imaqAddAnnulusContour(roi.getAddress(), annulus.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddAnnulusContour(long roi, long annulus); - - public static int imaqAddClosedContour(ROI roi, Point[] points) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - int jn_rv = - _imaqAddClosedContour(roi.getAddress(), getByteBufferAddress(points_buf), numPoints); - - return jn_rv; - } - - private static native int _imaqAddClosedContour(long roi, long points, int numPoints); - - public static int imaqAddLineContour(ROI roi, Point start, Point end) { - - int jn_rv = _imaqAddLineContour(roi.getAddress(), start.getAddress(), end.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddLineContour(long roi, long start, long end); - - public static int imaqAddOpenContour(ROI roi, Point[] points) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - int jn_rv = _imaqAddOpenContour(roi.getAddress(), getByteBufferAddress(points_buf), numPoints); - - return jn_rv; - } - - private static native int _imaqAddOpenContour(long roi, long points, int numPoints); - - public static int imaqAddOvalContour(ROI roi, Rect boundingBox) { - - int jn_rv = _imaqAddOvalContour(roi.getAddress(), boundingBox.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddOvalContour(long roi, long boundingBox); - - public static int imaqAddPointContour(ROI roi, Point point) { - - int jn_rv = _imaqAddPointContour(roi.getAddress(), point.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddPointContour(long roi, long point); - - public static int imaqAddRectContour(ROI roi, Rect rect) { - - int jn_rv = _imaqAddRectContour(roi.getAddress(), rect.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddRectContour(long roi, long rect); - - public static int imaqAddRotatedRectContour2(ROI roi, RotatedRect rect) { - - int jn_rv = _imaqAddRotatedRectContour2(roi.getAddress(), rect.getAddress()); - - return jn_rv; - } - - private static native int _imaqAddRotatedRectContour2(long roi, long rect); - - public static int imaqCopyContour(ROI destRoi, ROI sourceRoi, int id) { - - int jn_rv = _imaqCopyContour(destRoi.getAddress(), sourceRoi.getAddress(), id); - - return jn_rv; - } - - private static native int _imaqCopyContour(long destRoi, long sourceRoi, int id); - - public static int imaqGetContour(ROI roi, int index) { - - int jn_rv = _imaqGetContour(roi.getAddress(), index); - - return jn_rv; - } - - private static native int _imaqGetContour(long roi, int index); - - public static RGBValue imaqGetContourColor(ROI roi, int id) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetContourColor(roi.getAddress(), id, rv_addr + 0); - RGBValue contourColor; - contourColor = new RGBValue(rv_buf, 0); - contourColor.read(); - return contourColor; - } - - private static native void _imaqGetContourColor(long roi, int id, long contourColor); - - public static void imaqGetContourCount(ROI roi) { - - _imaqGetContourCount(roi.getAddress()); - - } - - private static native void _imaqGetContourCount(long roi); - - public static ContourInfo2 imaqGetContourInfo2(ROI roi, int id) { - - long jn_rv = _imaqGetContourInfo2(roi.getAddress(), id); - - return new ContourInfo2(jn_rv, true); - } - - private static native long _imaqGetContourInfo2(long roi, int id); - - public static void imaqMoveContour(ROI roi, int id, int deltaX, int deltaY) { - - _imaqMoveContour(roi.getAddress(), id, deltaX, deltaY); - - } - - private static native void _imaqMoveContour(long roi, int id, int deltaX, int deltaY); - - public static void imaqRemoveContour(ROI roi, int id) { - - _imaqRemoveContour(roi.getAddress(), id); - - } - - private static native void _imaqRemoveContour(long roi, int id); - - public static void imaqSetContourColor(ROI roi, int id, RGBValue color) { - - _imaqSetContourColor(roi.getAddress(), id, color.getAddress()); - - } - - private static native void _imaqSetContourColor(long roi, int id, long color); - - /** - * Regions of Interest functions - */ - - public static ROI imaqCreateROI() { - - long jn_rv = _imaqCreateROI(); - - return new ROI(jn_rv, true); - } - - private static native long _imaqCreateROI(); - - public static Rect imaqGetROIBoundingBox(ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetROIBoundingBox(roi.getAddress(), rv_addr + 0); - Rect boundingBox; - boundingBox = new Rect(rv_buf, 0); - boundingBox.read(); - return boundingBox; - } - - private static native void _imaqGetROIBoundingBox(long roi, long boundingBox); - - public static RGBValue imaqGetROIColor(ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetROIColor(roi.getAddress(), rv_addr + 0); - RGBValue roiColor; - roiColor = new RGBValue(rv_buf, 0); - roiColor.read(); - return roiColor; - } - - private static native void _imaqGetROIColor(long roi, long roiColor); - - public static void imaqSetROIColor(ROI roi, RGBValue color) { - - _imaqSetROIColor(roi.getAddress(), color.getAddress()); - - } - - private static native void _imaqSetROIColor(long roi, long color); - - /** - * Image Analysis functions - */ - - public static PointFloat imaqCentroid(Image image, Image mask) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqCentroid(image.getAddress(), rv_addr + 0, mask.getAddress()); - PointFloat centroid; - centroid = new PointFloat(rv_buf, 0); - centroid.read(); - return centroid; - } - - private static native void _imaqCentroid(long image, long centroid, long mask); - - public static class ExtractCurvesResult { - public Curve[] array; - private long array_addr; - - private ExtractCurvesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numCurves; - array_numCurves = rv_buf.getInt(0); - array = new Curve[array_numCurves]; - if (array_numCurves > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCurves * 48); - for (int i = 0, off = 0; i < array_numCurves; i++, off += 48) { - array[i] = new Curve(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static ExtractCurvesResult imaqExtractCurves(Image image, ROI roi, - CurveOptions curveOptions) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqExtractCurves(image.getAddress(), roi.getAddress(), curveOptions.getAddress(), - rv_addr + 0); - ExtractCurvesResult rv = new ExtractCurvesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqExtractCurves(long image, long roi, long curveOptions, - long numCurves); - - public static HistogramReport imaqHistogram(Image image, int numClasses, float min, float max, - Image mask) { - - long jn_rv = - _imaqHistogram(image.getAddress(), numClasses, min, max, - mask == null ? 0 : mask.getAddress()); - - return new HistogramReport(jn_rv, true); - } - - private static native long _imaqHistogram(long image, int numClasses, float min, float max, - long mask); - - public static LinearAverages imaqLinearAverages2(Image image, LinearAveragesMode mode, Rect rect) { - - long jn_rv = _imaqLinearAverages2(image.getAddress(), mode.getValue(), rect.getAddress()); - - return new LinearAverages(jn_rv, true); - } - - private static native long _imaqLinearAverages2(long image, int mode, long rect); - - public static LineProfile imaqLineProfile(Image image, Point start, Point end) { - - long jn_rv = _imaqLineProfile(image.getAddress(), start.getAddress(), end.getAddress()); - - return new LineProfile(jn_rv, true); - } - - private static native long _imaqLineProfile(long image, long start, long end); - - public static QuantifyReport imaqQuantify(Image image, Image mask) { - - long jn_rv = _imaqQuantify(image.getAddress(), mask == null ? 0 : mask.getAddress()); - - return new QuantifyReport(jn_rv, true); - } - - private static native long _imaqQuantify(long image, long mask); - - /** - * Threshold functions - */ - - public static ThresholdData imaqAutoThreshold2(Image dest, Image source, int numClasses, - ThresholdMethod method, Image mask) { - - long jn_rv = - _imaqAutoThreshold2(dest.getAddress(), source.getAddress(), numClasses, method.getValue(), - mask.getAddress()); - - return new ThresholdData(jn_rv, true); - } - - private static native long _imaqAutoThreshold2(long dest, long source, int numClasses, - int method, long mask); - - public static void imaqLocalThreshold(Image dest, Image source, int windowWidth, - int windowHeight, LocalThresholdMethod method, double deviationWeight, ObjectType type, - float replaceValue) { - - _imaqLocalThreshold(dest.getAddress(), source.getAddress(), windowWidth, windowHeight, - method.getValue(), deviationWeight, type.getValue(), replaceValue); - - } - - private static native void _imaqLocalThreshold(long dest, long source, int windowWidth, - int windowHeight, int method, double deviationWeight, int type, float replaceValue); - - public static void imaqMagicWand(Image dest, Image source, Point coord, float tolerance, - int connectivity8, float replaceValue) { - - _imaqMagicWand(dest.getAddress(), source.getAddress(), coord.getAddress(), tolerance, - connectivity8, replaceValue); - - } - - private static native void _imaqMagicWand(long dest, long source, long coord, float tolerance, - int connectivity8, float replaceValue); - - public static void imaqMultithreshold(Image dest, Image source, ThresholdData[] ranges) { - int numRanges = ranges.length; - ByteBuffer ranges_buf = null; - ranges_buf = ByteBuffer.allocateDirect(ranges.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < ranges.length; i++, off += 16) { - ranges[i].setBuffer(ranges_buf, off); - ranges[i].write(); - } - _imaqMultithreshold(dest.getAddress(), source.getAddress(), getByteBufferAddress(ranges_buf), - numRanges); - - } - - private static native void _imaqMultithreshold(long dest, long source, long ranges, int numRanges); - - public static void imaqThreshold(Image dest, Image source, float rangeMin, float rangeMax, - int useNewValue, float newValue) { - - _imaqThreshold(dest.getAddress(), source.getAddress(), rangeMin, rangeMax, useNewValue, - newValue); - - } - - private static native void _imaqThreshold(long dest, long source, float rangeMin, float rangeMax, - int useNewValue, float newValue); - - /** - * Memory Management functions - */ - - /** - * Pattern Matching functions - */ - - public static class DetectCirclesResult { - public CircleMatch[] array; - private long array_addr; - - private DetectCirclesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatchesReturned; - array_numMatchesReturned = rv_buf.getInt(0); - array = new CircleMatch[array_numMatchesReturned]; - if (array_numMatchesReturned > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned * 24); - for (int i = 0, off = 0; i < array_numMatchesReturned; i++, off += 24) { - array[i] = new CircleMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static DetectCirclesResult imaqDetectCircles(Image image, - CircleDescriptor circleDescriptor, CurveOptions curveOptions, - ShapeDetectionOptions shapeDetectionOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqDetectCircles(image.getAddress(), circleDescriptor.getAddress(), - curveOptions.getAddress(), shapeDetectionOptions.getAddress(), roi.getAddress(), - rv_addr + 0); - DetectCirclesResult rv = new DetectCirclesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqDetectCircles(long image, long circleDescriptor, - long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned); - - public static class DetectEllipsesResult { - public EllipseMatch[] array; - private long array_addr; - - private DetectEllipsesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatchesReturned; - array_numMatchesReturned = rv_buf.getInt(0); - array = new EllipseMatch[array_numMatchesReturned]; - if (array_numMatchesReturned > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned * 40); - for (int i = 0, off = 0; i < array_numMatchesReturned; i++, off += 40) { - array[i] = new EllipseMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static DetectEllipsesResult imaqDetectEllipses(Image image, - EllipseDescriptor ellipseDescriptor, CurveOptions curveOptions, - ShapeDetectionOptions shapeDetectionOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqDetectEllipses(image.getAddress(), ellipseDescriptor.getAddress(), - curveOptions.getAddress(), shapeDetectionOptions.getAddress(), roi.getAddress(), - rv_addr + 0); - DetectEllipsesResult rv = new DetectEllipsesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqDetectEllipses(long image, long ellipseDescriptor, - long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned); - - public static class DetectLinesResult { - public LineMatch[] array; - private long array_addr; - - private DetectLinesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatchesReturned; - array_numMatchesReturned = rv_buf.getInt(0); - array = new LineMatch[array_numMatchesReturned]; - if (array_numMatchesReturned > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned * 40); - for (int i = 0, off = 0; i < array_numMatchesReturned; i++, off += 40) { - array[i] = new LineMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static DetectLinesResult imaqDetectLines(Image image, LineDescriptor lineDescriptor, - CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqDetectLines(image.getAddress(), lineDescriptor.getAddress(), - curveOptions.getAddress(), shapeDetectionOptions.getAddress(), roi.getAddress(), - rv_addr + 0); - DetectLinesResult rv = new DetectLinesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqDetectLines(long image, long lineDescriptor, long curveOptions, - long shapeDetectionOptions, long roi, long numMatchesReturned); - - public static class DetectRectanglesResult { - public RectangleMatch[] array; - private long array_addr; - - private DetectRectanglesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatchesReturned; - array_numMatchesReturned = rv_buf.getInt(0); - array = new RectangleMatch[array_numMatchesReturned]; - if (array_numMatchesReturned > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned * 64); - for (int i = 0, off = 0; i < array_numMatchesReturned; i++, off += 64) { - array[i] = new RectangleMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static DetectRectanglesResult imaqDetectRectangles(Image image, - RectangleDescriptor rectangleDescriptor, CurveOptions curveOptions, - ShapeDetectionOptions shapeDetectionOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqDetectRectangles(image.getAddress(), rectangleDescriptor.getAddress(), - curveOptions.getAddress(), shapeDetectionOptions.getAddress(), roi.getAddress(), - rv_addr + 0); - DetectRectanglesResult rv = new DetectRectanglesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqDetectRectangles(long image, long rectangleDescriptor, - long curveOptions, long shapeDetectionOptions, long roi, long numMatchesReturned); - - public static class GetGeometricFeaturesFromCurvesResult { - public FeatureData[] array; - private long array_addr; - - private GetGeometricFeaturesFromCurvesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numFeatures; - array_numFeatures = rv_buf.getInt(0); - array = new FeatureData[array_numFeatures]; - if (array_numFeatures > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numFeatures * 16); - for (int i = 0, off = 0; i < array_numFeatures; i++, off += 16) { - array[i] = new FeatureData(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static GetGeometricFeaturesFromCurvesResult imaqGetGeometricFeaturesFromCurves( - Curve[] curves, FeatureType[] featureTypes) { - int numCurves = curves.length; - ByteBuffer curves_buf = null; - curves_buf = ByteBuffer.allocateDirect(curves.length * 48).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < curves.length; i++, off += 48) { - curves[i].setBuffer(curves_buf, off); - curves[i].write(); - } - int numFeatureTypes = featureTypes.length; - ByteBuffer featureTypes_buf = null; - featureTypes_buf = - ByteBuffer.allocateDirect(featureTypes.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < featureTypes.length; i++, off += 4) { - if (featureTypes != null) - featureTypes_buf.putInt(off, featureTypes[i].getValue()); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqGetGeometricFeaturesFromCurves(getByteBufferAddress(curves_buf), numCurves, - getByteBufferAddress(featureTypes_buf), numFeatureTypes, rv_addr + 0); - GetGeometricFeaturesFromCurvesResult rv = - new GetGeometricFeaturesFromCurvesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqGetGeometricFeaturesFromCurves(long curves, int numCurves, - long featureTypes, int numFeatureTypes, long numFeatures); - - public static class GetGeometricTemplateFeatureInfoResult { - public FeatureData[] array; - private long array_addr; - - private GetGeometricTemplateFeatureInfoResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numFeatures; - array_numFeatures = rv_buf.getInt(0); - array = new FeatureData[array_numFeatures]; - if (array_numFeatures > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numFeatures * 16); - for (int i = 0, off = 0; i < array_numFeatures; i++, off += 16) { - array[i] = new FeatureData(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static GetGeometricTemplateFeatureInfoResult imaqGetGeometricTemplateFeatureInfo( - Image pattern) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqGetGeometricTemplateFeatureInfo(pattern.getAddress(), rv_addr + 0); - GetGeometricTemplateFeatureInfoResult rv = - new GetGeometricTemplateFeatureInfoResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqGetGeometricTemplateFeatureInfo(long pattern, long numFeatures); - - public static void imaqLearnColorPattern(Image image, LearnColorPatternOptions options) { - - _imaqLearnColorPattern(image.getAddress(), options.getAddress()); - - } - - private static native void _imaqLearnColorPattern(long image, long options); - - public static void imaqLearnGeometricPattern(Image image, PointFloat originOffset, - CurveOptions curveOptions, LearnGeometricPatternAdvancedOptions advancedLearnOptions, - Image mask) { - - _imaqLearnGeometricPattern(image.getAddress(), originOffset.getAddress(), - curveOptions.getAddress(), advancedLearnOptions.getAddress(), mask.getAddress()); - - } - - private static native void _imaqLearnGeometricPattern(long image, long originOffset, - long curveOptions, long advancedLearnOptions, long mask); - - public static LearnPatternAdvancedOptions imaqLearnPattern3(Image image, - LearningMode learningMode, Image mask) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLearnPattern3(image.getAddress(), learningMode.getValue(), rv_addr + 0, mask.getAddress()); - LearnPatternAdvancedOptions advancedOptions; - advancedOptions = new LearnPatternAdvancedOptions(rv_buf, 0); - advancedOptions.read(); - return advancedOptions; - } - - private static native void _imaqLearnPattern3(long image, int learningMode, long advancedOptions, - long mask); - - public static class MatchColorPatternResult { - public PatternMatch[] array; - private long array_addr; - - private MatchColorPatternResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new PatternMatch[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 52); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 52) { - array[i] = new PatternMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchColorPatternResult imaqMatchColorPattern(Image image, Image pattern, - MatchColorPatternOptions options, Rect searchRect) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchColorPattern(image.getAddress(), pattern.getAddress(), options.getAddress(), - searchRect.getAddress(), rv_addr + 0); - MatchColorPatternResult rv = new MatchColorPatternResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchColorPattern(long image, long pattern, long options, - long searchRect, long numMatches); - - public static class MatchGeometricPattern2Result { - public GeometricPatternMatch2[] array; - private long array_addr; - - private MatchGeometricPattern2Result(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new GeometricPatternMatch2[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 380); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 380) { - array[i] = new GeometricPatternMatch2(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchGeometricPattern2Result imaqMatchGeometricPattern2(Image image, Image pattern, - CurveOptions curveOptions, MatchGeometricPatternOptions matchOptions, - MatchGeometricPatternAdvancedOptions2 advancedMatchOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchGeometricPattern2(image.getAddress(), pattern.getAddress(), - curveOptions.getAddress(), matchOptions.getAddress(), - advancedMatchOptions.getAddress(), roi.getAddress(), rv_addr + 0); - MatchGeometricPattern2Result rv = new MatchGeometricPattern2Result(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchGeometricPattern2(long image, long pattern, - long curveOptions, long matchOptions, long advancedMatchOptions, long roi, long numMatches); - - public static class MatchMultipleGeometricPatternsResult { - public GeometricPatternMatch2[] array; - private long array_addr; - - private MatchMultipleGeometricPatternsResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new GeometricPatternMatch2[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 380); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 380) { - array[i] = new GeometricPatternMatch2(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchMultipleGeometricPatternsResult imaqMatchMultipleGeometricPatterns( - Image image, MultipleGeometricPattern multiplePattern, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchMultipleGeometricPatterns(image.getAddress(), multiplePattern.getAddress(), - roi.getAddress(), rv_addr + 0); - MatchMultipleGeometricPatternsResult rv = - new MatchMultipleGeometricPatternsResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchMultipleGeometricPatterns(long image, long multiplePattern, - long roi, long numMatches); - - public static MultipleGeometricPattern imaqReadMultipleGeometricPatternFile(String fileName, - String description) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer description_buf = ByteBuffer.allocateDirect(256).order(ByteOrder.nativeOrder()); - if (description != null) { - byte[] bytes; - try { - bytes = description.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(description_buf, bytes, 0, bytes.length); - for (int i = bytes.length; i < 256; i++) - description_buf.put(i, (byte) 0); // fill with zero - } - long jn_rv = - _imaqReadMultipleGeometricPatternFile(fileName == null ? 0 - : getByteBufferAddress(fileName_buf), description == null ? 0 - : getByteBufferAddress(description_buf)); - - return new MultipleGeometricPattern(jn_rv, true); - } - - private static native long _imaqReadMultipleGeometricPatternFile(long fileName, long description); - - public static class RefineMatchesResult { - public MatchPatternOptions options; - public MatchPatternAdvancedOptions advancedOptions; - public PatternMatch[] array; - private long array_addr; - - private RefineMatchesResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - options = new MatchPatternOptions(rv_buf, 0); - options.read(); - advancedOptions = new MatchPatternAdvancedOptions(rv_buf, 8); - advancedOptions.read(); - int array_numCandidatesOut; - array_numCandidatesOut = rv_buf.getInt(16); - array = new PatternMatch[array_numCandidatesOut]; - if (array_numCandidatesOut > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCandidatesOut * 52); - for (int i = 0, off = 0; i < array_numCandidatesOut; i++, off += 52) { - array[i] = new PatternMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static RefineMatchesResult imaqRefineMatches(Image image, Image pattern, - PatternMatch[] candidatesIn) { - int numCandidatesIn = candidatesIn.length; - ByteBuffer candidatesIn_buf = null; - candidatesIn_buf = - ByteBuffer.allocateDirect(candidatesIn.length * 52).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < candidatesIn.length; i++, off += 52) { - candidatesIn[i].setBuffer(candidatesIn_buf, off); - candidatesIn[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqRefineMatches(image.getAddress(), pattern.getAddress(), - getByteBufferAddress(candidatesIn_buf), numCandidatesIn, rv_addr + 0, rv_addr + 8, - rv_addr + 16); - RefineMatchesResult rv = new RefineMatchesResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqRefineMatches(long image, long pattern, long candidatesIn, - int numCandidatesIn, long options, long advancedOptions, long numCandidatesOut); - - public static void imaqSetMultipleGeometricPatternsOptions( - MultipleGeometricPattern multiplePattern, String label, CurveOptions curveOptions, - MatchGeometricPatternOptions matchOptions, - MatchGeometricPatternAdvancedOptions2 advancedMatchOptions) { - ByteBuffer label_buf = null; - if (label != null) { - byte[] label_bytes; - try { - label_bytes = label.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - label_bytes = new byte[0]; - } - label_buf = ByteBuffer.allocateDirect(label_bytes.length + 1); - putBytes(label_buf, label_bytes, 0, label_bytes.length).put(label_bytes.length, (byte) 0); - } - _imaqSetMultipleGeometricPatternsOptions(multiplePattern.getAddress(), label == null ? 0 - : getByteBufferAddress(label_buf), curveOptions.getAddress(), matchOptions.getAddress(), - advancedMatchOptions.getAddress()); - - } - - private static native void _imaqSetMultipleGeometricPatternsOptions(long multiplePattern, - long label, long curveOptions, long matchOptions, long advancedMatchOptions); - - public static void imaqWriteMultipleGeometricPatternFile( - MultipleGeometricPattern multiplePattern, String fileName, String description) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer description_buf = null; - if (description != null) { - byte[] description_bytes; - try { - description_bytes = description.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - description_bytes = new byte[0]; - } - description_buf = ByteBuffer.allocateDirect(description_bytes.length + 1); - putBytes(description_buf, description_bytes, 0, description_bytes.length).put( - description_bytes.length, (byte) 0); - } - _imaqWriteMultipleGeometricPatternFile(multiplePattern.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), description == null ? 0 - : getByteBufferAddress(description_buf)); - - } - - private static native void _imaqWriteMultipleGeometricPatternFile(long multiplePattern, - long fileName, long description); - - public static class MatchGeometricPattern3Result { - public GeometricPatternMatch3[] array; - private long array_addr; - - private MatchGeometricPattern3Result(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new GeometricPatternMatch3[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 116); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 116) { - array[i] = new GeometricPatternMatch3(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchGeometricPattern3Result imaqMatchGeometricPattern3(Image image, Image pattern, - CurveOptions curveOptions, MatchGeometricPatternOptions matchOptions, - MatchGeometricPatternAdvancedOptions3 advancedMatchOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchGeometricPattern3(image.getAddress(), pattern.getAddress(), - curveOptions.getAddress(), matchOptions.getAddress(), - advancedMatchOptions.getAddress(), roi.getAddress(), rv_addr + 0); - MatchGeometricPattern3Result rv = new MatchGeometricPattern3Result(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchGeometricPattern3(long image, long pattern, - long curveOptions, long matchOptions, long advancedMatchOptions, long roi, long numMatches); - - public static void imaqLearnGeometricPattern2(Image image, PointFloat originOffset, - double angleOffset, CurveOptions curveOptions, - LearnGeometricPatternAdvancedOptions2 advancedLearnOptions, Image mask) { - - _imaqLearnGeometricPattern2(image.getAddress(), originOffset.getAddress(), angleOffset, - curveOptions.getAddress(), advancedLearnOptions.getAddress(), mask.getAddress()); - - } - - private static native void _imaqLearnGeometricPattern2(long image, long originOffset, - double angleOffset, long curveOptions, long advancedLearnOptions, long mask); - - public static class MatchPattern3Result { - public PatternMatch[] array; - private long array_addr; - - private MatchPattern3Result(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new PatternMatch[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 52); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 52) { - array[i] = new PatternMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchPattern3Result imaqMatchPattern3(Image image, Image pattern, - MatchPatternOptions options, MatchPatternAdvancedOptions advancedOptions, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchPattern3(image.getAddress(), pattern.getAddress(), - options == null ? 0 : options.getAddress(), advancedOptions.getAddress(), - roi.getAddress(), rv_addr + 0); - MatchPattern3Result rv = new MatchPattern3Result(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchPattern3(long image, long pattern, long options, - long advancedOptions, long roi, long numMatches); - - /** - * Overlay functions - */ - - public static void imaqClearOverlay(Image image, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqClearOverlay(image.getAddress(), group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqClearOverlay(long image, long group); - - public static void imaqCopyOverlay(Image dest, Image source, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqCopyOverlay(dest.getAddress(), source.getAddress(), group == null ? 0 - : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqCopyOverlay(long dest, long source, long group); - - public static TransformBehaviors imaqGetOverlayProperties(Image image, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetOverlayProperties(image.getAddress(), group == null ? 0 - : getByteBufferAddress(group_buf), rv_addr + 0); - TransformBehaviors transformBehaviors; - transformBehaviors = new TransformBehaviors(rv_buf, 0); - transformBehaviors.read(); - return transformBehaviors; - } - - private static native void _imaqGetOverlayProperties(long image, long group, - long transformBehaviors); - - public static void imaqMergeOverlay(Image dest, Image source, RGBValue[] palette, String group) { - int numColors = palette.length; - ByteBuffer palette_buf = null; - palette_buf = ByteBuffer.allocateDirect(palette.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < palette.length; i++, off += 4) { - palette[i].setBuffer(palette_buf, off); - palette[i].write(); - } - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqMergeOverlay(dest.getAddress(), source.getAddress(), getByteBufferAddress(palette_buf), - numColors, group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqMergeOverlay(long dest, long source, long palette, int numColors, - long group); - - public static void imaqOverlayArc(Image image, ArcInfo arc, RGBValue color, DrawMode drawMode, - String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayArc(image.getAddress(), arc.getAddress(), color.getAddress(), drawMode.getValue(), - group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayArc(long image, long arc, long color, int drawMode, - long group); - - public static void imaqOverlayBitmap(Image image, Point destLoc, RGBValue bitmap, int numCols, - int numRows, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayBitmap(image.getAddress(), destLoc.getAddress(), bitmap.getAddress(), numCols, - numRows, group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayBitmap(long image, long destLoc, long bitmap, int numCols, - int numRows, long group); - - public static void imaqOverlayClosedContour(Image image, Point[] points, RGBValue color, - DrawMode drawMode, String group) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayClosedContour(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - color.getAddress(), drawMode.getValue(), group == null ? 0 - : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayClosedContour(long image, long points, int numPoints, - long color, int drawMode, long group); - - public static void imaqOverlayLine(Image image, Point start, Point end, RGBValue color, - String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayLine(image.getAddress(), start.getAddress(), end.getAddress(), color.getAddress(), - group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayLine(long image, long start, long end, long color, - long group); - - public static void imaqOverlayOpenContour(Image image, Point[] points, RGBValue color, - String group) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayOpenContour(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - color.getAddress(), group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayOpenContour(long image, long points, int numPoints, - long color, long group); - - public static byte imaqOverlayOval(Image image, Rect boundingBox, RGBValue color, - DrawMode drawMode) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqOverlayOval(image.getAddress(), boundingBox.getAddress(), color.getAddress(), - drawMode.getValue(), rv_addr + 0); - byte group; - group = rv_buf.get(0); - return group; - } - - private static native void _imaqOverlayOval(long image, long boundingBox, long color, - int drawMode, long group); - - public static void imaqOverlayPoints(Image image, Point[] points, RGBValue[] colors, - PointSymbol symbol, UserPointSymbol userSymbol, String group) { - int numPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - int numColors = colors.length; - ByteBuffer colors_buf = null; - colors_buf = ByteBuffer.allocateDirect(colors.length * 4).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < colors.length; i++, off += 4) { - colors[i].setBuffer(colors_buf, off); - colors[i].write(); - } - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayPoints(image.getAddress(), getByteBufferAddress(points_buf), numPoints, - getByteBufferAddress(colors_buf), numColors, symbol.getValue(), userSymbol.getAddress(), - group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayPoints(long image, long points, int numPoints, - long colors, int numColors, int symbol, long userSymbol, long group); - - public static void imaqOverlayRect(Image image, Rect rect, RGBValue color, DrawMode drawMode, - String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayRect(image.getAddress(), rect.getAddress(), color.getAddress(), - drawMode.getValue(), group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayRect(long image, long rect, long color, int drawMode, - long group); - - public static void imaqOverlayROI(Image image, ROI roi, PointSymbol symbol, - UserPointSymbol userSymbol, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayROI(image.getAddress(), roi.getAddress(), symbol.getValue(), - userSymbol.getAddress(), group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayROI(long image, long roi, int symbol, long userSymbol, - long group); - - public static void imaqOverlayText(Image image, Point origin, String text, RGBValue color, - OverlayTextOptions options, String group) { - ByteBuffer text_buf = null; - if (text != null) { - byte[] text_bytes; - try { - text_bytes = text.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - text_bytes = new byte[0]; - } - text_buf = ByteBuffer.allocateDirect(text_bytes.length + 1); - putBytes(text_buf, text_bytes, 0, text_bytes.length).put(text_bytes.length, (byte) 0); - } - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - _imaqOverlayText(image.getAddress(), origin.getAddress(), text == null ? 0 - : getByteBufferAddress(text_buf), color.getAddress(), options.getAddress(), - group == null ? 0 : getByteBufferAddress(group_buf)); - - } - - private static native void _imaqOverlayText(long image, long origin, long text, long color, - long options, long group); - - public static TransformBehaviors imaqSetOverlayProperties(Image image, String group) { - ByteBuffer group_buf = null; - if (group != null) { - byte[] group_bytes; - try { - group_bytes = group.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - group_bytes = new byte[0]; - } - group_buf = ByteBuffer.allocateDirect(group_bytes.length + 1); - putBytes(group_buf, group_bytes, 0, group_bytes.length).put(group_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqSetOverlayProperties(image.getAddress(), group == null ? 0 - : getByteBufferAddress(group_buf), rv_addr + 0); - TransformBehaviors transformBehaviors; - transformBehaviors = new TransformBehaviors(rv_buf, 0); - transformBehaviors.read(); - return transformBehaviors; - } - - private static native void _imaqSetOverlayProperties(long image, long group, - long transformBehaviors); - - /** - * OCR functions - */ - - public static CharSet imaqCreateCharSet() { - - long jn_rv = _imaqCreateCharSet(); - - return new CharSet(jn_rv, true); - } - - private static native long _imaqCreateCharSet(); - - public static void imaqDeleteChar(CharSet set, int index) { - - _imaqDeleteChar(set.getAddress(), index); - - } - - private static native void _imaqDeleteChar(long set, int index); - - public static void imaqGetCharCount(CharSet set) { - - _imaqGetCharCount(set.getAddress()); - - } - - private static native void _imaqGetCharCount(long set); - - public static CharInfo2 imaqGetCharInfo2(CharSet set, int index) { - - long jn_rv = _imaqGetCharInfo2(set.getAddress(), index); - - return new CharInfo2(jn_rv, true); - } - - private static native long _imaqGetCharInfo2(long set, int index); - - public static class ReadOCRFileResult { - public ReadTextOptions readOptions; - public OCRProcessingOptions processingOptions; - public OCRSpacingOptions spacingOptions; - - private ReadOCRFileResult(ByteBuffer rv_buf) { - readOptions = new ReadTextOptions(rv_buf, 0); - readOptions.read(); - processingOptions = new OCRProcessingOptions(rv_buf, 8); - processingOptions.read(); - spacingOptions = new OCRSpacingOptions(rv_buf, 16); - spacingOptions.read(); - } - } - - public static ReadOCRFileResult imaqReadOCRFile(String fileName, CharSet set, - String setDescription) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer setDescription_buf = ByteBuffer.allocateDirect(256).order(ByteOrder.nativeOrder()); - if (setDescription != null) { - byte[] bytes; - try { - bytes = setDescription.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(setDescription_buf, bytes, 0, bytes.length); - for (int i = bytes.length; i < 256; i++) - setDescription_buf.put(i, (byte) 0); // fill with zero - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqReadOCRFile(fileName == null ? 0 : getByteBufferAddress(fileName_buf), set.getAddress(), - setDescription == null ? 0 : getByteBufferAddress(setDescription_buf), rv_addr + 0, - rv_addr + 8, rv_addr + 16); - ReadOCRFileResult rv = new ReadOCRFileResult(rv_buf); - return rv; - } - - private static native void _imaqReadOCRFile(long fileName, long set, long setDescription, - long readOptions, long processingOptions, long spacingOptions); - - public static ReadTextReport3 imaqReadText3(Image image, CharSet set, ROI roi, - ReadTextOptions readOptions, OCRProcessingOptions processingOptions, - OCRSpacingOptions spacingOptions) { - - long jn_rv = - _imaqReadText3(image.getAddress(), set.getAddress(), roi.getAddress(), - readOptions.getAddress(), processingOptions.getAddress(), spacingOptions.getAddress()); - - return new ReadTextReport3(jn_rv, true); - } - - private static native long _imaqReadText3(long image, long set, long roi, long readOptions, - long processingOptions, long spacingOptions); - - public static void imaqRenameChar(CharSet set, int index, String newCharValue) { - ByteBuffer newCharValue_buf = null; - if (newCharValue != null) { - byte[] newCharValue_bytes; - try { - newCharValue_bytes = newCharValue.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - newCharValue_bytes = new byte[0]; - } - newCharValue_buf = ByteBuffer.allocateDirect(newCharValue_bytes.length + 1); - putBytes(newCharValue_buf, newCharValue_bytes, 0, newCharValue_bytes.length).put( - newCharValue_bytes.length, (byte) 0); - } - _imaqRenameChar(set.getAddress(), index, newCharValue == null ? 0 - : getByteBufferAddress(newCharValue_buf)); - - } - - private static native void _imaqRenameChar(long set, int index, long newCharValue); - - public static void imaqSetReferenceChar(CharSet set, int index, int isReferenceChar) { - - _imaqSetReferenceChar(set.getAddress(), index, isReferenceChar); - - } - - private static native void _imaqSetReferenceChar(long set, int index, int isReferenceChar); - - public static void imaqTrainChars(Image image, CharSet set, int index, String charValue, ROI roi, - OCRProcessingOptions processingOptions, OCRSpacingOptions spacingOptions) { - ByteBuffer charValue_buf = null; - if (charValue != null) { - byte[] charValue_bytes; - try { - charValue_bytes = charValue.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - charValue_bytes = new byte[0]; - } - charValue_buf = ByteBuffer.allocateDirect(charValue_bytes.length + 1); - putBytes(charValue_buf, charValue_bytes, 0, charValue_bytes.length).put( - charValue_bytes.length, (byte) 0); - } - _imaqTrainChars(image.getAddress(), set.getAddress(), index, charValue == null ? 0 - : getByteBufferAddress(charValue_buf), roi.getAddress(), processingOptions.getAddress(), - spacingOptions.getAddress()); - - } - - private static native void _imaqTrainChars(long image, long set, int index, long charValue, - long roi, long processingOptions, long spacingOptions); - - public static class VerifyTextResult { - public int[] array; - private long array_addr; - - private VerifyTextResult(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numScores; - array_numScores = rv_buf.getInt(0); - array = new int[array_numScores]; - if (array_numScores > 0 && array_addr != 0) { - newDirectByteBuffer(array_addr, array_numScores * 4).asIntBuffer().get(array); - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static VerifyTextResult imaqVerifyText(Image image, CharSet set, String expectedString, - ROI roi) { - ByteBuffer expectedString_buf = null; - if (expectedString != null) { - byte[] expectedString_bytes; - try { - expectedString_bytes = expectedString.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - expectedString_bytes = new byte[0]; - } - expectedString_buf = ByteBuffer.allocateDirect(expectedString_bytes.length + 1); - putBytes(expectedString_buf, expectedString_bytes, 0, expectedString_bytes.length).put( - expectedString_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqVerifyText(image.getAddress(), set.getAddress(), expectedString == null ? 0 - : getByteBufferAddress(expectedString_buf), roi.getAddress(), rv_addr + 0); - VerifyTextResult rv = new VerifyTextResult(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqVerifyText(long image, long set, long expectedString, long roi, - long numScores); - - public static void imaqWriteOCRFile(String fileName, CharSet set, String setDescription, - ReadTextOptions readOptions, OCRProcessingOptions processingOptions, - OCRSpacingOptions spacingOptions) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer setDescription_buf = null; - if (setDescription != null) { - byte[] setDescription_bytes; - try { - setDescription_bytes = setDescription.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - setDescription_bytes = new byte[0]; - } - setDescription_buf = ByteBuffer.allocateDirect(setDescription_bytes.length + 1); - putBytes(setDescription_buf, setDescription_bytes, 0, setDescription_bytes.length).put( - setDescription_bytes.length, (byte) 0); - } - _imaqWriteOCRFile(fileName == null ? 0 : getByteBufferAddress(fileName_buf), set.getAddress(), - setDescription == null ? 0 : getByteBufferAddress(setDescription_buf), - readOptions.getAddress(), processingOptions.getAddress(), spacingOptions.getAddress()); - - } - - private static native void _imaqWriteOCRFile(long fileName, long set, long setDescription, - long readOptions, long processingOptions, long spacingOptions); - - /** - * Geometric Matching functions - */ - - public static class ExtractContourResult { - public CurveParameters curveParams; - public ExtractContourReport val; - - private ExtractContourResult(ByteBuffer rv_buf) { - curveParams = new CurveParameters(rv_buf, 0); - curveParams.read(); - } - } - - public static ExtractContourResult imaqExtractContour(Image image, ROI roi, - ExtractContourDirection direction, ConnectionConstraint connectionConstraintParams, - int numOfConstraints, ExtractContourSelection selection, Image contourImage) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqExtractContour(image.getAddress(), roi.getAddress(), direction.getValue(), - rv_addr + 0, connectionConstraintParams.getAddress(), numOfConstraints, - selection.getValue(), contourImage.getAddress()); - ExtractContourResult rv = new ExtractContourResult(rv_buf); - rv.val = new ExtractContourReport(jn_rv, true); - return rv; - } - - private static native long _imaqExtractContour(long image, long roi, int direction, - long curveParams, long connectionConstraintParams, int numOfConstraints, int selection, - long contourImage); - - public static void imaqContourOverlay(Image image, Image contourImage, - ContourOverlaySettings pointsSettings, ContourOverlaySettings eqnSettings, String groupName) { - ByteBuffer groupName_buf = null; - if (groupName != null) { - byte[] groupName_bytes; - try { - groupName_bytes = groupName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - groupName_bytes = new byte[0]; - } - groupName_buf = ByteBuffer.allocateDirect(groupName_bytes.length + 1); - putBytes(groupName_buf, groupName_bytes, 0, groupName_bytes.length).put( - groupName_bytes.length, (byte) 0); - } - _imaqContourOverlay(image.getAddress(), contourImage.getAddress(), pointsSettings.getAddress(), - eqnSettings.getAddress(), groupName == null ? 0 : getByteBufferAddress(groupName_buf)); - - } - - private static native void _imaqContourOverlay(long image, long contourImage, - long pointsSettings, long eqnSettings, long groupName); - - public static ContourComputeCurvatureReport imaqContourComputeCurvature(Image contourImage, - int kernel) { - - long jn_rv = _imaqContourComputeCurvature(contourImage.getAddress(), kernel); - - return new ContourComputeCurvatureReport(jn_rv, true); - } - - private static native long _imaqContourComputeCurvature(long contourImage, int kernel); - - public static CurvatureAnalysisReport imaqContourClassifyCurvature(Image contourImage, - int kernel, RangeLabel[] curvatureClasses) { - int numCurvatureClasses = curvatureClasses.length; - ByteBuffer curvatureClasses_buf = null; - curvatureClasses_buf = - ByteBuffer.allocateDirect(curvatureClasses.length * 24).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < curvatureClasses.length; i++, off += 24) { - curvatureClasses[i].setBuffer(curvatureClasses_buf, off); - curvatureClasses[i].write(); - } - long jn_rv = - _imaqContourClassifyCurvature(contourImage.getAddress(), kernel, - getByteBufferAddress(curvatureClasses_buf), numCurvatureClasses); - - return new CurvatureAnalysisReport(jn_rv, true); - } - - private static native long _imaqContourClassifyCurvature(long contourImage, int kernel, - long curvatureClasses, int numCurvatureClasses); - - public static ComputeDistancesReport imaqContourComputeDistances(Image targetImage, - Image templateImage, SetupMatchPatternData matchSetupData, int smoothingKernel) { - - long jn_rv = - _imaqContourComputeDistances(targetImage.getAddress(), templateImage.getAddress(), - matchSetupData.getAddress(), smoothingKernel); - - return new ComputeDistancesReport(jn_rv, true); - } - - private static native long _imaqContourComputeDistances(long targetImage, long templateImage, - long matchSetupData, int smoothingKernel); - - public static ClassifyDistancesReport imaqContourClassifyDistances(Image targetImage, - Image templateImage, SetupMatchPatternData matchSetupData, int smoothingKernel, - RangeLabel[] distanceRanges) { - int numDistanceRanges = distanceRanges.length; - ByteBuffer distanceRanges_buf = null; - distanceRanges_buf = - ByteBuffer.allocateDirect(distanceRanges.length * 24).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < distanceRanges.length; i++, off += 24) { - distanceRanges[i].setBuffer(distanceRanges_buf, off); - distanceRanges[i].write(); - } - long jn_rv = - _imaqContourClassifyDistances(targetImage.getAddress(), templateImage.getAddress(), - matchSetupData.getAddress(), smoothingKernel, getByteBufferAddress(distanceRanges_buf), - numDistanceRanges); - - return new ClassifyDistancesReport(jn_rv, true); - } - - private static native long _imaqContourClassifyDistances(long targetImage, long templateImage, - long matchSetupData, int smoothingKernel, long distanceRanges, int numDistanceRanges); - - public static ContourInfoReport imaqContourInfo(Image contourImage) { - - long jn_rv = _imaqContourInfo(contourImage.getAddress()); - - return new ContourInfoReport(jn_rv, true); - } - - private static native long _imaqContourInfo(long contourImage); - - public static class ContourSetupMatchPatternResult { - public MatchMode matchMode; - public CurveParameters curveParams; - public SetupMatchPatternData val; - - private ContourSetupMatchPatternResult(ByteBuffer rv_buf) { - matchMode = new MatchMode(rv_buf, 0); - matchMode.read(); - curveParams = new CurveParameters(rv_buf, 8); - curveParams.read(); - } - } - - public static ContourSetupMatchPatternResult imaqContourSetupMatchPattern( - int enableSubPixelAccuracy, int useLearnCurveParameters, RangeSettingDouble[] rangeSettings) { - int numRangeSettings = rangeSettings.length; - ByteBuffer rangeSettings_buf = null; - rangeSettings_buf = - ByteBuffer.allocateDirect(rangeSettings.length * 24).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < rangeSettings.length; i++, off += 24) { - rangeSettings[i].setBuffer(rangeSettings_buf, off); - rangeSettings[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqContourSetupMatchPattern(rv_addr + 0, enableSubPixelAccuracy, rv_addr + 8, - useLearnCurveParameters, getByteBufferAddress(rangeSettings_buf), numRangeSettings); - ContourSetupMatchPatternResult rv = new ContourSetupMatchPatternResult(rv_buf); - rv.val = new SetupMatchPatternData(jn_rv, true); - return rv; - } - - private static native long _imaqContourSetupMatchPattern(long matchMode, - int enableSubPixelAccuracy, long curveParams, int useLearnCurveParameters, - long rangeSettings, int numRangeSettings); - - public static SetupMatchPatternData imaqContourAdvancedSetupMatchPattern( - GeometricAdvancedSetupDataOption[] geometricOptions) { - int numGeometricOptions = geometricOptions.length; - ByteBuffer geometricOptions_buf = null; - geometricOptions_buf = - ByteBuffer.allocateDirect(geometricOptions.length * 16).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < geometricOptions.length; i++, off += 16) { - geometricOptions[i].setBuffer(geometricOptions_buf, off); - geometricOptions[i].write(); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqContourAdvancedSetupMatchPattern(rv_addr + 0, getByteBufferAddress(geometricOptions_buf), - numGeometricOptions); - SetupMatchPatternData matchSetupData; - matchSetupData = new SetupMatchPatternData(rv_buf, 0); - matchSetupData.read(); - return matchSetupData; - } - - private static native void _imaqContourAdvancedSetupMatchPattern(long matchSetupData, - long geometricOptions, int numGeometricOptions); - - public static ContourFitLineReport imaqContourFitLine(Image image, double pixelRadius) { - - long jn_rv = _imaqContourFitLine(image.getAddress(), pixelRadius); - - return new ContourFitLineReport(jn_rv, true); - } - - private static native long _imaqContourFitLine(long image, double pixelRadius); - - public static PartialCircle imaqContourFitCircle(Image image, double pixelRadius, - int rejectOutliers) { - - long jn_rv = _imaqContourFitCircle(image.getAddress(), pixelRadius, rejectOutliers); - - return new PartialCircle(jn_rv, true); - } - - private static native long _imaqContourFitCircle(long image, double pixelRadius, - int rejectOutliers); - - public static PartialEllipse imaqContourFitEllipse(Image image, double pixelRadius, - int rejectOutliers) { - - long jn_rv = _imaqContourFitEllipse(image.getAddress(), pixelRadius, rejectOutliers); - - return new PartialEllipse(jn_rv, true); - } - - private static native long _imaqContourFitEllipse(long image, double pixelRadius, - int rejectOutliers); - - public static ContourFitSplineReport imaqContourFitSpline(Image image, int degree, - int numberOfControlPoints) { - - long jn_rv = _imaqContourFitSpline(image.getAddress(), degree, numberOfControlPoints); - - return new ContourFitSplineReport(jn_rv, true); - } - - private static native long _imaqContourFitSpline(long image, int degree, int numberOfControlPoints); - - public static ContourFitPolynomialReport imaqContourFitPolynomial(Image image, int order) { - - long jn_rv = _imaqContourFitPolynomial(image.getAddress(), order); - - return new ContourFitPolynomialReport(jn_rv, true); - } - - private static native long _imaqContourFitPolynomial(long image, int order); - - /** - * Edge Detection functions - */ - - public static FindCircularEdgeReport imaqFindCircularEdge2(Image image, ROI roi, - CoordinateSystem baseSystem, CoordinateSystem newSystem, FindCircularEdgeOptions edgeOptions, - CircleFitOptions circleFitOptions) { - - long jn_rv = - _imaqFindCircularEdge2(image.getAddress(), roi.getAddress(), baseSystem.getAddress(), - newSystem.getAddress(), edgeOptions.getAddress(), circleFitOptions.getAddress()); - - return new FindCircularEdgeReport(jn_rv, true); - } - - private static native long _imaqFindCircularEdge2(long image, long roi, long baseSystem, - long newSystem, long edgeOptions, long circleFitOptions); - - public static FindConcentricEdgeReport imaqFindConcentricEdge2(Image image, ROI roi, - CoordinateSystem baseSystem, CoordinateSystem newSystem, - FindConcentricEdgeOptions edgeOptions, ConcentricEdgeFitOptions concentricEdgeFitOptions) { - - long jn_rv = - _imaqFindConcentricEdge2(image.getAddress(), roi.getAddress(), baseSystem.getAddress(), - newSystem.getAddress(), edgeOptions.getAddress(), concentricEdgeFitOptions.getAddress()); - - return new FindConcentricEdgeReport(jn_rv, true); - } - - private static native long _imaqFindConcentricEdge2(long image, long roi, long baseSystem, - long newSystem, long edgeOptions, long concentricEdgeFitOptions); - - /** - * Morphology Reconstruction functions - */ - - public static void imaqGrayMorphologyReconstruct(Image dstImage, Image srcImage, - Image markerImage, PointFloat[] points, MorphologyReconstructOperation operation, - StructuringElement structuringElement, ROI roi) { - int numOfPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - _imaqGrayMorphologyReconstruct(dstImage.getAddress(), srcImage.getAddress(), - markerImage.getAddress(), getByteBufferAddress(points_buf), numOfPoints, - operation.getValue(), structuringElement.getAddress(), roi.getAddress()); - - } - - private static native void _imaqGrayMorphologyReconstruct(long dstImage, long srcImage, - long markerImage, long points, int numOfPoints, int operation, long structuringElement, - long roi); - - public static void imaqMorphologyReconstruct(Image dstImage, Image srcImage, Image markerImage, - PointFloat[] points, MorphologyReconstructOperation operation, Connectivity connectivity, - ROI roi) { - int numOfPoints = points.length; - ByteBuffer points_buf = null; - points_buf = ByteBuffer.allocateDirect(points.length * 8).order(ByteOrder.nativeOrder()); - for (int i = 0, off = 0; i < points.length; i++, off += 8) { - points[i].setBuffer(points_buf, off); - points[i].write(); - } - _imaqMorphologyReconstruct(dstImage.getAddress(), srcImage.getAddress(), - markerImage.getAddress(), getByteBufferAddress(points_buf), numOfPoints, - operation.getValue(), connectivity.getValue(), roi.getAddress()); - - } - - private static native void _imaqMorphologyReconstruct(long dstImage, long srcImage, - long markerImage, long points, int numOfPoints, int operation, int connectivity, long roi); - - /** - * Texture functions - */ - - public static void imaqDetectTextureDefect(ClassifierSession session, Image destImage, - Image srcImage, ROI roi, int initialStepSize, int finalStepSize, short defectPixelValue, - double minClassificationScore) { - - _imaqDetectTextureDefect(session.getAddress(), destImage.getAddress(), srcImage.getAddress(), - roi.getAddress(), initialStepSize, finalStepSize, defectPixelValue, minClassificationScore); - - } - - private static native void _imaqDetectTextureDefect(long session, long destImage, long srcImage, - long roi, int initialStepSize, int finalStepSize, short defectPixelValue, - double minClassificationScore); - - /** - * Regions of Interest Manipulation functions - */ - - public static class MaskToROIResult { - public int withinLimit; - public ROI val; - - private MaskToROIResult(ByteBuffer rv_buf) { - withinLimit = rv_buf.getInt(0); - } - } - - public static MaskToROIResult imaqMaskToROI(Image mask) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqMaskToROI(mask.getAddress(), rv_addr + 0); - MaskToROIResult rv = new MaskToROIResult(rv_buf); - rv.val = new ROI(jn_rv, true); - return rv; - } - - private static native long _imaqMaskToROI(long mask, long withinLimit); - - public static ROIProfile imaqROIProfile(Image image, ROI roi) { - - long jn_rv = _imaqROIProfile(image.getAddress(), roi.getAddress()); - - return new ROIProfile(jn_rv, true); - } - - private static native long _imaqROIProfile(long image, long roi); - - public static int imaqROIToMask(Image mask, ROI roi, int fillValue, Image imageModel) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqROIToMask(mask.getAddress(), roi.getAddress(), fillValue, imageModel == null ? 0 - : imageModel.getAddress(), rv_addr + 0); - int inSpace; - inSpace = rv_buf.getInt(0); - return inSpace; - } - - private static native void _imaqROIToMask(long mask, long roi, int fillValue, long imageModel, - long inSpace); - - public static void imaqTransformROI2(ROI roi, CoordinateSystem baseSystem, - CoordinateSystem newSystem) { - - _imaqTransformROI2(roi.getAddress(), baseSystem.getAddress(), newSystem.getAddress()); - - } - - private static native void _imaqTransformROI2(long roi, long baseSystem, long newSystem); - - public static LabelToROIReport imaqLabelToROI(Image image, int[] labelsIn, int maxNumVectors, - int isExternelEdges) { - int numLabelsIn = labelsIn.length; - ByteBuffer labelsIn_buf = null; - labelsIn_buf = ByteBuffer.allocateDirect(labelsIn.length * 4).order(ByteOrder.nativeOrder()); - labelsIn_buf.asIntBuffer().put(labelsIn).rewind(); - long jn_rv = - _imaqLabelToROI(image.getAddress(), getByteBufferAddress(labelsIn_buf), numLabelsIn, - maxNumVectors, isExternelEdges); - - return new LabelToROIReport(jn_rv, true); - } - - private static native long _imaqLabelToROI(long image, long labelsIn, int numLabelsIn, - int maxNumVectors, int isExternelEdges); - - /** - * Morphology functions - */ - - public static void imaqGrayMorphology(Image dest, Image source, MorphologyMethod method, - StructuringElement structuringElement) { - - _imaqGrayMorphology(dest.getAddress(), source.getAddress(), method.getValue(), - structuringElement == null ? 0 : structuringElement.getAddress()); - - } - - private static native void _imaqGrayMorphology(long dest, long source, int method, - long structuringElement); - - /** - * Classification functions - */ - - public static void imaqAddClassifierSample(Image image, ClassifierSession session, ROI roi, - String sampleClass, double[] featureVector) { - ByteBuffer sampleClass_buf = null; - if (sampleClass != null) { - byte[] sampleClass_bytes; - try { - sampleClass_bytes = sampleClass.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - sampleClass_bytes = new byte[0]; - } - sampleClass_buf = ByteBuffer.allocateDirect(sampleClass_bytes.length + 1); - putBytes(sampleClass_buf, sampleClass_bytes, 0, sampleClass_bytes.length).put( - sampleClass_bytes.length, (byte) 0); - } - int vectorSize = featureVector.length; - ByteBuffer featureVector_buf = null; - featureVector_buf = - ByteBuffer.allocateDirect(featureVector.length * 8).order(ByteOrder.nativeOrder()); - featureVector_buf.asDoubleBuffer().put(featureVector).rewind(); - _imaqAddClassifierSample(image.getAddress(), session.getAddress(), roi.getAddress(), - sampleClass == null ? 0 : getByteBufferAddress(sampleClass_buf), - getByteBufferAddress(featureVector_buf), vectorSize); - - } - - private static native void _imaqAddClassifierSample(long image, long session, long roi, - long sampleClass, long featureVector, int vectorSize); - - public static ClassifierReportAdvanced imaqAdvanceClassify(Image image, - ClassifierSession session, ROI roi, double[] featureVector) { - int vectorSize = featureVector.length; - ByteBuffer featureVector_buf = null; - featureVector_buf = - ByteBuffer.allocateDirect(featureVector.length * 8).order(ByteOrder.nativeOrder()); - featureVector_buf.asDoubleBuffer().put(featureVector).rewind(); - long jn_rv = - _imaqAdvanceClassify(image.getAddress(), session.getAddress(), roi.getAddress(), - getByteBufferAddress(featureVector_buf), vectorSize); - - return new ClassifierReportAdvanced(jn_rv, true); - } - - private static native long _imaqAdvanceClassify(long image, long session, long roi, - long featureVector, int vectorSize); - - public static ClassifierReport imaqClassify(Image image, ClassifierSession session, ROI roi, - double[] featureVector) { - int vectorSize = featureVector.length; - ByteBuffer featureVector_buf = null; - featureVector_buf = - ByteBuffer.allocateDirect(featureVector.length * 8).order(ByteOrder.nativeOrder()); - featureVector_buf.asDoubleBuffer().put(featureVector).rewind(); - long jn_rv = - _imaqClassify(image.getAddress(), session.getAddress(), roi.getAddress(), - getByteBufferAddress(featureVector_buf), vectorSize); - - return new ClassifierReport(jn_rv, true); - } - - private static native long _imaqClassify(long image, long session, long roi, long featureVector, - int vectorSize); - - public static ClassifierSession imaqCreateClassifier(ClassifierType type) { - - long jn_rv = _imaqCreateClassifier(type.getValue()); - - return new ClassifierSession(jn_rv, true); - } - - private static native long _imaqCreateClassifier(int type); - - public static void imaqDeleteClassifierSample(ClassifierSession session, int index) { - - _imaqDeleteClassifierSample(session.getAddress(), index); - - } - - private static native void _imaqDeleteClassifierSample(long session, int index); - - public static ClassifierAccuracyReport imaqGetClassifierAccuracy(ClassifierSession session) { - - long jn_rv = _imaqGetClassifierAccuracy(session.getAddress()); - - return new ClassifierAccuracyReport(jn_rv, true); - } - - private static native long _imaqGetClassifierAccuracy(long session); - - public static class GetClassifierSampleInfoResult { - public int numSamples; - public ClassifierSampleInfo val; - - private GetClassifierSampleInfoResult(ByteBuffer rv_buf) { - numSamples = rv_buf.getInt(0); - } - } - - public static GetClassifierSampleInfoResult imaqGetClassifierSampleInfo( - ClassifierSession session, int index) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = _imaqGetClassifierSampleInfo(session.getAddress(), index, rv_addr + 0); - GetClassifierSampleInfoResult rv = new GetClassifierSampleInfoResult(rv_buf); - rv.val = new ClassifierSampleInfo(jn_rv, true); - return rv; - } - - private static native long _imaqGetClassifierSampleInfo(long session, int index, long numSamples); - - public static ColorOptions imaqGetColorClassifierOptions(ClassifierSession session) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetColorClassifierOptions(session.getAddress(), rv_addr + 0); - ColorOptions options; - options = new ColorOptions(rv_buf, 0); - options.read(); - return options; - } - - private static native void _imaqGetColorClassifierOptions(long session, long options); - - public static NearestNeighborOptions imaqGetNearestNeighborOptions(ClassifierSession session) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetNearestNeighborOptions(session.getAddress(), rv_addr + 0); - NearestNeighborOptions options; - options = new NearestNeighborOptions(rv_buf, 0); - options.read(); - return options; - } - - private static native void _imaqGetNearestNeighborOptions(long session, long options); - - public static class GetParticleClassifierOptions2Result { - public ParticleClassifierPreprocessingOptions2 preprocessingOptions; - public ParticleClassifierOptions options; - - private GetParticleClassifierOptions2Result(ByteBuffer rv_buf) { - preprocessingOptions = new ParticleClassifierPreprocessingOptions2(rv_buf, 0); - preprocessingOptions.read(); - options = new ParticleClassifierOptions(rv_buf, 8); - options.read(); - } - } - - public static GetParticleClassifierOptions2Result imaqGetParticleClassifierOptions2( - ClassifierSession session) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetParticleClassifierOptions2(session.getAddress(), rv_addr + 0, rv_addr + 8); - GetParticleClassifierOptions2Result rv = new GetParticleClassifierOptions2Result(rv_buf); - return rv; - } - - private static native void _imaqGetParticleClassifierOptions2(long session, - long preprocessingOptions, long options); - - public static class ReadClassifierFileResult { - public ClassifierType type; - public ClassifierEngineType engine; - public ClassifierSession val; - - private ReadClassifierFileResult(ByteBuffer rv_buf) { - type = ClassifierType.fromValue(rv_buf.getInt(0)); - engine = ClassifierEngineType.fromValue(rv_buf.getInt(8)); - } - } - - public static ReadClassifierFileResult imaqReadClassifierFile(ClassifierSession session, - String fileName, ReadClassifierFileMode mode, String description) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer description_buf = ByteBuffer.allocateDirect(256).order(ByteOrder.nativeOrder()); - if (description != null) { - byte[] bytes; - try { - bytes = description.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(description_buf, bytes, 0, bytes.length); - for (int i = bytes.length; i < 256; i++) - description_buf.put(i, (byte) 0); // fill with zero - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqReadClassifierFile(session.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), mode.getValue(), rv_addr + 0, rv_addr + 8, - description == null ? 0 : getByteBufferAddress(description_buf)); - ReadClassifierFileResult rv = new ReadClassifierFileResult(rv_buf); - rv.val = new ClassifierSession(jn_rv, true); - return rv; - } - - private static native long _imaqReadClassifierFile(long session, long fileName, int mode, - long type, long engine, long description); - - public static void imaqRelabelClassifierSample(ClassifierSession session, int index, - String newClass) { - ByteBuffer newClass_buf = null; - if (newClass != null) { - byte[] newClass_bytes; - try { - newClass_bytes = newClass.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - newClass_bytes = new byte[0]; - } - newClass_buf = ByteBuffer.allocateDirect(newClass_bytes.length + 1); - putBytes(newClass_buf, newClass_bytes, 0, newClass_bytes.length).put(newClass_bytes.length, - (byte) 0); - } - _imaqRelabelClassifierSample(session.getAddress(), index, newClass == null ? 0 - : getByteBufferAddress(newClass_buf)); - - } - - private static native void _imaqRelabelClassifierSample(long session, int index, long newClass); - - public static void imaqSetParticleClassifierOptions2(ClassifierSession session, - ParticleClassifierPreprocessingOptions2 preprocessingOptions, - ParticleClassifierOptions options) { - - _imaqSetParticleClassifierOptions2(session.getAddress(), preprocessingOptions.getAddress(), - options.getAddress()); - - } - - private static native void _imaqSetParticleClassifierOptions2(long session, - long preprocessingOptions, long options); - - public static void imaqSetColorClassifierOptions(ClassifierSession session, ColorOptions options) { - - _imaqSetColorClassifierOptions(session.getAddress(), options.getAddress()); - - } - - private static native void _imaqSetColorClassifierOptions(long session, long options); - - public static NearestNeighborTrainingReport imaqTrainNearestNeighborClassifier( - ClassifierSession session, NearestNeighborOptions options) { - - long jn_rv = _imaqTrainNearestNeighborClassifier(session.getAddress(), options.getAddress()); - - return new NearestNeighborTrainingReport(jn_rv, true); - } - - private static native long _imaqTrainNearestNeighborClassifier(long session, long options); - - public static void imaqWriteClassifierFile(ClassifierSession session, String fileName, - WriteClassifierFileMode mode, String description) { - ByteBuffer fileName_buf = null; - if (fileName != null) { - byte[] fileName_bytes; - try { - fileName_bytes = fileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - fileName_bytes = new byte[0]; - } - fileName_buf = ByteBuffer.allocateDirect(fileName_bytes.length + 1); - putBytes(fileName_buf, fileName_bytes, 0, fileName_bytes.length).put(fileName_bytes.length, - (byte) 0); - } - ByteBuffer description_buf = ByteBuffer.allocateDirect(256).order(ByteOrder.nativeOrder()); - if (description != null) { - byte[] bytes; - try { - bytes = description.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(description_buf, bytes, 0, bytes.length); - for (int i = bytes.length; i < 256; i++) - description_buf.put(i, (byte) 0); // fill with zero - } - _imaqWriteClassifierFile(session.getAddress(), fileName == null ? 0 - : getByteBufferAddress(fileName_buf), mode.getValue(), description == null ? 0 - : getByteBufferAddress(description_buf)); - - } - - private static native void _imaqWriteClassifierFile(long session, long fileName, int mode, - long description); - - /** - * Measure Distances functions - */ - - public static ClampMax2Report imaqClampMax2(Image image, ROI roi, CoordinateSystem baseSystem, - CoordinateSystem newSystem, CurveOptions curveSettings, ClampSettings clampSettings, - ClampOverlaySettings clampOverlaySettings) { - - long jn_rv = - _imaqClampMax2(image.getAddress(), roi.getAddress(), baseSystem.getAddress(), - newSystem.getAddress(), curveSettings.getAddress(), clampSettings.getAddress(), - clampOverlaySettings.getAddress()); - - return new ClampMax2Report(jn_rv, true); - } - - private static native long _imaqClampMax2(long image, long roi, long baseSystem, long newSystem, - long curveSettings, long clampSettings, long clampOverlaySettings); - - /** - * Inspection functions - */ - - public static void imaqCompareGoldenTemplate(Image image, Image goldenTemplate, - Image brightDefects, Image darkDefects, InspectionAlignment alignment, - InspectionOptions options) { - - _imaqCompareGoldenTemplate(image.getAddress(), goldenTemplate.getAddress(), - brightDefects.getAddress(), darkDefects.getAddress(), alignment.getAddress(), - options.getAddress()); - - } - - private static native void _imaqCompareGoldenTemplate(long image, long goldenTemplate, - long brightDefects, long darkDefects, long alignment, long options); - - public static void imaqLearnGoldenTemplate(Image goldenTemplate, PointFloat originOffset, - Image mask) { - - _imaqLearnGoldenTemplate(goldenTemplate.getAddress(), originOffset.getAddress(), - mask.getAddress()); - - } - - private static native void _imaqLearnGoldenTemplate(long goldenTemplate, long originOffset, - long mask); - - /** - * Obsolete functions - */ - - public static class GetParticleClassifierOptionsResult { - public ParticleClassifierPreprocessingOptions preprocessingOptions; - public ParticleClassifierOptions options; - - private GetParticleClassifierOptionsResult(ByteBuffer rv_buf) { - preprocessingOptions = new ParticleClassifierPreprocessingOptions(rv_buf, 0); - preprocessingOptions.read(); - options = new ParticleClassifierOptions(rv_buf, 8); - options.read(); - } - } - - public static GetParticleClassifierOptionsResult imaqGetParticleClassifierOptions( - ClassifierSession session) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqGetParticleClassifierOptions(session.getAddress(), rv_addr + 0, rv_addr + 8); - GetParticleClassifierOptionsResult rv = new GetParticleClassifierOptionsResult(rv_buf); - return rv; - } - - private static native void _imaqGetParticleClassifierOptions(long session, - long preprocessingOptions, long options); - - public static int imaqParticleFilter3(Image dest, Image source, ParticleFilterCriteria2 criteria, - int criteriaCount, ParticleFilterOptions options, ROI roi) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqParticleFilter3(dest.getAddress(), source.getAddress(), criteria.getAddress(), - criteriaCount, options.getAddress(), roi.getAddress(), rv_addr + 0); - int numParticles; - numParticles = rv_buf.getInt(0); - return numParticles; - } - - private static native void _imaqParticleFilter3(long dest, long source, long criteria, - int criteriaCount, long options, long roi, long numParticles); - - public static LearnPatternAdvancedOptions imaqLearnPattern2(Image image, LearningMode learningMode) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _imaqLearnPattern2(image.getAddress(), learningMode.getValue(), rv_addr + 0); - LearnPatternAdvancedOptions advancedOptions; - advancedOptions = new LearnPatternAdvancedOptions(rv_buf, 0); - advancedOptions.read(); - return advancedOptions; - } - - private static native void _imaqLearnPattern2(long image, int learningMode, long advancedOptions); - - public static void imaqDivide(Image dest, Image sourceA, Image sourceB) { - - _imaqDivide(dest.getAddress(), sourceA.getAddress(), sourceB.getAddress()); - - } - - private static native void _imaqDivide(long dest, long sourceA, long sourceB); - - public static EdgeReport2 imaqEdgeTool3(Image image, ROI roi, EdgeProcess processType, - EdgeOptions2 edgeOptions) { - - long jn_rv = - _imaqEdgeTool3(image.getAddress(), roi.getAddress(), processType.getValue(), - edgeOptions.getAddress()); - - return new EdgeReport2(jn_rv, true); - } - - private static native long _imaqEdgeTool3(long image, long roi, int processType, long edgeOptions); - - public static ConcentricRakeReport imaqConcentricRake(Image image, ROI roi, - ConcentricRakeDirection direction, EdgeProcess process, RakeOptions options) { - - long jn_rv = - _imaqConcentricRake(image.getAddress(), roi.getAddress(), direction.getValue(), - process.getValue(), options.getAddress()); - - return new ConcentricRakeReport(jn_rv, true); - } - - private static native long _imaqConcentricRake(long image, long roi, int direction, int process, - long options); - - public static SpokeReport imaqSpoke(Image image, ROI roi, SpokeDirection direction, - EdgeProcess process, SpokeOptions options) { - - long jn_rv = - _imaqSpoke(image.getAddress(), roi.getAddress(), direction.getValue(), process.getValue(), - options.getAddress()); - - return new SpokeReport(jn_rv, true); - } - - private static native long _imaqSpoke(long image, long roi, int direction, int process, - long options); - - public static class MatchPattern2Result { - public PatternMatch[] array; - private long array_addr; - - private MatchPattern2Result(ByteBuffer rv_buf, long jn_rv) { - array_addr = jn_rv; - int array_numMatches; - array_numMatches = rv_buf.getInt(0); - array = new PatternMatch[array_numMatches]; - if (array_numMatches > 0 && array_addr != 0) { - ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches * 52); - for (int i = 0, off = 0; i < array_numMatches; i++, off += 52) { - array[i] = new PatternMatch(bb, off); - array[i].read(); - } - } - } - - @Override - protected void finalize() throws Throwable { - imaqDispose(array_addr); - super.finalize(); - } - } - - public static MatchPattern2Result imaqMatchPattern2(Image image, Image pattern, - MatchPatternOptions options, MatchPatternAdvancedOptions advancedOptions, Rect searchRect) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - long jn_rv = - _imaqMatchPattern2(image.getAddress(), pattern.getAddress(), - options == null ? 0 : options.getAddress(), advancedOptions.getAddress(), - searchRect.getAddress(), rv_addr + 0); - MatchPattern2Result rv = new MatchPattern2Result(rv_buf, jn_rv); - return rv; - } - - private static native long _imaqMatchPattern2(long image, long pattern, long options, - long advancedOptions, long searchRect, long numMatches); - - public static void imaqSetParticleClassifierOptions(ClassifierSession session, - ParticleClassifierPreprocessingOptions preprocessingOptions, ParticleClassifierOptions options) { - - _imaqSetParticleClassifierOptions(session.getAddress(), preprocessingOptions.getAddress(), - options.getAddress()); - - } - - private static native void _imaqSetParticleClassifierOptions(long session, - long preprocessingOptions, long options); - - public static RakeReport imaqRake(Image image, ROI roi, RakeDirection direction, - EdgeProcess process, RakeOptions options) { - - long jn_rv = - _imaqRake(image.getAddress(), roi.getAddress(), direction.getValue(), process.getValue(), - options.getAddress()); - - return new RakeReport(jn_rv, true); - } - - private static native long _imaqRake(long image, long roi, int direction, int process, - long options); - - public static void Priv_ReadJPEGString_C(Image image, byte[] string) { - int stringLength = string.length; - ByteBuffer string_buf = null; - string_buf = ByteBuffer.allocateDirect(string.length); - putBytes(string_buf, string, 0, string.length); - _Priv_ReadJPEGString_C(image.getAddress(), getByteBufferAddress(string_buf), stringLength); - - } - - private static native void _Priv_ReadJPEGString_C(long image, long string, int stringLength); - - /** - * Purpose : Include file for NI-IMAQdx library support. - */ - public static final int IMAQDX_MAX_API_STRING_LENGTH = 512; - - /** - * Bus Type Enumeration - */ - - public static enum IMAQdxBusType { - BusTypeFireWire(0x31333934), BusTypeEthernet(0x69707634), BusTypeSimulator(0x2073696D), BusTypeDirectShow( - 0x64736877), BusTypeIP(0x4950636D), BusTypeSmartCam2(0x53436132), BusTypeUSB3Vision( - 0x55534233), BusTypeUVC(0x55564320), BusTypeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxBusType(int value) { - this.value = value; - } - - public static IMAQdxBusType fromValue(int val) { - for (IMAQdxBusType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Camera Control Mode Enumeration - */ - - public static enum IMAQdxCameraControlMode { - CameraControlModeController(0), CameraControlModeListener(1), CameraControlModeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxCameraControlMode(int value) { - this.value = value; - } - - public static IMAQdxCameraControlMode fromValue(int val) { - for (IMAQdxCameraControlMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Buffer Number Mode Enumeration - */ - - public static enum IMAQdxBufferNumberMode { - BufferNumberModeNext(0), BufferNumberModeLast(1), BufferNumberModeBufferNumber(2), BufferNumberModeGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxBufferNumberMode(int value) { - this.value = value; - } - - public static IMAQdxBufferNumberMode fromValue(int val) { - for (IMAQdxBufferNumberMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Plug n Play Event Enumeration - */ - - public static enum IMAQdxPnpEvent { - PnpEventCameraAttached(0), PnpEventCameraDetached(1), PnpEventBusReset(2), PnpEventGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxPnpEvent(int value) { - this.value = value; - } - - public static IMAQdxPnpEvent fromValue(int val) { - for (IMAQdxPnpEvent v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Bayer Pattern Enumeration - */ - - public static enum IMAQdxBayerPattern { - BayerPatternNone(0), BayerPatternGB(1), BayerPatternGR(2), BayerPatternBG(3), BayerPatternRG(4), BayerPatternHardware( - 5), BayerPatternGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxBayerPattern(int value) { - this.value = value; - } - - public static IMAQdxBayerPattern fromValue(int val) { - for (IMAQdxBayerPattern v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Bayer Decode Algorithm Enumeration - */ - - public static enum IMAQdxBayerAlgorithm { - BayerAlgorithmBilinear(0), BayerAlgorithmVNG(1), BayerAlgorithmGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxBayerAlgorithm(int value) { - this.value = value; - } - - public static IMAQdxBayerAlgorithm fromValue(int val) { - for (IMAQdxBayerAlgorithm v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Output Image Types -- Values match Vision Development Module image types - */ - - public static enum IMAQdxOutputImageType { - OutputImageTypeU8(0), OutputImageTypeI16(1), OutputImageTypeU16(7), OutputImageTypeRGB32(4), OutputImageTypeRGB64( - 6), OutputImageTypeAuto(0x7FFFFFFF), OutputImageTypeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxOutputImageType(int value) { - this.value = value; - } - - public static IMAQdxOutputImageType fromValue(int val) { - for (IMAQdxOutputImageType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Controller Destination Mode Enumeration - */ - - public static enum IMAQdxDestinationMode { - DestinationModeUnicast(0), DestinationModeBroadcast(1), DestinationModeMulticast(2), DestinationModeGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxDestinationMode(int value) { - this.value = value; - } - - public static IMAQdxDestinationMode fromValue(int val) { - for (IMAQdxDestinationMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Attribute Type Enumeration - */ - - public static enum IMAQdxAttributeType { - AttributeTypeU32(0), AttributeTypeI64(1), AttributeTypeF64(2), AttributeTypeString(3), AttributeTypeEnum( - 4), AttributeTypeBool(5), AttributeTypeCommand(6), AttributeTypeBlob(7), AttributeTypeGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxAttributeType(int value) { - this.value = value; - } - - public static IMAQdxAttributeType fromValue(int val) { - for (IMAQdxAttributeType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Value Type Enumeration - */ - - public static enum IMAQdxValueType { - ValueTypeU32(0), ValueTypeI64(1), ValueTypeF64(2), ValueTypeString(3), ValueTypeEnumItem(4), ValueTypeBool( - 5), ValueTypeDisposableString(6), ValueTypeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxValueType(int value) { - this.value = value; - } - - public static IMAQdxValueType fromValue(int val) { - for (IMAQdxValueType v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Interface File Flags Enumeration - */ - - public static enum IMAQdxInterfaceFileFlags { - InterfaceFileFlagsConnected(0x1), InterfaceFileFlagsDirty(0x2), InterfaceFileFlagsGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxInterfaceFileFlags(int value) { - this.value = value; - } - - public static IMAQdxInterfaceFileFlags fromValue(int val) { - for (IMAQdxInterfaceFileFlags v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Overwrite Mode Enumeration - */ - - public static enum IMAQdxOverwriteMode { - OverwriteModeGetOldest(0x0), OverwriteModeFail(0x2), OverwriteModeGetNewest(0x3), OverwriteModeGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxOverwriteMode(int value) { - this.value = value; - } - - public static IMAQdxOverwriteMode fromValue(int val) { - for (IMAQdxOverwriteMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Incomplete Buffer Mode Enumeration - */ - - public static enum IMAQdxIncompleteBufferMode { - IncompleteBufferModeIgnore(0), IncompleteBufferModeFail(1), IncompleteBufferModeGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxIncompleteBufferMode(int value) { - this.value = value; - } - - public static IMAQdxIncompleteBufferMode fromValue(int val) { - for (IMAQdxIncompleteBufferMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Lost Packet Mode Enumeration - */ - - public static enum IMAQdxLostPacketMode { - LostPacketModeIgnore(0), LostPacketModeFail(1), LostPacketModeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxLostPacketMode(int value) { - this.value = value; - } - - public static IMAQdxLostPacketMode fromValue(int val) { - for (IMAQdxLostPacketMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Attribute Visibility Enumeration - */ - - public static enum IMAQdxAttributeVisibility { - AttributeVisibilitySimple(0x00001000), AttributeVisibilityIntermediate(0x00002000), AttributeVisibilityAdvanced( - 0x00004000), AttributeVisibilityGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxAttributeVisibility(int value) { - this.value = value; - } - - public static IMAQdxAttributeVisibility fromValue(int val) { - for (IMAQdxAttributeVisibility v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Stream Channel Mode Enumeration - */ - - public static enum IMAQdxStreamChannelMode { - StreamChannelModeAutomatic(0), StreamChannelModeManual(1), StreamChannelModeGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxStreamChannelMode(int value) { - this.value = value; - } - - public static IMAQdxStreamChannelMode fromValue(int val) { - for (IMAQdxStreamChannelMode v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * Pixel Signedness Enumeration - */ - - public static enum IMAQdxPixelSignedness { - PixelSignednessUnsigned(0), PixelSignednessSigned(1), PixelSignednessHardware(2), PixelSignednessGuard( - 0xFFFFFFFF), ; - private final int value; - - private IMAQdxPixelSignedness(int value) { - this.value = value; - } - - public static IMAQdxPixelSignedness fromValue(int val) { - for (IMAQdxPixelSignedness v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * USB Connection Speed Enumeration - */ - - public static enum IMAQdxUSBConnectionSpeed { - USBConnectionSpeedLow(1), USBConnectionSpeedFull(2), USBConnectionSpeedHigh(4), USBConnectionSpeedSuper( - 8), USBConnectionSpeedGuard(0xFFFFFFFF), ; - private final int value; - - private IMAQdxUSBConnectionSpeed(int value) { - this.value = value; - } - - public static IMAQdxUSBConnectionSpeed fromValue(int val) { - for (IMAQdxUSBConnectionSpeed v : values()) { - if (v.value == val) - return v; - } - return null; - } - - public int getValue() { - return value; - } - } - - /** - * CVI Structures - */ - - /** - * Camera Information Structure - */ - - public static class IMAQdxCameraInformation extends DisposedStruct { - public int Type; - public int Version; - public int Flags; - public int SerialNumberHi; - public int SerialNumberLo; - public IMAQdxBusType BusType; - public String InterfaceName; - public String VendorName; - public String ModelName; - public String CameraFileName; - public String CameraAttributeURL; - - private void init() { - - } - - public IMAQdxCameraInformation() { - super(2584); - init(); - } - - public IMAQdxCameraInformation(int Type, int Version, int Flags, int SerialNumberHi, - int SerialNumberLo, IMAQdxBusType BusType, String InterfaceName, String VendorName, - String ModelName, String CameraFileName, String CameraAttributeURL) { - super(2584); - this.Type = Type; - this.Version = Version; - this.Flags = Flags; - this.SerialNumberHi = SerialNumberHi; - this.SerialNumberLo = SerialNumberLo; - this.BusType = BusType; - this.InterfaceName = InterfaceName; - this.VendorName = VendorName; - this.ModelName = ModelName; - this.CameraFileName = CameraFileName; - this.CameraAttributeURL = CameraAttributeURL; - } - - protected IMAQdxCameraInformation(ByteBuffer backing, int offset) { - super(backing, offset, 2584); - init(); - } - - protected IMAQdxCameraInformation(long nativeObj, boolean owned) { - super(nativeObj, owned, 2584); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 2584); - } - - public void read() { - Type = backing.getInt(0); - Version = backing.getInt(4); - Flags = backing.getInt(8); - SerialNumberHi = backing.getInt(12); - SerialNumberLo = backing.getInt(16); - BusType = IMAQdxBusType.fromValue(backing.getInt(20)); - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 24, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - InterfaceName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - InterfaceName = ""; - } - } - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 536, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - VendorName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - VendorName = ""; - } - } - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 1048, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - ModelName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - ModelName = ""; - } - } - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 1560, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - CameraFileName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - CameraFileName = ""; - } - } - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 2072, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - CameraAttributeURL = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - CameraAttributeURL = ""; - } - } - } - - public void write() { - backing.putInt(0, Type); - backing.putInt(4, Version); - backing.putInt(8, Flags); - backing.putInt(12, SerialNumberHi); - backing.putInt(16, SerialNumberLo); - if (BusType != null) - backing.putInt(20, BusType.getValue()); - if (InterfaceName != null) { - byte[] bytes; - try { - bytes = InterfaceName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 24, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - if (VendorName != null) { - byte[] bytes; - try { - bytes = VendorName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 536, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - if (ModelName != null) { - byte[] bytes; - try { - bytes = ModelName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 1048, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - if (CameraFileName != null) { - byte[] bytes; - try { - bytes = CameraFileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 1560, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - if (CameraAttributeURL != null) { - byte[] bytes; - try { - bytes = CameraAttributeURL.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 2072, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - } - - public int size() { - return 2584; - } - } - - /** - * Camera File Structure - */ - - public static class IMAQdxCameraFile extends DisposedStruct { - public int Type; - public int Version; - public String FileName; - - private void init() { - - } - - public IMAQdxCameraFile() { - super(520); - init(); - } - - public IMAQdxCameraFile(int Type, int Version, String FileName) { - super(520); - this.Type = Type; - this.Version = Version; - this.FileName = FileName; - } - - protected IMAQdxCameraFile(ByteBuffer backing, int offset) { - super(backing, offset, 520); - init(); - } - - protected IMAQdxCameraFile(long nativeObj, boolean owned) { - super(nativeObj, owned, 520); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 520); - } - - public void read() { - Type = backing.getInt(0); - Version = backing.getInt(4); - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 8, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - FileName = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - FileName = ""; - } - } - } - - public void write() { - backing.putInt(0, Type); - backing.putInt(4, Version); - if (FileName != null) { - byte[] bytes; - try { - bytes = FileName.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 8, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - } - - public int size() { - return 520; - } - } - - /** - * Attribute Information Structure - */ - - public static class IMAQdxAttributeInformation extends DisposedStruct { - public IMAQdxAttributeType Type; - public int Readable; - public int Writable; - public String Name; - - private void init() { - - } - - public IMAQdxAttributeInformation() { - super(524); - init(); - } - - public IMAQdxAttributeInformation(IMAQdxAttributeType Type, int Readable, int Writable, - String Name) { - super(524); - this.Type = Type; - this.Readable = Readable; - this.Writable = Writable; - this.Name = Name; - } - - protected IMAQdxAttributeInformation(ByteBuffer backing, int offset) { - super(backing, offset, 524); - init(); - } - - protected IMAQdxAttributeInformation(long nativeObj, boolean owned) { - super(nativeObj, owned, 524); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 524); - } - - public void read() { - Type = IMAQdxAttributeType.fromValue(backing.getInt(0)); - Readable = backing.getInt(4); - Writable = backing.getInt(8); - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 12, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - Name = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - Name = ""; - } - } - } - - public void write() { - if (Type != null) - backing.putInt(0, Type.getValue()); - backing.putInt(4, Readable); - backing.putInt(8, Writable); - if (Name != null) { - byte[] bytes; - try { - bytes = Name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 12, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - } - - public int size() { - return 524; - } - } - - /** - * Enumeration Item Structure - */ - - public static class IMAQdxEnumItem extends DisposedStruct { - public int Value; - public int Reserved; - public String Name; - - private void init() { - - } - - public IMAQdxEnumItem() { - super(520); - init(); - } - - public IMAQdxEnumItem(int Value, int Reserved, String Name) { - super(520); - this.Value = Value; - this.Reserved = Reserved; - this.Name = Name; - } - - protected IMAQdxEnumItem(ByteBuffer backing, int offset) { - super(backing, offset, 520); - init(); - } - - protected IMAQdxEnumItem(long nativeObj, boolean owned) { - super(nativeObj, owned, 520); - init(); - } - - protected void setBuffer(ByteBuffer backing, int offset) { - super.setBuffer(backing, offset, 520); - } - - public void read() { - Value = backing.getInt(0); - Reserved = backing.getInt(4); - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(backing, bytes, 8, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - Name = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - Name = ""; - } - } - } - - public void write() { - backing.putInt(0, Value); - backing.putInt(4, Reserved); - if (Name != null) { - byte[] bytes; - try { - bytes = Name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - bytes = new byte[0]; - } - putBytes(backing, bytes, 8, bytes.length); - for (int i = bytes.length; i < IMAQDX_MAX_API_STRING_LENGTH; i++) - backing.put(i, (byte) 0); // fill with zero - } - } - - public int size() { - return 520; - } - } - - /** - * Camera Information Structure - */ - - /** - * Attributes - */ - - /** - * Functions - */ - - public static void IMAQdxSnap(int id, Image image) { - - _IMAQdxSnap(id, image.getAddress()); - - } - - private static native void _IMAQdxSnap(int id, long image); - - public static void IMAQdxConfigureGrab(int id) { - - _IMAQdxConfigureGrab(id); - - } - - private static native void _IMAQdxConfigureGrab(int id); - - public static int IMAQdxGrab(int id, Image image, int waitForNextBuffer) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGrab(id, image.getAddress(), waitForNextBuffer, rv_addr + 0); - int actualBufferNumber; - actualBufferNumber = rv_buf.getInt(0); - return actualBufferNumber; - } - - private static native void _IMAQdxGrab(int id, long image, int waitForNextBuffer, - long actualBufferNumber); - - public static void IMAQdxDiscoverEthernetCameras(String address, int timeout) { - ByteBuffer address_buf = null; - if (address != null) { - byte[] address_bytes; - try { - address_bytes = address.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - address_bytes = new byte[0]; - } - address_buf = ByteBuffer.allocateDirect(address_bytes.length + 1); - putBytes(address_buf, address_bytes, 0, address_bytes.length).put(address_bytes.length, - (byte) 0); - } - _IMAQdxDiscoverEthernetCameras(address == null ? 0 : getByteBufferAddress(address_buf), timeout); - - } - - private static native void _IMAQdxDiscoverEthernetCameras(long address, int timeout); - - public static void IMAQdxResetCamera(String name, int resetAll) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxResetCamera(name == null ? 0 : getByteBufferAddress(name_buf), resetAll); - - } - - private static native void _IMAQdxResetCamera(long name, int resetAll); - - public static int IMAQdxOpenCamera(String name, IMAQdxCameraControlMode mode) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxOpenCamera(name == null ? 0 : getByteBufferAddress(name_buf), mode.getValue(), - rv_addr + 0); - int id; - id = rv_buf.getInt(0); - return id; - } - - private static native void _IMAQdxOpenCamera(long name, int mode, long id); - - public static void IMAQdxCloseCamera(int id) { - - _IMAQdxCloseCamera(id); - - } - - private static native void _IMAQdxCloseCamera(int id); - - public static void IMAQdxConfigureAcquisition(int id, int continuous, int bufferCount) { - - _IMAQdxConfigureAcquisition(id, continuous, bufferCount); - - } - - private static native void _IMAQdxConfigureAcquisition(int id, int continuous, int bufferCount); - - public static void IMAQdxStartAcquisition(int id) { - - _IMAQdxStartAcquisition(id); - - } - - private static native void _IMAQdxStartAcquisition(int id); - - public static int IMAQdxGetImage(int id, Image image, IMAQdxBufferNumberMode mode, - int desiredBufferNumber) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetImage(id, image.getAddress(), mode.getValue(), desiredBufferNumber, rv_addr + 0); - int actualBufferNumber; - actualBufferNumber = rv_buf.getInt(0); - return actualBufferNumber; - } - - private static native void _IMAQdxGetImage(int id, long image, int mode, int desiredBufferNumber, - long actualBufferNumber); - - public static int IMAQdxGetImageData(int id, ByteBuffer buffer, IMAQdxBufferNumberMode mode, - int desiredBufferNumber) { - long buffer_addr = getByteBufferAddress(buffer); - int buffer_size = buffer.capacity(); - return _IMAQdxGetImageData(id, buffer_addr, buffer_size, mode.getValue(), desiredBufferNumber); - } - - private static native int _IMAQdxGetImageData(int id, long buffer, int bufferSize, int mode, - int desiredBufferNumber); - - public static void IMAQdxStopAcquisition(int id) { - - _IMAQdxStopAcquisition(id); - - } - - private static native void _IMAQdxStopAcquisition(int id); - - public static void IMAQdxUnconfigureAcquisition(int id) { - - _IMAQdxUnconfigureAcquisition(id); - - } - - private static native void _IMAQdxUnconfigureAcquisition(int id); - - public static class dxEnumerateVideoModesResult { - public IMAQdxEnumItem[] videoModeArray; - public int currentMode; - private ByteBuffer videoModeArray_buf; - - private dxEnumerateVideoModesResult(ByteBuffer rv_buf, ByteBuffer videoModeArray_buf) { - this.videoModeArray_buf = videoModeArray_buf; - int count = rv_buf.getInt(0); - videoModeArray = new IMAQdxEnumItem[count]; - for (int i = 0, off = 0; i < count; i++, off += 520) { - videoModeArray[i] = new IMAQdxEnumItem(videoModeArray_buf, off); - videoModeArray[i].read(); - } - currentMode = rv_buf.getInt(8); - } - } - - public static dxEnumerateVideoModesResult IMAQdxEnumerateVideoModes(int id) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8 + 8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxEnumerateVideoModes(id, 0, rv_addr + 0, rv_addr + 8); - int count = rv_buf.getInt(0); - ByteBuffer videoModeArray_buf = - ByteBuffer.allocateDirect(count * 520).order(ByteOrder.nativeOrder()); - _IMAQdxEnumerateVideoModes(id, getByteBufferAddress(videoModeArray_buf), rv_addr + 0, - rv_addr + 8); - dxEnumerateVideoModesResult rv = new dxEnumerateVideoModesResult(rv_buf, videoModeArray_buf); - return rv; - } - - private static native void _IMAQdxEnumerateVideoModes(int id, long videoModeArray, long count, - long currentMode); - - public static IMAQdxAttributeType IMAQdxGetAttributeType(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeType(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - IMAQdxAttributeType type; - type = IMAQdxAttributeType.fromValue(rv_buf.getInt(0)); - return type; - } - - private static native void _IMAQdxGetAttributeType(int id, long name, long type); - - public static int IMAQdxIsAttributeReadable(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxIsAttributeReadable(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - int readable; - readable = rv_buf.getInt(0); - return readable; - } - - private static native void _IMAQdxIsAttributeReadable(int id, long name, long readable); - - public static int IMAQdxIsAttributeWritable(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxIsAttributeWritable(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - int writable; - writable = rv_buf.getInt(0); - return writable; - } - - private static native void _IMAQdxIsAttributeWritable(int id, long name, long writable); - - public static void IMAQdxWriteRegister(int id, int offset, int value) { - - _IMAQdxWriteRegister(id, offset, value); - - } - - private static native void _IMAQdxWriteRegister(int id, int offset, int value); - - public static int IMAQdxReadRegister(int id, int offset) { - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxReadRegister(id, offset, rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxReadRegister(int id, int offset, long value); - - public static void IMAQdxWriteAttributes(int id, String filename) { - ByteBuffer filename_buf = null; - if (filename != null) { - byte[] filename_bytes; - try { - filename_bytes = filename.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - filename_bytes = new byte[0]; - } - filename_buf = ByteBuffer.allocateDirect(filename_bytes.length + 1); - putBytes(filename_buf, filename_bytes, 0, filename_bytes.length).put(filename_bytes.length, - (byte) 0); - } - _IMAQdxWriteAttributes(id, filename == null ? 0 : getByteBufferAddress(filename_buf)); - - } - - private static native void _IMAQdxWriteAttributes(int id, long filename); - - public static void IMAQdxReadAttributes(int id, String filename) { - ByteBuffer filename_buf = null; - if (filename != null) { - byte[] filename_bytes; - try { - filename_bytes = filename.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - filename_bytes = new byte[0]; - } - filename_buf = ByteBuffer.allocateDirect(filename_bytes.length + 1); - putBytes(filename_buf, filename_bytes, 0, filename_bytes.length).put(filename_bytes.length, - (byte) 0); - } - _IMAQdxReadAttributes(id, filename == null ? 0 : getByteBufferAddress(filename_buf)); - - } - - private static native void _IMAQdxReadAttributes(int id, long filename); - - public static void IMAQdxResetEthernetCameraAddress(String name, String address, String subnet, - String gateway, int timeout) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer address_buf = null; - if (address != null) { - byte[] address_bytes; - try { - address_bytes = address.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - address_bytes = new byte[0]; - } - address_buf = ByteBuffer.allocateDirect(address_bytes.length + 1); - putBytes(address_buf, address_bytes, 0, address_bytes.length).put(address_bytes.length, - (byte) 0); - } - ByteBuffer subnet_buf = null; - if (subnet != null) { - byte[] subnet_bytes; - try { - subnet_bytes = subnet.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - subnet_bytes = new byte[0]; - } - subnet_buf = ByteBuffer.allocateDirect(subnet_bytes.length + 1); - putBytes(subnet_buf, subnet_bytes, 0, subnet_bytes.length).put(subnet_bytes.length, (byte) 0); - } - ByteBuffer gateway_buf = null; - if (gateway != null) { - byte[] gateway_bytes; - try { - gateway_bytes = gateway.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - gateway_bytes = new byte[0]; - } - gateway_buf = ByteBuffer.allocateDirect(gateway_bytes.length + 1); - putBytes(gateway_buf, gateway_bytes, 0, gateway_bytes.length).put(gateway_bytes.length, - (byte) 0); - } - _IMAQdxResetEthernetCameraAddress(name == null ? 0 : getByteBufferAddress(name_buf), - address == null ? 0 : getByteBufferAddress(address_buf), subnet == null ? 0 - : getByteBufferAddress(subnet_buf), gateway == null ? 0 - : getByteBufferAddress(gateway_buf), timeout); - - } - - private static native void _IMAQdxResetEthernetCameraAddress(long name, long address, - long subnet, long gateway, int timeout); - - public static IMAQdxAttributeVisibility IMAQdxGetAttributeVisibility(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeVisibility(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - IMAQdxAttributeVisibility visibility; - visibility = IMAQdxAttributeVisibility.fromValue(rv_buf.getInt(0)); - return visibility; - } - - private static native void _IMAQdxGetAttributeVisibility(int id, long name, long visibility); - - public static int IMAQdxGetAttributeU32(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeU32(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxGetAttributeU32(int id, long name, long value); - - public static long IMAQdxGetAttributeI64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeI64(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - long value; - value = rv_buf.getLong(0); - return value; - } - - private static native void _IMAQdxGetAttributeI64(int id, long name, long value); - - public static double IMAQdxGetAttributeF64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeF64(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - double value; - value = rv_buf.getDouble(0); - return value; - } - - private static native void _IMAQdxGetAttributeF64(int id, long name, long value); - - public static String IMAQdxGetAttributeString(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = - ByteBuffer.allocateDirect(IMAQDX_MAX_API_STRING_LENGTH).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeString(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - String value; - { - byte[] bytes = new byte[IMAQDX_MAX_API_STRING_LENGTH]; - getBytes(rv_buf, bytes, 0, IMAQDX_MAX_API_STRING_LENGTH); - int len; - for (len = 0; len < bytes.length && bytes[len] != 0; len++) { - } - try { - value = new String(bytes, 0, len, "UTF-8"); - } catch (UnsupportedEncodingException e) { - value = ""; - } - } - return value; - } - - private static native void _IMAQdxGetAttributeString(int id, long name, long value); - - public static IMAQdxEnumItem IMAQdxGetAttributeEnum(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeEnum(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - IMAQdxEnumItem value; - value = new IMAQdxEnumItem(rv_buf, 0); - value.read(); - return value; - } - - private static native void _IMAQdxGetAttributeEnum(int id, long name, long value); - - public static int IMAQdxGetAttributeBool(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeBool(id, name == null ? 0 : getByteBufferAddress(name_buf), rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxGetAttributeBool(int id, long name, long value); - - public static int IMAQdxGetAttributeMinimumU32(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMinimumU32(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxGetAttributeMinimumU32(int id, long name, long value); - - public static long IMAQdxGetAttributeMinimumI64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMinimumI64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - long value; - value = rv_buf.getLong(0); - return value; - } - - private static native void _IMAQdxGetAttributeMinimumI64(int id, long name, long value); - - public static double IMAQdxGetAttributeMinimumF64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMinimumF64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - double value; - value = rv_buf.getDouble(0); - return value; - } - - private static native void _IMAQdxGetAttributeMinimumF64(int id, long name, long value); - - public static int IMAQdxGetAttributeMaximumU32(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMaximumU32(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxGetAttributeMaximumU32(int id, long name, long value); - - public static long IMAQdxGetAttributeMaximumI64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMaximumI64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - long value; - value = rv_buf.getLong(0); - return value; - } - - private static native void _IMAQdxGetAttributeMaximumI64(int id, long name, long value); - - public static double IMAQdxGetAttributeMaximumF64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeMaximumF64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - double value; - value = rv_buf.getDouble(0); - return value; - } - - private static native void _IMAQdxGetAttributeMaximumF64(int id, long name, long value); - - public static int IMAQdxGetAttributeIncrementU32(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeIncrementU32(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - int value; - value = rv_buf.getInt(0); - return value; - } - - private static native void _IMAQdxGetAttributeIncrementU32(int id, long name, long value); - - public static long IMAQdxGetAttributeIncrementI64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeIncrementI64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - long value; - value = rv_buf.getLong(0); - return value; - } - - private static native void _IMAQdxGetAttributeIncrementI64(int id, long name, long value); - - public static double IMAQdxGetAttributeIncrementF64(int id, String name) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer rv_buf = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()); - long rv_addr = getByteBufferAddress(rv_buf); - _IMAQdxGetAttributeIncrementF64(id, name == null ? 0 : getByteBufferAddress(name_buf), - rv_addr + 0); - double value; - value = rv_buf.getDouble(0); - return value; - } - - private static native void _IMAQdxGetAttributeIncrementF64(int id, long name, long value); - - public static void IMAQdxSetAttributeU32(int id, String name, int value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeU32(id, name == null ? 0 : getByteBufferAddress(name_buf), value); - - } - - private static native void _IMAQdxSetAttributeU32(int id, long name, int value); - - public static void IMAQdxSetAttributeI64(int id, String name, long value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeI64(id, name == null ? 0 : getByteBufferAddress(name_buf), value); - - } - - private static native void _IMAQdxSetAttributeI64(int id, long name, long value); - - public static void IMAQdxSetAttributeF64(int id, String name, double value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeF64(id, name == null ? 0 : getByteBufferAddress(name_buf), value); - - } - - private static native void _IMAQdxSetAttributeF64(int id, long name, double value); - - public static void IMAQdxSetAttributeString(int id, String name, String value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - ByteBuffer value_buf = null; - if (value != null) { - byte[] value_bytes; - try { - value_bytes = value.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - value_bytes = new byte[0]; - } - value_buf = ByteBuffer.allocateDirect(value_bytes.length + 1); - putBytes(value_buf, value_bytes, 0, value_bytes.length).put(value_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeString(id, name == null ? 0 : getByteBufferAddress(name_buf), - value == null ? 0 : getByteBufferAddress(value_buf)); - - } - - private static native void _IMAQdxSetAttributeString(int id, long name, long value); - - public static void IMAQdxSetAttributeEnum(int id, String name, IMAQdxEnumItem value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeEnum(id, name == null ? 0 : getByteBufferAddress(name_buf), - value.getAddress()); - - } - - private static native void _IMAQdxSetAttributeEnum(int id, long name, long value); - - public static void IMAQdxSetAttributeBool(int id, String name, int value) { - ByteBuffer name_buf = null; - if (name != null) { - byte[] name_bytes; - try { - name_bytes = name.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - name_bytes = new byte[0]; - } - name_buf = ByteBuffer.allocateDirect(name_bytes.length + 1); - putBytes(name_buf, name_bytes, 0, name_bytes.length).put(name_bytes.length, (byte) 0); - } - _IMAQdxSetAttributeBool(id, name == null ? 0 : getByteBufferAddress(name_buf), value); - - } - - private static native void _IMAQdxSetAttributeBool(int id, long name, int value); -} diff --git a/wpilibj/src/athena/java/com/ni/vision/VisionException.java b/wpilibj/src/athena/java/com/ni/vision/VisionException.java deleted file mode 100644 index 362a20dffe..0000000000 --- a/wpilibj/src/athena/java/com/ni/vision/VisionException.java +++ /dev/null @@ -1,20 +0,0 @@ -// -// This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py -// Please do not edit! -// - -package com.ni.vision; - -public class VisionException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - public VisionException(String msg) { - super(msg); - } - - @Override - public String toString() { - return "VisionException [" + super.toString() + "]"; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java deleted file mode 100644 index 2ba171fe43..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java +++ /dev/null @@ -1,381 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj; - -import com.ni.vision.NIVision; -import com.ni.vision.NIVision.Image; -import com.ni.vision.NIVision.RawData; -import com.ni.vision.VisionException; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.nio.ByteBuffer; -import java.util.ArrayDeque; -import java.util.Deque; - -import edu.wpi.first.wpilibj.vision.USBCamera; - -// replicates CameraServer.cpp in java lib - -public class CameraServer { - - private static final int kPort = 1180; - private static final byte[] kMagicNumber = {0x01, 0x00, 0x00, 0x00}; - private static final int kSize640x480 = 0; - private static final int kSize320x240 = 1; - private static final int kSize160x120 = 2; - private static final int kHardwareCompression = -1; - private static final String kDefaultCameraName = "cam1"; - private static final int kMaxImageSize = 200000; - private static CameraServer server; - - @SuppressWarnings("JavadocMethod") - public static CameraServer getInstance() { - if (server == null) { - server = new CameraServer(); - } - return server; - } - - private int m_quality; - private boolean m_autoCaptureStarted; - private boolean m_hwClient = true; - private USBCamera m_camera; - private CameraData m_imageData; - private Deque m_imageDataPool; - - @SuppressWarnings("JavadocMethod") - private final class CameraData { - @SuppressWarnings("MemberName") - private final RawData data; - @SuppressWarnings("MemberName") - private final int start; - - CameraData(RawData data, int start) { - this.data = data; - this.start = start; - } - } - - @SuppressWarnings("JavadocMethod") - private CameraServer() { - m_quality = 50; - m_camera = null; - m_imageData = null; - m_imageDataPool = new ArrayDeque<>(3); - for (int i = 0; i < 3; i++) { - m_imageDataPool.addLast(ByteBuffer.allocateDirect(kMaxImageSize)); - } - final Thread serverThread = new Thread(new Runnable() { - public void run() { - try { - serve(); - } catch (IOException ex) { - // do stuff here - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } - }); - serverThread.setName("CameraServer Send Thread"); - serverThread.start(); - } - - @SuppressWarnings("JavadocMethod") - private synchronized void setImageData(RawData data, int start) { - if (m_imageData != null && m_imageData.data != null) { - m_imageData.data.free(); - if (m_imageData.data.getBuffer() != null) { - m_imageDataPool.addLast(m_imageData.data.getBuffer()); - } - m_imageData = null; - } - m_imageData = new CameraData(data, start); - notifyAll(); - } - - /** - * Manually change the image that is served by the MJPEG stream. This can be called to pass custom - * annotated images to the dashboard. Note that, for 640x480 video, this method could take between - * 40 and 50 milliseconds to complete. - * - *

This shouldn't be called if {@link #startAutomaticCapture} is called. - * - * @param image The IMAQ image to show on the dashboard - */ - public void setImage(Image image) { - // handle multi-threadedness - - /* Flatten the IMAQ image to a JPEG */ - - RawData data = - NIVision.imaqFlatten(image, NIVision.FlattenType.FLATTEN_IMAGE, - NIVision.CompressionType.COMPRESSION_JPEG, 10 * m_quality); - ByteBuffer buffer = data.getBuffer(); - boolean hwClient; - - synchronized (this) { - hwClient = m_hwClient; - } - - /* Find the start of the JPEG data */ - int index = 0; - if (hwClient) { - while (index < buffer.limit() - 1) { - if ((buffer.get(index) & 0xff) == 0xFF && (buffer.get(index + 1) & 0xff) == 0xD8) { - break; - } - index++; - } - } - - if (buffer.limit() - index - 1 <= 2) { - throw new VisionException("data size of flattened image is less than 2. Try another " - + "camera!"); - } - - setImageData(data, index); - } - - /** - * Start automatically capturing images to send to the dashboard. You should call this method to - * just see a camera feed on the dashboard without doing any vision processing on the roboRIO. - * {@link #setImage} shouldn't be called after this is called. This overload calles {@link - * #startAutomaticCapture(String)} with the default camera name - */ - public void startAutomaticCapture() { - startAutomaticCapture(USBCamera.kDefaultCameraName); - } - - /** - * Start automatically capturing images to send to the dashboard. - * - *

You should call this method to just see a camera feed on the dashboard without doing any - * vision processing on the roboRIO. {@link #setImage} shouldn't be called after this is called. - * - * @param cameraName The name of the camera interface (e.g. "cam1") - */ - public void startAutomaticCapture(String cameraName) { - try { - USBCamera camera = new USBCamera(cameraName); - camera.openCamera(); - startAutomaticCapture(camera); - } catch (VisionException ex) { - DriverStation.reportError( - "Error when starting the camera: " + cameraName + " " + ex.getMessage(), true); - } - } - - @SuppressWarnings("JavadocMethod") - public synchronized void startAutomaticCapture(USBCamera camera) { - if (m_autoCaptureStarted) { - return; - } - m_autoCaptureStarted = true; - m_camera = camera; - - m_camera.startCapture(); - - Thread captureThread = new Thread(new Runnable() { - @Override - public void run() { - capture(); - } - }); - captureThread.setName("Camera Capture Thread"); - captureThread.start(); - } - - protected void capture() { - Image frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0); - while (true) { - boolean hwClient; - ByteBuffer dataBuffer = null; - synchronized (this) { - hwClient = m_hwClient; - if (hwClient) { - dataBuffer = m_imageDataPool.removeLast(); - } - } - - try { - if (hwClient && dataBuffer != null) { - // Reset the image buffer limit - dataBuffer.limit(dataBuffer.capacity() - 1); - m_camera.getImageData(dataBuffer); - setImageData(new RawData(dataBuffer), 0); - } else { - m_camera.getImage(frame); - setImage(frame); - } - } catch (VisionException ex) { - DriverStation.reportError("Error when getting image from the camera: " + ex.getMessage(), - true); - if (dataBuffer != null) { - synchronized (this) { - m_imageDataPool.addLast(dataBuffer); - Timer.delay(.1); - } - } - } - } - } - - - /** - * Check if auto capture is started. - */ - public synchronized boolean isAutoCaptureStarted() { - return m_autoCaptureStarted; - } - - /** - * Sets the size of the image to use. Use the public kSize constants to set the correct mode, or - * set it directory on a camera and call the appropriate autoCapture method. - * - * @param size The size to use - */ - public synchronized void setSize(int size) { - if (m_camera == null) { - return; - } - switch (size) { - case kSize640x480: - m_camera.setSize(640, 480); - break; - case kSize320x240: - m_camera.setSize(320, 240); - break; - case kSize160x120: - m_camera.setSize(160, 120); - break; - default: - throw new IllegalArgumentException("Unsupported size: " + size); - } - } - - /** - * Set the quality of the compressed image sent to the dashboard. - * - * @param quality The quality of the JPEG image, from 0 to 100 - */ - public synchronized void setQuality(int quality) { - m_quality = quality > 100 ? 100 : quality < 0 ? 0 : quality; - } - - /** - * Get the quality of the compressed image sent to the dashboard. - * - * @return The quality, from 0 to 100 - */ - public synchronized int getQuality() { - return m_quality; - } - - /** - * Run the M-JPEG server. - * - *

This function listens for a connection from the dashboard in a background thread, then - * sends back the M-JPEG stream. - * - * @throws IOException if the Socket connection fails - * @throws InterruptedException if the sleep is interrupted - */ - protected void serve() throws IOException, InterruptedException { - - ServerSocket socket = new ServerSocket(); - socket.setReuseAddress(true); - InetSocketAddress address = new InetSocketAddress(kPort); - socket.bind(address); - - while (true) { - try { - Socket socket1 = socket.accept(); - - DataInputStream is = new DataInputStream(socket1.getInputStream()); - DataOutputStream os = new DataOutputStream(socket1.getOutputStream()); - - int fps = is.readInt(); - int compression = is.readInt(); - int size = is.readInt(); - - if (compression != kHardwareCompression) { - DriverStation.reportError("Choose \"USB Camera HW\" on the dashboard", false); - socket1.close(); - continue; - } - - // Wait for the camera - synchronized (this) { - System.out.println("Camera not yet ready, awaiting image"); - if (m_camera == null) { - wait(); - } - m_hwClient = compression == kHardwareCompression; - if (!m_hwClient) { - setQuality(100 - compression); - } else if (m_camera != null) { - m_camera.setFPS(fps); - } - setSize(size); - } - - long period = (long) (1000 / (1.0 * fps)); - while (true) { - long t0 = System.currentTimeMillis(); - final CameraData imageData; - synchronized (this) { - wait(); - imageData = m_imageData; - m_imageData = null; - } - - if (imageData == null) { - continue; - } - // Set the buffer position to the start of the data, - // and then create a new wrapper for the data at - // exactly that position - imageData.data.getBuffer().position(imageData.start); - byte[] imageArray = new byte[imageData.data.getBuffer().remaining()]; - imageData.data.getBuffer().get(imageArray, 0, imageData.data.getBuffer().remaining()); - - // write numbers - try { - os.write(kMagicNumber); - os.writeInt(imageArray.length); - os.write(imageArray); - os.flush(); - long dt = System.currentTimeMillis() - t0; - - if (dt < period) { - Thread.sleep(period - dt); - } - } catch (IOException | UnsupportedOperationException ex) { - DriverStation.reportError(ex.getMessage(), true); - break; - } finally { - imageData.data.free(); - if (imageData.data.getBuffer() != null) { - synchronized (this) { - m_imageDataPool.addLast(imageData.data.getBuffer()); - } - } - } - } - } catch (IOException ex) { - DriverStation.reportError(ex.getMessage(), true); - continue; - } - } - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/BinaryImage.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/BinaryImage.java deleted file mode 100644 index 5ac8b42dd4..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/BinaryImage.java +++ /dev/null @@ -1,180 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; - -import edu.wpi.first.wpilibj.util.SortedVector; - -/** - * An image where each pixel is treated as either on or off. - */ -public class BinaryImage extends MonoImage { - private int m_numParticles = -1; - - BinaryImage() throws NIVisionException { - } - - BinaryImage(BinaryImage sourceImage) { - super(sourceImage); - } - - /** - * Returns the number of particles. - * - * @return The number of particles - */ - public int getNumberParticles() throws NIVisionException { - if (m_numParticles < 0) { - m_numParticles = NIVision.imaqCountParticles(image, 1); - } - return m_numParticles; - } - - - private class ParticleSizeReport { - final int m_index; - final double m_size; - - public ParticleSizeReport(int index) throws NIVisionException { - if ((!(index < BinaryImage.this.getNumberParticles())) || index < 0) { - throw new IndexOutOfBoundsException(); - } - m_index = index; - m_size = ParticleAnalysisReport.getParticleToImagePercent(BinaryImage.this, index); - } - - public ParticleAnalysisReport getParticleAnalysisReport() throws NIVisionException { - return new ParticleAnalysisReport(BinaryImage.this, m_index); - } - } - - /** - * Get a particle analysis report for the particle at the given index. - * - * @param index The index of the particle to report on. - * @return The ParticleAnalysisReport for the particle at the given index - */ - public ParticleAnalysisReport getParticleAnalysisReport(int index) throws NIVisionException { - if (!(index < getNumberParticles())) { - throw new IndexOutOfBoundsException(); - } - return new ParticleAnalysisReport(this, index); - } - - /** - * Gets all the particle analysis reports ordered from largest area to smallest. - * - * @param size The number of particles to return - * @return An array of ParticleReports from largest area to smallest - */ - public ParticleAnalysisReport[] getOrderedParticleAnalysisReports(int size) - throws NIVisionException { - if (size > getNumberParticles()) { - size = getNumberParticles(); - } - ParticleSizeReport[] reports = new ParticleSizeReport[size]; - SortedVector sorter = new SortedVector(new SortedVector.Comparator() { - public int compare(Object object1, Object object2) { - ParticleSizeReport p1 = (ParticleSizeReport) object1; - ParticleSizeReport p2 = (ParticleSizeReport) object2; - if (p1.m_size < p2.m_size) { - return -1; - } else if (p1.m_size > p2.m_size) { - return 1; - } - return 0; - } - }); - for (int i = 0; i < getNumberParticles(); i++) { - sorter.addElement(new ParticleSizeReport(i)); - } - sorter.setSize(size); - sorter.copyInto(reports); - ParticleAnalysisReport[] finalReports = new ParticleAnalysisReport[reports.length]; - for (int i = 0; i < finalReports.length; i++) { - finalReports[i] = reports[i].getParticleAnalysisReport(); - } - return finalReports; - } - - /** - * Gets all the particle analysis reports ordered from largest area to smallest. - * - * @return An array of ParticleReports from largest are to smallest - */ - public ParticleAnalysisReport[] getOrderedParticleAnalysisReports() throws NIVisionException { - return getOrderedParticleAnalysisReports(getNumberParticles()); - } - - @SuppressWarnings({"summaryjavadoc", "javadocmethod"}) - public void write(String fileName) throws NIVisionException { - NIVision.RGBValue colorTable = new NIVision.RGBValue(0, 0, 255, 0); - try { - NIVision.imaqWriteFile(image, fileName, colorTable); - } finally { - colorTable.free(); - } - } - - /** - * removeSmallObjects filters particles based on their m_size. The algorithm erodes the image a - * specified number of times and keeps the particles from the original image that remain in the - * eroded image. - * - * @param connectivity8 true to use connectivity-8 or false for connectivity-4 to determine - * whether particles are touching. For more information about connectivity, - * see Chapter 9, Binary Morphology, in the NI Vision Concepts manual. - * @param erosions the number of erosions to perform - * @return a BinaryImage after applying the filter - */ - public BinaryImage removeSmallObjects(boolean connectivity8, int erosions) - throws NIVisionException { - BinaryImage result = new BinaryImage(); - NIVision.imaqSizeFilter(result.image, image, connectivity8 ? 1 : 0, erosions, - NIVision.SizeType.KEEP_LARGE, null); - result.free(); - return result; - } - - /** - * removeLargeObjects filters particles based on their m_size. The algorithm erodes the image a - * specified number of times and discards the particles from the original image that remain in the - * eroded image. - * - * @param connectivity8 true to use connectivity-8 or false for connectivity-4 to determine - * whether particles are touching. For more information about connectivity, - * see Chapter 9, Binary Morphology, in the NI Vision Concepts manual. - * @param erosions the number of erosions to perform - * @return a BinaryImage after applying the filter - */ - public BinaryImage removeLargeObjects(boolean connectivity8, int erosions) - throws NIVisionException { - BinaryImage result = new BinaryImage(); - NIVision.imaqSizeFilter(result.image, image, connectivity8 ? 1 : 0, erosions, - NIVision.SizeType.KEEP_SMALL, null); - return result; - } - - @SuppressWarnings({"summaryjavadoc", "javadocmethod"}) - public BinaryImage convexHull(boolean connectivity8) throws NIVisionException { - BinaryImage result = new BinaryImage(); - NIVision.imaqConvexHull(result.image, image, connectivity8 ? 1 : 0); - return result; - } - - @SuppressWarnings({"summaryjavadoc", "javadocmethod"}) - public BinaryImage particleFilter(NIVision.ParticleFilterCriteria2[] criteria) - throws NIVisionException { - BinaryImage result = new BinaryImage(); - NIVision.ParticleFilterOptions2 options = new NIVision.ParticleFilterOptions2(0, 0, 0, 1); - NIVision.imaqParticleFilter4(result.image, image, criteria, options, null); - options.free(); - return result; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ColorImage.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ColorImage.java deleted file mode 100644 index 77e2db5d7d..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ColorImage.java +++ /dev/null @@ -1,423 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; - -/** - * A class representing a color image. - */ -public abstract class ColorImage extends ImageBase { - - ColorImage(NIVision.ImageType type) throws NIVisionException { - super(type); - } - - ColorImage(ColorImage sourceImage) { - super(sourceImage); - } - - private BinaryImage threshold(NIVision.ColorMode colorMode, int low1, int high1, int low2, - int high2, int low3, int high3) throws NIVisionException { - BinaryImage res = new BinaryImage(); - NIVision.Range range1 = new NIVision.Range(low1, high1); - NIVision.Range range2 = new NIVision.Range(low2, high2); - NIVision.Range range3 = new NIVision.Range(low3, high3); - NIVision.imaqColorThreshold(res.image, image, 1, colorMode, range1, range2, range3); - res.free(); - range1.free(); - range2.free(); - range3.free(); - return res; - } - - /** - * Return a mask of the areas of the image that fall within the given ranges for color values - * - * @param redLow The lower red limit. - * @param redHigh The upper red limit. - * @param greenLow The lower green limit. - * @param greenHigh The upper green limit. - * @param blueLow The lower blue limit. - * @param blueHigh The upper blue limit. - * @return A BinaryImage masking the areas which match the given thresholds. - */ - public BinaryImage thresholdRGB(int redLow, int redHigh, int greenLow, int greenHigh, - int blueLow, int blueHigh) throws NIVisionException { - return threshold(NIVision.ColorMode.RGB, redLow, redHigh, greenLow, greenHigh, blueLow, - blueHigh); - } - - /** - * Return a mask of the areas of the image that fall within the given ranges for color values - * - * @param hueLow The lower hue limit. - * @param hueHigh The upper hue limit. - * @param saturationLow The lower saturation limit. - * @param saturationHigh The upper saturation limit. - * @param luminenceLow The lower luminence limit. - * @param luminenceHigh The upper luminence limit. - * @return A BinaryImage masking the areas which match the given thresholds. - */ - public BinaryImage thresholdHSL(int hueLow, int hueHigh, int saturationLow, int saturationHigh, - int luminenceLow, int luminenceHigh) throws NIVisionException { - return threshold(NIVision.ColorMode.HSL, hueLow, hueHigh, saturationLow, saturationHigh, - luminenceLow, luminenceHigh); - } - - /** - * Return a mask of the areas of the image that fall within the given ranges for color values - * - * @param hueLow The lower hue limit. - * @param hueHigh The upper hue limit. - * @param saturationLow The lower saturation limit. - * @param saturationHigh The upper saturation limit. - * @param valueHigh The lower value limit. - * @param valueLow The upper value limit. - * @return A BinaryImage masking the areas which match the given thresholds. - */ - public BinaryImage thresholdHSV(int hueLow, int hueHigh, int saturationLow, int saturationHigh, - int valueLow, int valueHigh) throws NIVisionException { - return threshold(NIVision.ColorMode.HSV, hueLow, hueHigh, saturationLow, saturationHigh, - valueLow, valueHigh); - } - - /** - * Return a mask of the areas of the image that fall within the given ranges for color values - * - * @param hueLow The lower hue limit. - * @param hueHigh The upper hue limit. - * @param saturationLow The lower saturation limit. - * @param saturationHigh The upper saturation limit. - * @param intansityLow The lower intensity limit. - * @param intensityHigh The upper intensity limit. - * @return A BinaryImage masking the areas which match the given thresholds. - */ - public BinaryImage thresholdHSI(int hueLow, int hueHigh, int saturationLow, int saturationHigh, - int intansityLow, int intensityHigh) throws NIVisionException { - return threshold(NIVision.ColorMode.HSI, hueLow, hueHigh, saturationLow, saturationHigh, - intansityLow, intensityHigh); - } - - MonoImage extractFirstColorPlane(NIVision.ColorMode mode) throws NIVisionException { - MonoImage result = new MonoImage(); - NIVision.imaqExtractColorPlanes(image, mode, result.image, null, null); - result.free(); - return result; - } - - MonoImage extractSecondColorPlane(NIVision.ColorMode mode) throws NIVisionException { - MonoImage result = new MonoImage(); - NIVision.imaqExtractColorPlanes(image, mode, null, result.image, null); - result.free(); - return result; - } - - MonoImage extractThirdColorPlane(NIVision.ColorMode mode) throws NIVisionException { - MonoImage result = new MonoImage(); - NIVision.imaqExtractColorPlanes(image, mode, null, null, result.image); - result.free(); - return result; - } - - /** - * Get the red color plane from the image when represented in RGB color space. - * - * @return The red color plane from the image. - */ - public MonoImage getRedPlane() throws NIVisionException { - return extractFirstColorPlane(NIVision.ColorMode.RGB); - } - - /** - * Get the green color plane from the image when represented in RGB color space. - * - * @return The green color plane from the image. - */ - public MonoImage getGreenPlane() throws NIVisionException { - return extractSecondColorPlane(NIVision.ColorMode.RGB); - } - - /** - * Get the blue color plane from the image when represented in RGB color space. - * - * @return The blue color plane from the image. - */ - public MonoImage getBluePlane() throws NIVisionException { - return extractThirdColorPlane(NIVision.ColorMode.RGB); - } - - /** - * Get the hue color plane from the image when represented in HSL color space. - * - * @return The hue color plane from the image. - */ - public MonoImage getHSLHuePlane() throws NIVisionException { - return extractFirstColorPlane(NIVision.ColorMode.HSL); - } - - /** - * Get the hue color plane from the image when represented in HSV color space. - * - * @return The hue color plane from the image. - */ - public MonoImage getHSVHuePlane() throws NIVisionException { - return extractFirstColorPlane(NIVision.ColorMode.HSV); - } - - /** - * Get the hue color plane from the image when represented in HSI color space. - * - * @return The hue color plane from the image. - */ - public MonoImage getHSIHuePlane() throws NIVisionException { - return extractFirstColorPlane(NIVision.ColorMode.HSI); - } - - /** - * Get the saturation color plane from the image when represented in HSL color space. - * - * @return The saturation color plane from the image. - */ - public MonoImage getHSLSaturationPlane() throws NIVisionException { - return extractSecondColorPlane(NIVision.ColorMode.HSL); - } - - /** - * Get the saturation color plane from the image when represented in HSV color space. - * - * @return The saturation color plane from the image. - */ - public MonoImage getHSVSaturationPlane() throws NIVisionException { - return extractSecondColorPlane(NIVision.ColorMode.HSV); - } - - /** - * Get the saturation color plane from the image when represented in HSI color space. - * - * @return The saturation color plane from the image. - */ - public MonoImage getHSISaturationPlane() throws NIVisionException { - return extractSecondColorPlane(NIVision.ColorMode.HSI); - } - - /** - * Get the luminance color plane from the image when represented in HSL color space. - * - * @return The luminance color plane from the image. - */ - public MonoImage getLuminancePlane() throws NIVisionException { - return extractThirdColorPlane(NIVision.ColorMode.HSL); - } - - /** - * Get the value color plane from the image when represented in HSV color space. - * - * @return The value color plane from the image. - */ - public MonoImage getValuePlane() throws NIVisionException { - return extractThirdColorPlane(NIVision.ColorMode.HSV); - } - - /** - * Get the intensity color plane from the image when represented in HSI color space. - * - * @return The intensity color plane from the image. - */ - public MonoImage getIntensityPlane() throws NIVisionException { - return extractThirdColorPlane(NIVision.ColorMode.HSI); - } - - ColorImage replaceFirstColorPlane(NIVision.ColorMode mode, MonoImage plane) - throws NIVisionException { - NIVision.imaqReplaceColorPlanes(image, image, mode, plane.image, null, null); - return this; - } - - ColorImage replaceSecondColorPlane(NIVision.ColorMode mode, MonoImage plane) - throws NIVisionException { - NIVision.imaqReplaceColorPlanes(image, image, mode, null, plane.image, null); - return this; - } - - ColorImage replaceThirdColorPlane(NIVision.ColorMode mode, MonoImage plane) - throws NIVisionException { - NIVision.imaqReplaceColorPlanes(image, image, mode, null, null, plane.image); - return this; - } - - /** - * Set the red color plane from the image when represented in RGB color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceRedPlane(MonoImage plane) throws NIVisionException { - return replaceFirstColorPlane(NIVision.ColorMode.RGB, plane); - } - - /** - * Set the green color plane from the image when represented in RGB color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceGreenPlane(MonoImage plane) throws NIVisionException { - return replaceSecondColorPlane(NIVision.ColorMode.RGB, plane); - } - - /** - * Set the blue color plane from the image when represented in RGB color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceBluePlane(MonoImage plane) throws NIVisionException { - return replaceThirdColorPlane(NIVision.ColorMode.RGB, plane); - } - - /** - * Set the hue color plane from the image when represented in HSL color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSLHuePlane(MonoImage plane) throws NIVisionException { - return replaceFirstColorPlane(NIVision.ColorMode.HSL, plane); - } - - /** - * Set the hue color plane from the image when represented in HSV color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSVHuePlane(MonoImage plane) throws NIVisionException { - return replaceFirstColorPlane(NIVision.ColorMode.HSV, plane); - } - - /** - * Set the hue color plane from the image when represented in HSI color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSIHuePlane(MonoImage plane) throws NIVisionException { - return replaceFirstColorPlane(NIVision.ColorMode.HSI, plane); - } - - /** - * Set the saturation color plane from the image when represented in HSL color space. This does - * not create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSLSaturationPlane(MonoImage plane) throws NIVisionException { - return replaceSecondColorPlane(NIVision.ColorMode.HSL, plane); - } - - /** - * Set the saturation color plane from the image when represented in HSV color space. This does - * not create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSVSaturationPlane(MonoImage plane) throws NIVisionException { - return replaceSecondColorPlane(NIVision.ColorMode.HSV, plane); - } - - /** - * Set the saturation color plane from the image when represented in HSI color space. This does - * not create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceHSISaturationPlane(MonoImage plane) throws NIVisionException { - return replaceSecondColorPlane(NIVision.ColorMode.HSI, plane); - } - - /** - * Set the luminance color plane from the image when represented in HSL color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceLuminancePlane(MonoImage plane) throws NIVisionException { - return replaceThirdColorPlane(NIVision.ColorMode.HSL, plane); - } - - /** - * Set the value color plane from the image when represented in HSV color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceValuePlane(MonoImage plane) throws NIVisionException { - return replaceThirdColorPlane(NIVision.ColorMode.HSV, plane); - } - - /** - * Set the intensity color plane from the image when represented in HSI color space. This does not - * create a new image, but modifies this one instead. Create a copy before hand if you need to - * continue using the original. - * - * @param plane The MonoImage representing the new color plane. - * @return The resulting image. - */ - public ColorImage replaceIntensityPlane(MonoImage plane) throws NIVisionException { - return replaceThirdColorPlane(NIVision.ColorMode.HSI, plane); - } - - /** - * Calculates the histogram of each plane of a color image and redistributes pixel values across - * the desired range while maintaining pixel value groupings. This does not create a new image, - * but modifies this one instead. Create a copy before hand if you need to continue using the - * original. - * - * @return The modified image. - */ - public ColorImage colorEqualize() throws NIVisionException { - NIVision.imaqColorEqualize(image, image, 1); - return this; - } - - /** - * Calculates the histogram of each plane of a color image and redistributes pixel values across - * the desired range while maintaining pixel value groupings for the Luminance plane only. This - * does not create a new image, but modifies this one instead. Create a copy before hand if you - * need to continue using the original. - * - * @return The modified image. - */ - public ColorImage luminanceEqualize() throws NIVisionException { - NIVision.imaqColorEqualize(image, image, 0); - return this; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/HSLImage.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/HSLImage.java deleted file mode 100644 index c486a8fb83..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/HSLImage.java +++ /dev/null @@ -1,37 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; - -/** - * A color image represented in HSL color space at 3 bytes per pixel. - */ -public class HSLImage extends ColorImage { - - /** - * Create a new 0x0 image. - */ - public HSLImage() throws NIVisionException { - super(NIVision.ImageType.IMAGE_HSL); - } - - HSLImage(HSLImage sourceImage) { - super(sourceImage); - } - - /** - * Create a new image by loading a file. - * - * @param fileName The path of the file to load. - */ - public HSLImage(String fileName) throws NIVisionException { - super(NIVision.ImageType.IMAGE_HSL); - NIVision.imaqReadFile(image, fileName); - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ImageBase.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ImageBase.java deleted file mode 100644 index d336078bb0..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ImageBase.java +++ /dev/null @@ -1,77 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; -import com.ni.vision.NIVision.Image; - -/** - * Class representing a generic image. - */ -public abstract class ImageBase { - - /** - * Pointer to the image memory. - */ - @SuppressWarnings("MemberName") - public final Image image; - static final int DEFAULT_BORDER_SIZE = 3; - - ImageBase(NIVision.ImageType type) throws NIVisionException { - image = NIVision.imaqCreateImage(type, DEFAULT_BORDER_SIZE); - } - - /** - * Creates a new image pointing to the same data as the source image. The imgae data is not - * copied, it is just referenced by both objects. Freeing one will free both. - * - * @param sourceImage The image to reference - */ - ImageBase(ImageBase sourceImage) { - image = sourceImage.image; - } - - /** - * Write the image to a file. - * - *

Supported extensions: .aipd or .apd AIPD .bmp BMP .jpg or .jpeg JPEG .jp2 JPEG2000 .png PNG - * .tif or .tiff TIFF - * - * @param fileName The path to write the image to. - */ - public void write(String fileName) throws NIVisionException { - NIVision.RGBValue value = new NIVision.RGBValue(); - NIVision.imaqWriteFile(image, fileName, value); - value.free(); - } - - /** - * Release the memory associated with an image. - */ - public void free() throws NIVisionException { - image.free(); - } - - /** - * Get the height of the image in pixels. - * - * @return The height of the image. - */ - public int getHeight() throws NIVisionException { - return NIVision.imaqGetImageSize(image).height; - } - - /** - * Get the width of the image in pixels. - * - * @return The width of the image. - */ - public int getWidth() throws NIVisionException { - return NIVision.imaqGetImageSize(image).width; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/MonoImage.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/MonoImage.java deleted file mode 100644 index 29b1df8229..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/MonoImage.java +++ /dev/null @@ -1,45 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; -import com.ni.vision.NIVision.CurveOptions; -import com.ni.vision.NIVision.DetectEllipsesResult; -import com.ni.vision.NIVision.EllipseDescriptor; -import com.ni.vision.NIVision.ROI; -import com.ni.vision.NIVision.ShapeDetectionOptions; - -/** - * A grey scale image represented at a byte per pixel. - */ -public class MonoImage extends ImageBase { - - /** - * Create a new 0x0 image. - */ - public MonoImage() throws NIVisionException { - super(NIVision.ImageType.IMAGE_U8); - } - - MonoImage(MonoImage sourceImage) { - super(sourceImage); - } - - public DetectEllipsesResult detectEllipses(EllipseDescriptor ellipseDescriptor, - CurveOptions curveOptions, - ShapeDetectionOptions shapeDetectionOptions, - ROI roi) throws NIVisionException { - return NIVision - .imaqDetectEllipses(image, ellipseDescriptor, curveOptions, shapeDetectionOptions, roi); - } - - public DetectEllipsesResult detectEllipses(EllipseDescriptor ellipseDescriptor) - throws NIVisionException { - return NIVision.imaqDetectEllipses(image, ellipseDescriptor, null, null, null); - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/NIVisionException.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/NIVisionException.java deleted file mode 100644 index 79a24f407b..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/NIVisionException.java +++ /dev/null @@ -1,1197 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -/** - * Exception class which looks up nivision error codes. - */ -@SuppressWarnings("all") -public class NIVisionException extends Exception { - - /** - * Create a new NIVisionException. - * - * @param msg The message to pass with the exception describing what caused it. - */ - public NIVisionException(String msg) { - super(msg); - } - - /** - * Create a new vision exception. - * - * @param errorCode the bad status code - */ - public NIVisionException(int errorCode) { - super(lookUpCode(errorCode)); - } - - private static String lookUpCode(int errorCode) { - - switch (errorCode) { - case 0: - return "No error."; - case -1074396160: - return "System error."; - case -1074396159: - return "Not enough memory for requested operation."; - case -1074396158: - return "Memory error."; - case -1074396157: - return "Unlicensed copy of NI Vision."; - case -1074396156: - return "The function requires an NI Vision 5.0 Advanced license."; - case -1074396155: - return "NI Vision did not initialize properly."; - case -1074396154: - return "The image is not large enough for the operation."; - case -1074396153: - return "The barcode is not a valid Codabar barcode."; - case -1074396152: - return "The barcode is not a valid Code 3 of 9 barcode."; - case -1074396151: - return "The barcode is not a valid Code93 barcode."; - case -1074396150: - return "The barcode is not a valid Code128 barcode."; - case -1074396149: - return "The barcode is not a valid EAN8 barcode."; - case -1074396148: - return "The barcode is not a valid EAN13 barcode."; - case -1074396147: - return "The barcode is not a valid Interleaved 2 of 5 barcode."; - case -1074396146: - return "The barcode is not a valid MSI barcode."; - case -1074396145: - return "The barcode is not a valid UPCA barcode."; - case -1074396144: - return "The Code93 barcode contains invalid shift encoding."; - case -1074396143: - return "The barcode type is invalid."; - case -1074396142: - return "The image does not represent a valid linear barcode."; - case -1074396141: - return "The FNC value in the Code128 barcode is not located before the first data value."; - case -1074396140: - return "The starting code set in the Code128 barcode is not valid."; - case -1074396139: - return "Not enough reserved memory in the timed environment for the requested operation."; - case -1074396138: - return "The function is not supported when a time limit is active."; - case -1074396137: - return "Quartz.dll not found. Install DirectX 8.1 or later."; - case -1074396136: - return "The filter quality you provided is invalid. Valid quality values range from -1 to 1000."; - case -1074396135: - return "Invalid button label."; - case -1074396134: - return "Could not execute the function in the separate thread because the thread has not completed initialization."; - case -1074396133: - return "Could not execute the function in the separate thread because the thread could not initialize."; - case -1074396132: - return "The mask must be the same size as the template."; - case -1074396130: - return "The ROI must only have either a single Rectangle contour or a single Rotated Rectangle contour."; - case -1074396129: - return "During timed execution, you must use the preallocated version of this operation."; - case -1074396128: - return "An image being modified by one process cannot be requested by another process while a time limit is active."; - case -1074396127: - return "An image with pattern matching, calibration, or overlay information cannot be manipulated while a time limit is active."; - case -1074396126: - return "An image created before a time limit is started cannot be resized while a time limit is active."; - case -1074396125: - return "Invalid contrast threshold. The threshold value must be greater than 0. "; - case -1074396124: - return "NI Vision does not support the calibration ROI mode you supplied."; - case -1074396123: - return "NI Vision does not support the calibration mode you supplied."; - case -1074396122: - return "Set the foreground and background text colors to grayscale to draw on a U8 image."; - case -1074396121: - return "The value of the saturation threshold must be from 0 to 255."; - case -1074396120: - return "Not an image."; - case -1074396119: - return "They custom data key you supplied is invalid. The only valid character values are decimal 32-126 and 161-255. There must also be no repeated, leading, or trailing spaces."; - case -1074396118: - return "Step size must be greater than zero."; - case -1074396117: - return "Invalid matrix size in the structuring element."; - case -1074396116: - return "Insufficient number of calibration feature points."; - case -1074396115: - return "The operation is invalid in a corrected image."; - case -1074396114: - return "The ROI contains an invalid contour type or is not contained in the ROI learned for calibration."; - case -1074396113: - return "The source/input image has not been calibrated."; - case -1074396112: - return "The number of pixel and real-world coordinates must be equal."; - case -1074396111: - return "Unable to automatically detect grid because the image is too distorted."; - case -1074396110: - return "Invalid calibration information version."; - case -1074396109: - return "Invalid calibration scaling factor."; - case -1074396108: - return "The calibration error map cannot be computed."; - case -1074396107: - return "Invalid calibration template image."; - case -1074396106: - return "Invalid calibration template image."; - case -1074396105: - return "Invalid calibration template image."; - case -1074396104: - return "Invalid calibration template image."; - case -1074396103: - return "Invalid calibration template image."; - case -1074396102: - return "Invalid calibration template image."; - case -1074396101: - return "Invalid calibration template image."; - case -1074396100: - return "Invalid calibration template image."; - case -1074396099: - return "Invalid calibration template image."; - case -1074396098: - return "You must pass NULL for the reserved parameter."; - case -1074396097: - return "You entered an invalid selection in the particle parameter."; - case -1074396096: - return "Not an object."; - case -1074396095: - return "The reference points passed are inconsistent. At least two similar pixel coordinates correspond to different real-world coordinates."; - case -1074396094: - return "A resource conflict occurred in the timed environment. Two processes cannot manage the same resource and be time bounded."; - case -1074396093: - return "A resource conflict occurred in the timed environment. Two processes cannot access the same resource and be time bounded."; - case -1074396092: - return "Multiple timed environments are not supported."; - case -1074396091: - return "A time limit cannot be started until the timed environment is initialized."; - case -1074396090: - return "Multiple timed environments are not supported."; - case -1074396089: - return "The timed environment is already initialized."; - case -1074396088: - return "The results of the operation exceeded the size limits on the output data arrays."; - case -1074396087: - return "No time limit is available to stop."; - case -1074396086: - return "A time limit could not be set."; - case -1074396085: - return "The timed environment could not be initialized."; - case -1074396084: - return "No initialized timed environment is available to close."; - case -1074396083: - return "The time limit has expired."; - case -1074396082: - return "Only 8-bit images support the use of palettes. Either do not use a palette, or convert your image to an 8-bit image before using a palette."; - case -1074396081: - return "Incorrect password."; - case -1074396080: - return "Invalid image type."; - case -1074396079: - return "Invalid metafile handle."; - case -1074396077: - return "Incompatible image type."; - case -1074396076: - return "Unable to fit a line for the primary axis."; - case -1074396075: - return "Unable to fit a line for the secondary axis."; - case -1074396074: - return "Incompatible image size."; - case -1074396073: - return "When the mask's offset was applied, the mask was entirely outside of the image."; - case -1074396072: - return "Invalid image border."; - case -1074396071: - return "Invalid scan direction."; - case -1074396070: - return "Unsupported function."; - case -1074396069: - return "NI Vision does not support the color mode you specified."; - case -1074396068: - return "The function does not support the requested action."; - case -1074396067: - return "The source image and destination image must be different."; - case -1074396066: - return "Invalid point symbol."; - case -1074396065: - return "Cannot resize an image in an acquisition buffer."; - case -1074396064: - return "This operation is not supported for images in an acquisition buffer."; - case -1074396063: - return "The external buffer must be aligned on a 4-byte boundary. The line width and border pixels must be 4-byte aligned, as well."; - case -1074396062: - return "The tolerance parameter must be greater than or equal to 0."; - case -1074396061: - return "The size of each dimension of the window must be greater than 2 and less than or equal to the size of the image in the corresponding dimension."; - case -1074396060: - return "Lossless compression cannot be used with the floating point wavelet transform mode. Either set the wavelet transform mode to integer, or use lossy compression."; - case -1074396059: - return "Invalid maximum number of iterations. Maximum number of iterations must be greater than zero."; - case -1074396058: - return "Invalid rotation mode."; - case -1074396057: - return "Invalid search vector width. The width must be an odd number greater than zero."; - case -1074396056: - return "Invalid matrix mirror mode."; - case -1074396055: - return "Invalid aspect ratio. Valid aspect ratios must be greater than or equal to zero."; - case -1074396054: - return "Invalid cell fill type."; - case -1074396053: - return "Invalid border integrity. Valid values range from 0 to 100."; - case -1074396052: - return "Invalid demodulation mode."; - case -1074396051: - return "Invalid cell filter mode."; - case -1074396050: - return "Invalid ECC type."; - case -1074396049: - return "Invalid matrix polarity."; - case -1074396048: - return "Invalid cell sample size."; - case -1074396047: - return "Invalid linear average mode."; - case -1074396046: - return "When using a region of interest that is not a rectangle, you must specify the contrast mode of the barcode as either black on white or white on black."; - case -1074396045: - return "Invalid 2-D barcode Data Matrix subtype."; - case -1074396044: - return "Invalid 2-D barcode shape."; - case -1074396043: - return "Invalid 2-D barcode cell shape."; - case -1074396042: - return "Invalid 2-D barcode contrast."; - case -1074396041: - return "Invalid 2-D barcode type."; - case -1074396040: - return "Cannot access NI-IMAQ driver."; - case -1074396039: - return "I/O error."; - case -1074396038: - return "When searching for a coordinate system, the number of lines to fit must be 1."; - case -1074396037: - return "Trigger timeout."; - case -1074396036: - return "The Skeleton mode you specified is invalid."; - case -1074396035: - return "The template image does not contain enough information for learning the aggressive search strategy."; - case -1074396034: - return "The template image does not contain enough edge information for the sample size(s) requested."; - case -1074396033: - return "Invalid template descriptor."; - case -1074396032: - return "The template descriptor does not contain data required for the requested search strategy in rotation-invariant matching."; - case -1074396026: - return "Invalid process type for edge detection."; - case -1074396025: - return "Angle range value should be equal to or greater than zero."; - case -1074396024: - return "Minimum coverage value should be greater than zero."; - case -1074396023: - return "The angle tolerance should be equal to or greater than 0.001."; - case -1074396022: - return "Invalid search mode for detecting straight edges"; - case -1074396021: - return "Invalid kernel size for edge detection. The minimum kernel size is 3, the maximum kernel size is 1073741823 and the kernel size must be odd."; - case -1074396020: - return "Invalid grading mode."; - case -1074396019: - return "Invalid threshold percentage. Valid values range from 0 to 100."; - case -1074396018: - return "Invalid edge polarity search mode."; - case -1074396017: - return "The AIM grading data attached to the image you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case -1074396016: - return "No video driver is installed."; - case -1074396015: - return "Unable to establish network connection with remote system."; - case -1074396014: - return "RT Video Out does not support displaying the supplied image type at the selected color depth."; - case -1074396013: - return "Invalid video mode."; - case -1074396012: - return "Unable to display remote image on network connection."; - case -1074396011: - return "Unable to establish network connection."; - case -1074396010: - return "Invalid frame number."; - case -1074396009: - return "An internal DirectX error has occurred. Try upgrading to the latest version of DirectX."; - case -1074396008: - return "An appropriate DirectX filter to process this file could not be found. Install the filter that was used to create this AVI. Upgrading to the latest version of DirectX may correct this error. NI Vision requires DirectX 8.1 or higher."; - case -1074396007: - return "Incompatible compression filter."; - case -1074396006: - return "Unknown compression filter."; - case -1074396005: - return "Invalid AVI session."; - case -1074396004: - return "A software key is restricting the use of this compression filter."; - case -1074396003: - return "The data for this frame exceeds the data buffer size specified when creating the AVI file."; - case -1074396002: - return "Invalid line gauge method."; - case -1074396001: - return "There are too many AVI sessions open. You must close a session before you can open another one."; - case -1074396000: - return "Invalid file header."; - case -1074395999: - return "Invalid file type."; - case -1074395998: - return "Invalid color table."; - case -1074395997: - return "Invalid parameter."; - case -1074395996: - return "File is already open for writing."; - case -1074395995: - return "File not found."; - case -1074395994: - return "Too many files open."; - case -1074395993: - return "File I/O error."; - case -1074395992: - return "File access denied."; - case -1074395991: - return "NI Vision does not support the file type you specified."; - case -1074395990: - return "Could not read Vision info from file."; - case -1074395989: - return "Unable to read data."; - case -1074395988: - return "Unable to write data."; - case -1074395987: - return "Premature end of file."; - case -1074395986: - return "Invalid file format."; - case -1074395985: - return "Invalid file operation."; - case -1074395984: - return "NI Vision does not support the file data type you specified."; - case -1074395983: - return "Disk full."; - case -1074395982: - return "The frames per second in an AVI must be greater than zero."; - case -1074395981: - return "The buffer that was passed in is not big enough to hold all of the data."; - case -1074395980: - return "Error initializing COM."; - case -1074395979: - return "The image has invalid particle information. Call imaqCountParticles on the image to create particle information."; - case -1074395978: - return "Invalid particle number."; - case -1074395977: - return "The AVI file was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this AVI file."; - case -1074395976: - return "The color palette must have exactly 0 or 256 entries."; - case -1074395975: - return "DirectX has timed out reading or writing the AVI file. When closing an AVI file, try adding an additional delay. When reading an AVI file, try reducing CPU and disk load."; - case -1074395974: - return "NI Vision does not support reading JPEG2000 files with this colorspace method."; - case -1074395973: - return "NI Vision does not support reading JPEG2000 files with more than one layer."; - case -1074395972: - return "DirectX is unable to enumerate the compression filters. This is caused by a third-party compression filter that is either improperly installed or is preventing itself from being enumerated. Remove any recently installed compression filters and try again."; - case -1074395971: - return "The offset you specified must be size 2."; - case -1074395960: - return "Initialization error."; - case -1074395959: - return "Unable to create window."; - case -1074395958: - return "Invalid window ID."; - case -1074395957: - return "The array sizes are not compatible."; - case -1074395956: - return "The quality you provided is invalid. Valid quality values range from -1 to 1000."; - case -1074395955: - return "Invalid maximum wavelet transform level. Valid values range from 0 to 255."; - case -1074395954: - return "The quantization step size must be greater than or equal to 0."; - case -1074395953: - return "Invalid wavelet transform mode."; - case -1074395920: - return "Invalid number of classes."; - case -1074395880: - return "Invalid particle."; - case -1074395879: - return "Invalid measure number."; - case -1074395878: - return "The ImageBase Display control does not support writing this property node."; - case -1074395877: - return "The specified color mode requires the use of imaqChangeColorSpace2."; - case -1074395876: - return "This function does not currently support the color mode you specified."; - case -1074395875: - return "The barcode is not a valid Pharmacode symbol"; - case -1074395840: - return "Invalid handle table index."; - case -1074395837: - return "The compression ratio must be greater than or equal to 1."; - case -1074395801: - return "The ROI contains too many contours."; - case -1074395800: - return "Protection error."; - case -1074395799: - return "Internal error."; - case -1074395798: - return "The size of the feature vector in the custom sample must match the size of those you have already added."; - case -1074395797: - return "Not a valid classifier session."; - case -1074395796: - return "You requested an invalid Nearest Neighbor classifier method."; - case -1074395795: - return "The k parameter must be greater than two."; - case -1074395794: - return "The k parameter must be <= the number of samples in each class."; - case -1074395793: - return "This classifier session is compact. Only the Classify and Dispose functions may be called on a compact classifier session."; - case -1074395792: - return "This classifier session is not trained. You may only call this function on a trained classifier session."; - case -1074395791: - return "This classifier function cannot be called on this type of classifier session."; - case -1074395790: - return "You requested an invalid distance metric."; - case -1074395789: - return "The classifier session you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case -1074395788: - return "This operation cannot be performed because you have not added any samples."; - case -1074395787: - return "You requested an invalid classifier type."; - case -1074395786: - return "The sum of Scale Dependence and Symmetry Dependence must be less than 1000."; - case -1074395785: - return "The image yielded no particles."; - case -1074395784: - return "The limits you supplied are not valid."; - case -1074395783: - return "The Sample Index fell outside the range of Samples."; - case -1074395782: - return "The description must be <= 255 characters."; - case -1074395781: - return "The engine for this classifier session does not support this operation."; - case -1074395780: - return "You requested an invalid particle type."; - case -1074395779: - return "You may only save a session in compact form if it is trained."; - case -1074395778: - return "The Kernel size must be smaller than the image size."; - case -1074395777: - return "The session you read from file must be the same type as the session you passed in."; - case -1074395776: - return "You can not use a compact classification file with read options other than Read All."; - case -1074395775: - return "The ROI you passed in may only contain closed contours."; - case -1074395774: - return "You must pass in a label."; - case -1074395773: - return "You must provide a destination image."; - case -1074395772: - return "You provided an invalid registration method."; - case -1074395771: - return "The golden template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case -1074395770: - return "Invalid golden template."; - case -1074395769: - return "Edge Thickness to Ignore must be greater than zero."; - case -1074395768: - return "Scale must be greater than zero."; - case -1074395767: - return "The supplied scale is invalid for your template."; - case -1074395766: - return "This backwards-compatibility function can not be used with this session. Use newer, supported functions instead."; - case -1074395763: - return "You must provide a valid normalization method."; - case -1074395762: - return "The deviation factor for Niblack local threshold must be between 0 and 1."; - case -1074395760: - return "Board not found."; - case -1074395758: - return "Board not opened."; - case -1074395757: - return "DLL not found."; - case -1074395756: - return "DLL function not found."; - case -1074395754: - return "Trigger timeout."; - case -1074395728: - return "NI Vision does not support the search mode you provided."; - case -1074395727: - return "NI Vision does not support the search mode you provided for the type of 2D barcode for which you are searching."; - case -1074395726: - return "matchFactor has been obsoleted. Instead, set the initialMatchListLength and matchListReductionFactor in the MatchPatternAdvancedOptions structure."; - case -1074395725: - return "The data was stored with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this data."; - case -1074395724: - return "The size you specified is out of the valid range."; - case -1074395723: - return "The key you specified cannot be found in the image."; - case -1074395722: - return "Custom classifier sessions only classify feature vectors. They do not support classifying images."; - case -1074395721: - return "NI Vision does not support the bit depth you supplied for the image you supplied."; - case -1074395720: - return "Invalid ROI."; - case -1074395719: - return "Invalid ROI global rectangle."; - case -1074395718: - return "The version of LabVIEW or BridgeVIEW you are running does not support this operation."; - case -1074395717: - return "The range you supplied is invalid."; - case -1074395716: - return "NI Vision does not support the scaling method you provided."; - case -1074395715: - return "NI Vision does not support the calibration unit you supplied."; - case -1074395714: - return "NI Vision does not support the axis orientation you supplied."; - case -1074395713: - return "Value not in enumeration."; - case -1074395712: - return "You selected a region that is not of the right type."; - case -1074395711: - return "You specified a viewer that does not contain enough regions."; - case -1074395710: - return "The image has too many particles for this process."; - case -1074395709: - return "The AVI session has not been opened."; - case -1074395708: - return "The AVI session is a write session, but this operation requires a read session."; - case -1074395707: - return "The AVI session is a read session, but this operation requires a write session."; - case -1074395706: - return "This AVI session is already open. You must close it before calling the Create or Open functions."; - case -1074395705: - return "The data is corrupted and cannot be read."; - case -1074395704: - return "Invalid compression type."; - case -1074395703: - return "Invalid type of flatten."; - case -1074395702: - return "The length of the edge detection line must be greater than zero."; - case -1074395701: - return "The maximum Data Matrix barcode size must be equal to or greater than the minimum Data Matrix barcode size."; - case -1074395700: - return "The function requires the operating system to be Microsoft Windows 2000 or newer."; - case -1074395656: - return "You must specify the same value for the smooth contours advanced match option for all templates you want to match."; - case -1074395655: - return "You must specify the same value for the enable calibration support advanced match option for all templates you want to match."; - case -1074395654: - return "The source image does not contain grading information. You must prepare the source image for grading when reading the Data Matrix, and you cannot change the contents of the source image between reading and grading the Data Matrix."; - case -1074395653: - return "The multiple geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case -1074395652: - return "The geometric matching template you tried to open was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to read this file."; - case -1074395651: - return "You must specify the same edge filter size for all the templates you want to match."; - case -1074395650: - return "You must specify the same curve extraction mode for all the templates you want to match."; - case -1074395649: - return "The geometric feature type specified is invalid."; - case -1074395648: - return "You supplied a template that was not learned."; - case -1074395647: - return "Invalid multiple geometric template."; - case -1074395646: - return "Need at least one template to learn."; - case -1074395645: - return "You supplied an invalid number of labels."; - case -1074395644: - return "Labels must be <= 255 characters."; - case -1074395643: - return "You supplied an invalid number of match options."; - case -1074395642: - return "Cannot find a label that matches the one you specified."; - case -1074395641: - return "Duplicate labels are not allowed."; - case -1074395640: - return "The number of zones found exceeded the capacity of the algorithm."; - case -1074395639: - return "The hatch style for the window background is invalid."; - case -1074395638: - return "The fill style for the window background is invalid."; - case -1074395637: - return "Your hardware is not supported by DirectX and cannot be put into NonTearing mode."; - case -1074395636: - return "DirectX is required for this feature. Please install the latest version.."; - case -1074395635: - return "The passed shape descriptor is invalid."; - case -1074395634: - return "Invalid max match overlap. Values must be between -1 and 100."; - case -1074395633: - return "Invalid minimum match separation scale. Values must be greater than or equal to -1."; - case -1074395632: - return "Invalid minimum match separation angle. Values must be between -1 and 360."; - case -1074395631: - return "Invalid minimum match separation distance. Values must be greater than or equal to -1."; - case -1074395630: - return "Invalid maximum number of features learn. Values must be integers greater than zero."; - case -1074395629: - return "Invalid maximum pixel distance from line. Values must be positive real numbers."; - case -1074395628: - return "Invalid geometric matching template image."; - case -1074395627: - return "The template does not contain enough features for geometric matching."; - case -1074395626: - return "The template does not contain enough features for geometric matching."; - case -1074395625: - return "You specified an invalid value for the match constraint value of the range settings."; - case -1074395624: - return "Invalid occlusion range. Valid values for the bounds range from 0 to 100 and the upper bound must be greater than or equal to the lower bound."; - case -1074395623: - return "Invalid scale range. Values for the lower bound must be a positive real numbers and the upper bound must be greater than or equal to the lower bound."; - case -1074395622: - return "Invalid match geometric pattern setup data."; - case -1074395621: - return "Invalid learn geometric pattern setup data."; - case -1074395620: - return "Invalid curve extraction mode."; - case -1074395619: - return "You can specify only one occlusion range."; - case -1074395618: - return "You can specify only one scale range."; - case -1074395617: - return "The minimum number of features must be less than or equal to the maximum number of features."; - case -1074395616: - return "Invalid edge filter size."; - case -1074395615: - return "Invalid minimum strength for features. Values must be positive real numbers."; - case -1074395614: - return "Invalid aspect ratio for rectangular features. Values must be positive real numbers in the range 0.01 to 1.0."; - case -1074395613: - return "Invalid minimum length for linear features. Values must be integers greater than 0."; - case -1074395612: - return "Invalid minimum radius for circular features. Values must be integers greater than 0."; - case -1074395611: - return "Invalid minimum rectangle dimension. Values must be integers greater than 0."; - case -1074395610: - return "Invalid initial match list length. Values must be integers greater than 5."; - case -1074395609: - return "Invalid subpixel tolerance. Values must be positive real numbers."; - case -1074395608: - return "Invalid number of subpixel iterations. Values must be integers greater 10."; - case -1074395607: - return "Invalid maximum number of features used per match. Values must be integers greater than or equal to zero."; - case -1074395606: - return "Invalid minimum number of features used for matching. Values must be integers greater than zero."; - case -1074395605: - return "Invalid maximum end point gap. Valid values range from 0 to 32767."; - case -1074395604: - return "Invalid column step. Valid range is 1 to 255."; - case -1074395603: - return "Invalid row step. Valid range is 1 to 255."; - case -1074395602: - return "Invalid minimum length. Valid values must be greater than or equal to zero."; - case -1074395601: - return "Invalid edge threshold. Valid values range from 1 to 360."; - case -1074395600: - return "You must provide information about the subimage within the browser."; - case -1074395598: - return "The acceptance level is outside the valid range of 0 to 1000."; - case -1074395597: - return "Not a valid OCR session."; - case -1074395596: - return "Invalid character size. Character size must be >= 1."; - case -1074395595: - return "Invalid threshold mode value."; - case -1074395594: - return "Invalid substitution character. Valid substitution characters are ASCII values that range from 1 to 254."; - case -1074395593: - return "Invalid number of blocks. Number of blocks must be >= 4 and <= 50."; - case -1074395592: - return "Invalid read strategy."; - case -1074395591: - return "Invalid character index."; - case -1074395590: - return "Invalid number of character positions. Valid values range from 0 to 255."; - case -1074395589: - return "Invalid low threshold value. Valid threshold values range from 0 to 255."; - case -1074395588: - return "Invalid high threshold value. Valid threshold values range from 0 to 255."; - case -1074395587: - return "The low threshold must be less than the high threshold."; - case -1074395586: - return "Invalid lower threshold limit. Valid lower threshold limits range from 0 to 255."; - case -1074395585: - return "Invalid upper threshold limit. Valid upper threshold limits range from 0 to 255."; - case -1074395584: - return "The lower threshold limit must be less than the upper threshold limit."; - case -1074395583: - return "Invalid minimum character spacing value. Character spacing must be >= 0 pixels."; - case -1074395582: - return "Invalid maximum horizontal element spacing value. Maximum horizontal element spacing must be >= 0."; - case -1074395581: - return "Invalid maximum vertical element spacing value. Maximum vertical element spacing must be >= 0."; - case -1074395580: - return "Invalid minimum bounding rectangle width. Minimum bounding rectangle width must be >= 1."; - case -1074395579: - return "Invalid aspect ratio value. The aspect ratio must be zero or >= 100."; - case -1074395578: - return "Invalid or corrupt character set file."; - case -1074395577: - return "The character value must not be an empty string."; - case -1074395576: - return "Character values must be <=255 characters."; - case -1074395575: - return "Invalid number of erosions. The number of erosions must be >= 0."; - case -1074395574: - return "The character set description must be <=255 characters."; - case -1074395573: - return "The character set file was created by a newer version of NI Vision. Upgrade to the latest version of NI Vision to read the character set file."; - case -1074395572: - return "You must specify characters for a string. A string cannot contain integers."; - case -1074395571: - return "This attribute is read-only."; - case -1074395570: - return "This attribute requires a Boolean value."; - case -1074395569: - return "Invalid attribute."; - case -1074395568: - return "This attribute requires integer values."; - case -1074395567: - return "String values are invalid for this attribute. Enter a boolean value."; - case -1074395566: - return "Boolean values are not valid for this attribute. Enter an integer value."; - case -1074395565: - return "Requires a single-character string."; - case -1074395564: - return "Invalid predefined character value."; - case -1074395563: - return "This copy of NI OCR is unlicensed."; - case -1074395562: - return "String values are not valid for this attribute. Enter a Boolean value."; - case -1074395561: - return "The number of characters in the character value must match the number of objects in the image."; - case -1074395560: - return "Invalid object index."; - case -1074395559: - return "Invalid read option."; - case -1074395558: - return "The minimum character size must be less than the maximum character size."; - case -1074395557: - return "The minimum character bounding rectangle width must be less than the maximum character bounding rectangle width."; - case -1074395556: - return "The minimum character bounding rectangle height must be less than the maximum character bounding rectangle height."; - case -1074395555: - return "The maximum horizontal element spacing value must not exceed the minimum character spacing value."; - case -1074395554: - return "Invalid read resolution."; - case -1074395553: - return "Invalid minimum bounding rectangle height. The minimum bounding rectangle height must be >= 1."; - case -1074395552: - return "Not a valid character set."; - case -1074395551: - return "A trained OCR character cannot be renamed while it is a reference character."; - case -1074395550: - return "A character cannot have an ASCII value of 255."; - case -1074395549: - return "The number of objects found does not match the number of expected characters or patterns to verify."; - case -1074395410: - return "NI Vision does not support less than one icon per line."; - case -1074395409: - return "Invalid subpixel divisions."; - case -1074395408: - return "Invalid detection mode."; - case -1074395407: - return "Invalid contrast value. Valid contrast values range from 0 to 255."; - case -1074395406: - return "The coordinate system could not be found on this image."; - case -1074395405: - return "NI Vision does not support the text orientation value you supplied."; - case -1074395404: - return "UnwrapImage does not support the interpolation method value you supplied. Valid interpolation methods are zero order and bilinear. "; - case -1074395403: - return "The image was created in a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this image."; - case -1074395402: - return "The function does not support the maximum number of points that you specified."; - case -1074395401: - return "The function does not support the matchFactor that you specified."; - case -1074395400: - return "The operation you have given Multicore Options is invalid. Please see the available enumeration values for Multicore Operation."; - case -1074395399: - return "You have given Multicore Options an invalid argument."; - case -1074395397: - return "A complex image is required."; - case -1074395395: - return "The input image must be a color image."; - case -1074395394: - return "The color mask removes too much color information."; - case -1074395393: - return "The color template image is too small."; - case -1074395392: - return "The color template image is too large."; - case -1074395391: - return "The contrast in the hue plane of the image is too low for learning shape features."; - case -1074395390: - return "The contrast in the luminance plane of the image is too low to learn shape features."; - case -1074395389: - return "Invalid color learn setup data."; - case -1074395388: - return "Invalid color learn setup data."; - case -1074395387: - return "Invalid color match setup data."; - case -1074395386: - return "Invalid color match setup data."; - case -1074395385: - return "Rotation-invariant color pattern matching requires a feature mode including shape."; - case -1074395384: - return "Invalid color template image."; - case -1074395383: - return "Invalid color template image."; - case -1074395382: - return "Invalid color template image."; - case -1074395381: - return "Invalid color template image."; - case -1074395380: - return "Invalid color template image."; - case -1074395379: - return "Invalid color template image."; - case -1074395378: - return "Invalid color template image."; - case -1074395377: - return "Invalid color template image."; - case -1074395376: - return "The color template image does not contain data required for shift-invariant color matching."; - case -1074395375: - return "Invalid color template image."; - case -1074395374: - return "Invalid color template image."; - case -1074395373: - return "Invalid color template image."; - case -1074395372: - return "The color template image does not contain data required for rotation-invariant color matching."; - case -1074395371: - return "Invalid color template image."; - case -1074395370: - return "Invalid color template image."; - case -1074395369: - return "Invalid color template image."; - case -1074395368: - return "Invalid color template image."; - case -1074395367: - return "Invalid color template image."; - case -1074395366: - return "The color template image does not contain data required for color matching in shape feature mode."; - case -1074395365: - return "The color template image does not contain data required for color matching in color feature mode."; - case -1074395364: - return "The ignore color spectra array is invalid."; - case -1074395363: - return "Invalid subsampling ratio."; - case -1074395362: - return "Invalid pixel width."; - case -1074395361: - return "Invalid steepness."; - case -1074395360: - return "Invalid complex plane."; - case -1074395357: - return "Invalid color ignore mode."; - case -1074395356: - return "Invalid minimum match score. Acceptable values range from 0 to 1000."; - case -1074395355: - return "Invalid number of matches requested. You must request a minimum of one match."; - case -1074395354: - return "Invalid color weight. Acceptable values range from 0 to 1000."; - case -1074395353: - return "Invalid search strategy."; - case -1074395352: - return "Invalid feature mode."; - case -1074395351: - return "NI Vision does not support rectangles with negative widths or negative heights."; - case -1074395350: - return "NI Vision does not support the vision information type you supplied."; - case -1074395349: - return "NI Vision does not support the SkeletonMethod value you supplied."; - case -1074395348: - return "NI Vision does not support the 3DPlane value you supplied."; - case -1074395347: - return "NI Vision does not support the 3DDirection value you supplied."; - case -1074395346: - return "imaqRotate does not support the InterpolationMethod value you supplied."; - case -1074395345: - return "NI Vision does not support the axis of symmetry you supplied."; - case -1074395343: - return "You must pass a valid file name. Do not pass in NULL."; - case -1074395340: - return "NI Vision does not support the SizeType value you supplied."; - case -1074395336: - return "You specified the dispatch status of an unknown algorithm."; - case -1074395335: - return "You are attempting to set the same algorithm to dispatch and to not dispatch. Remove one of the conflicting settings."; - case -1074395334: - return "NI Vision does not support the Conversion Method value you supplied."; - case -1074395333: - return "NI Vision does not support the VerticalTextAlignment value you supplied."; - case -1074395332: - return "NI Vision does not support the CompareFunction value you supplied."; - case -1074395331: - return "NI Vision does not support the BorderMethod value you supplied."; - case -1074395330: - return "Invalid border size. Acceptable values range from 0 to 50."; - case -1074395329: - return "NI Vision does not support the OutlineMethod value you supplied."; - case -1074395328: - return "NI Vision does not support the InterpolationMethod value you supplied."; - case -1074395327: - return "NI Vision does not support the ScalingMode value you supplied."; - case -1074395326: - return "imaqDrawLineOnImage does not support the DrawMode value you supplied."; - case -1074395325: - return "NI Vision does not support the DrawMode value you supplied."; - case -1074395324: - return "NI Vision does not support the ShapeMode value you supplied."; - case -1074395323: - return "NI Vision does not support the FontColor value you supplied."; - case -1074395322: - return "NI Vision does not support the TextAlignment value you supplied."; - case -1074395321: - return "NI Vision does not support the MorphologyMethod value you supplied."; - case -1074395320: - return "The template image is empty."; - case -1074395319: - return "NI Vision does not support the interpolation type you supplied."; - case -1074395318: - return "You supplied an insufficient number of points to perform this operation."; - case -1074395317: - return "You specified a point that lies outside the image."; - case -1074395316: - return "Invalid kernel code."; - case -1074395313: - return "Writing files is not supported on this device."; - case -1074395312: - return "The input image does not seem to be a valid LCD or LED calibration image."; - case -1074395311: - return "The color spectrum array you provided does not contain enough elements or contains an element set to not-a-number (NaN)."; - case -1074395310: - return "NI Vision does not support the PaletteType value you supplied."; - case -1074395309: - return "NI Vision does not support the WindowThreadPolicy value you supplied."; - case -1074395308: - return "NI Vision does not support the ColorSensitivity value you supplied."; - case -1074395307: - return "The precision parameter must be greater than 0."; - case -1074395306: - return "NI Vision does not support the Tool value you supplied."; - case -1074395305: - return "NI Vision does not support the ReferenceMode value you supplied."; - case -1074395304: - return "NI Vision does not support the MathTransformMethod value you supplied."; - case -1074395303: - return "Invalid number of classes for auto threshold. Acceptable values range from 2 to 256."; - case -1074395302: - return "NI Vision does not support the threshold method value you supplied."; - case -1074395301: - return "The ROI you passed into imaqGetMeterArc must consist of two lines."; - case -1074395300: - return "NI Vision does not support the MeterArcMode value you supplied."; - case -1074395299: - return "NI Vision does not support the ComplexPlane value you supplied."; - case -1074395298: - return "You can perform this operation on a real or an imaginary ComplexPlane only."; - case -1074395297: - return "NI Vision does not support the ParticleInfoMode value you supplied."; - case -1074395296: - return "NI Vision does not support the BarcodeType value you supplied."; - case -1074395295: - return "imaqInterpolatePoints does not support the InterpolationMethod value you supplied."; - case -1074395294: - return "The contour index you supplied is larger than the number of contours in the ROI."; - case -1074395293: - return "The supplied ContourID did not correlate to a contour inside the ROI."; - case -1074395292: - return "Do not supply collinear points for this operation."; - case -1074395291: - return "Shape Match requires the image to contain only pixel values of 0 or 1."; - case -1074395290: - return "The template you supplied for ShapeMatch contains no shape information."; - case -1074395287: - return "The line you provided contains two identical points, or one of the coordinate locations for the line is not a number (NaN)."; - case -1074395286: - return "Invalid concentric rake direction."; - case -1074395285: - return "Invalid spoke direction."; - case -1074395284: - return "Invalid edge process."; - case -1074395283: - return "Invalid rake direction."; - case -1074395282: - return "Unable to draw to viewer. You must have the latest version of the control."; - case -1074395281: - return "Your image must be larger than its border size for this operation."; - case -1074395280: - return "The ROI must only have a single Rectangle contour."; - case -1074395279: - return "ROI is not a polygon."; - case -1074395278: - return "LCD image is not a number."; - case -1074395277: - return "The decoded barcode information did not pass the checksum test."; - case -1074395276: - return "You specified parallel lines for the meter ROI."; - case -1074395275: - return "Invalid browser image."; - case -1074395270: - return "Cannot divide by zero."; - case -1074395269: - return "Null pointer."; - case -1074395268: - return "The linear equations are not independent."; - case -1074395267: - return "The roots of the equation are complex."; - case -1074395265: - return "The barcode does not match the type you specified."; - case -1074395263: - return "No lit segment."; - case -1074395262: - return "The LCD does not form a known digit."; - case -1074395261: - return "An internal error occurred while attempting to access an invalid coordinate on an image."; - case -1074395260: - return "An internal memory error occurred."; - case -1074395258: - return "The filter width must be odd for the Canny operator."; - case -1074395257: - return "You supplied an invalid edge direction in the Canny operator."; - case -1074395256: - return "The window size must be odd for the Canny operator. "; - case -1074395253: - return "Invalid learn mode."; - case -1074395252: - return "Invalid learn setup data."; - case -1074395251: - return "Invalid match mode."; - case -1074395250: - return "Invalid match setup data."; - case -1074395249: - return "At least one range in the array of rotation angle ranges exceeds 360 degrees."; - case -1074395248: - return "The array of rotation angle ranges contains too many ranges."; - case -1074395247: - return "Invalid template descriptor."; - case -1074395246: - return "Invalid template descriptor."; - case -1074395245: - return "Invalid template descriptor."; - case -1074395244: - return "Invalid template descriptor."; - case -1074395243: - return "The template descriptor was created with a newer version of NI Vision. Upgrade to the latest version of NI Vision to use this template."; - case -1074395242: - return "Invalid template descriptor."; - case -1074395241: - return "The template descriptor does not contain data required for rotation-invariant matching."; - case -1074395240: - return "Invalid template descriptor."; - case -1074395239: - return "Invalid template descriptor."; - case -1074395238: - return "The template descriptor does not contain data required for shift-invariant matching."; - case -1074395237: - return "Invalid template descriptor."; - case -1074395235: - return "The template image does not contain enough contrast."; - case -1074395234: - return "The template image is too small."; - case -1074395233: - return "The template image is too large."; - case -1074395212: - return "The size of the template string must match the size of the string you are trying to correct."; - case -1074395211: - return "The supplied text template contains nonstandard characters that cannot be generated by OCR."; - case -1074395210: - return "At least one character in the text template was of a lexical class that did not match the supplied character reports."; - case -1074395203: - return "The OCR library cannot be initialized correctly."; - case -1074395201: - return "There was a failure when loading one of the internal OCR engine or LabView libraries."; - case -1074395200: - return "One of the parameters supplied to the OCR function that generated this error is invalid."; - case -1074395179: - return "The OCR engine failed during the preprocessing stage."; - case -1074395178: - return "The OCR engine failed during the recognition stage."; - case -1074395175: - return "The provided filename is not valid user dictionary filename."; - case -1074395174: - return "NI Vision does not support the AutoOrientMode value you supplied."; - case -1074395173: - return "NI Vision does not support the Language value you supplied."; - case -1074395172: - return "NI Vision does not support the CharacterSet value you supplied."; - case -1074395171: - return "The system could not locate the initialization file required for OCR initialization."; - case -1074395170: - return "NI Vision does not support the CharacterType value you supplied."; - case -1074395169: - return "NI Vision does not support the RecognitionMode value you supplied."; - case -1074395168: - return "NI Vision does not support the AutoCorrectionMode value you supplied."; - case -1074395167: - return "NI Vision does not support the OutputDelimiter value you supplied."; - case -1074395166: - return "The system could not locate the OCR binary directory required for OCR initialization."; - case -1074395165: - return "The system could not locate the OCR weights directory required for OCR initialization."; - case -1074395164: - return "The supplied word could not be added to the user dictionary."; - case -1074395163: - return "NI Vision does not support the CharacterPreference value you supplied."; - case -1074395162: - return "NI Vision does not support the CorrectionMethod value you supplied."; - case -1074395161: - return "NI Vision does not support the CorrectionLevel value you supplied."; - case -1074395160: - return "NI Vision does not support the maximum point size you supplied. Valid values range from 4 to 72."; - case -1074395159: - return "NI Vision does not support the tolerance value you supplied. Valid values are non-negative."; - case -1074395158: - return "NI Vision does not support the ContrastMode value you supplied."; - case -1074395156: - return "The OCR attempted to detected the text skew and failed."; - case -1074395155: - return "The OCR attempted to detected the text orientation and failed."; - case -1074395153: - return "Invalid font file format."; - case -1074395152: - return "Font file not found."; - case -1074395151: - return "The OCR engine failed during the correction stage."; - case -1074395150: - return "NI Vision does not support the RoundingMode value you supplied."; - case -1074395149: - return "Found a duplicate transform type in the properties array. Each properties array may only contain one behavior for each transform type."; - case -1074395148: - return "Overlay Group Not Found."; - case -1074395147: - return "The barcode is not a valid RSS Limited symbol"; - case -1074395146: - return "Couldn't determine the correct version of the QR code."; - case -1074395145: - return "Invalid read of the QR code."; - case -1074395144: - return "The barcode that was read contains invalid parameters."; - case -1074395143: - return "The data stream that was demodulated could not be read because the mode was not detected."; - case -1074395142: - return "Couldn't determine the correct model of the QR code."; - case -1074395141: - return "The OCR engine could not find any text in the supplied region."; - case -1074395140: - return "One of the character reports is no longer usable by the system."; - case -1074395139: - return "Invalid Dimensions."; - case -1074395138: - return "The OCR region provided was too small to have contained any characters."; - default: - return "Error code not found"; - } - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ParticleAnalysisReport.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ParticleAnalysisReport.java deleted file mode 100644 index cc3e7901f5..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/ParticleAnalysisReport.java +++ /dev/null @@ -1,140 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; - -/** - * Class to store commonly used information about a particle. - */ -public class ParticleAnalysisReport { - - /** - * The height of the image in pixels. - */ - @SuppressWarnings("membername") - public final int imageHeight; - /** - * The width of the image in pixels. - */ - @SuppressWarnings("membername") - public final int imageWidth; - /** - * X-coordinate of the point representing the average position of the total particle mass, - * assuming every point in the particle has a constant density. - */ - @SuppressWarnings("membername") - public final int center_mass_x; // MeasurementType: IMAQ_MT_CENTER_OF_MASS_X - /** - * Y-coordinate of the point representing the average position of the total particle mass, - * assuming every point in the particle has a constant density. - */ - @SuppressWarnings("membername") - public final int center_mass_y; // MeasurementType: IMAQ_MT_CENTER_OF_MASS_Y - /** - * Center of mass x value normalized to -1.0 to +1.0 range. - */ - @SuppressWarnings("membername") - public final double center_mass_x_normalized; - /** - * Center of mass y value normalized to -1.0 to +1.0 range. - */ - @SuppressWarnings("membername") - public final double center_mass_y_normalized; - /** - * Area of the particle. - */ - @SuppressWarnings("membername") - public final double particleArea; // MeasurementType: IMAQ_MT_AREA - /** - * Bounding Rectangle. - */ - @SuppressWarnings("membername") - public final int boundingRectLeft; // left/top/width/height - /** - * Bounding Rectangle. - */ - @SuppressWarnings("membername") - public final int boundingRectTop; - /** - * Bounding Rectangle. - */ - @SuppressWarnings("membername") - public final int boundingRectWidth; - /** - * Bounding Rectangle. - */ - @SuppressWarnings("membername") - public final int boundingRectHeight; - /** - * Percentage of the particle Area covering the Image Area. - */ - @SuppressWarnings("membername") - public final double particleToImagePercent; // MeasurementType: - // IMAQ_MT_AREA_BY_IMAGE_AREA - /** - * Percentage of the particle Area in relation to its Particle and Holes Area. - */ - @SuppressWarnings("membername") - public final double particleQuality; // MeasurementType: - // IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA - - ParticleAnalysisReport(BinaryImage image, int index) throws NIVisionException { - imageHeight = image.getHeight(); - imageWidth = image.getWidth(); - center_mass_x = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_CENTER_OF_MASS_X); - center_mass_y = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_CENTER_OF_MASS_Y); - center_mass_x_normalized = (2.0 * center_mass_x / imageWidth) - 1.0; - center_mass_y_normalized = (2.0 * center_mass_y / imageHeight) - 1.0; - particleArea = - NIVision.imaqMeasureParticle(image.image, index, 0, NIVision.MeasurementType.MT_AREA); - boundingRectLeft = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT); - boundingRectTop = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_BOUNDING_RECT_TOP); - boundingRectWidth = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH); - boundingRectHeight = - (int) NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_BOUNDING_RECT_HEIGHT); - particleToImagePercent = - NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA); - particleQuality = - NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_AREA_BY_PARTICLE_AND_HOLES_AREA); - } - - static double getParticleToImagePercent(BinaryImage image, int index) throws NIVisionException { - return NIVision.imaqMeasureParticle(image.image, index, 0, - NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA); - } - - /** - * Get string representation of the particle analysis report. - * - * @return A string representation of the particle analysis report. - */ - public String toString() { - return "Particle Report: \n" + " Image Height : " + imageHeight + "\n" - + " Image Width : " + imageWidth + "\n" + " Center of mass : ( " + center_mass_x - + " , " + center_mass_y + " )\n" + " normalized : ( " + center_mass_x_normalized - + " , " + center_mass_y_normalized + " )\n" + " Area : " + particleArea - + "\n" + " percent : " + particleToImagePercent + "\n" - + " Bounding Rect : ( " + boundingRectLeft + " , " + boundingRectTop + " ) " - + boundingRectWidth + "*" + boundingRectHeight + "\n" + " Quality : " - + particleQuality + "\n"; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/RGBImage.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/RGBImage.java deleted file mode 100644 index 7802b5206c..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/RGBImage.java +++ /dev/null @@ -1,37 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.image; - -import com.ni.vision.NIVision; - -/** - * A color image represented in RGB color space at 3 bytes per pixel. - */ -public class RGBImage extends ColorImage { - - /** - * Create a new 0x0 image. - */ - public RGBImage() throws NIVisionException { - super(NIVision.ImageType.IMAGE_RGB); - } - - RGBImage(RGBImage sourceImage) { - super(sourceImage); - } - - /** - * Create a new image by loading a file. - * - * @param fileName The path of the file to load. - */ - public RGBImage(String fileName) throws NIVisionException { - super(NIVision.ImageType.IMAGE_RGB); - NIVision.imaqReadFile(image, fileName); - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/package.html b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/package.html deleted file mode 100644 index 31be4fb546..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/image/package.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Image Processing Wrappers - - - -Provides classes to access National Instrument's nivison library for machine vision enables -automated image processing for color identification, tracking and analysis. The full -specification for the simplified FRC Vision programming interface is in the FRC Vision API -Specification document, which is in the WindRiver\docs\extensions\FRC directory of the Wind River -installation with this document. - - diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/AxisCamera.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/AxisCamera.java deleted file mode 100644 index 5084e62298..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/AxisCamera.java +++ /dev/null @@ -1,550 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.vision; - -import java.io.DataInputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.nio.ByteBuffer; - -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj.image.ColorImage; -import edu.wpi.first.wpilibj.image.HSLImage; -import edu.wpi.first.wpilibj.image.NIVisionException; - -import static com.ni.vision.NIVision.Image; -import static com.ni.vision.NIVision.Priv_ReadJPEGString_C; - -/** - * Axis M1011 network camera. - */ -public class AxisCamera { - public enum WhiteBalance { - kAutomatic, kHold, kFixedOutdoor1, kFixedOutdoor2, kFixedIndoor, kFixedFluorescent1, - kFixedFluorescent2, - } - - public enum ExposureControl { - kAutomatic, kHold, kFlickerFree50Hz, kFlickerFree60Hz, - } - - public enum Resolution { - k640x480, k480x360, k320x240, k240x180, k176x144, k160x120, - } - - public enum Rotation { - k0, k180 - } - - private static final String[] kWhiteBalanceStrings = {"auto", "hold", "fixed_outdoor1", - "fixed_outdoor2", "fixed_indoor", "fixed_fluor1", "fixed_fluor2",}; - - private static final String[] kExposureControlStrings = {"auto", "hold", "flickerfree50", - "flickerfree60",}; - - private static final String[] kResolutionStrings = {"640x480", "480x360", "320x240", "240x180", - "176x144", "160x120",}; - - private static final String[] kRotationStrings = {"0", "180",}; - - private static final int kImageBufferAllocationIncrement = 1000; - - private String m_cameraHost; - private Socket m_cameraSocket; - - private ByteBuffer m_imageData = ByteBuffer.allocate(5000); - private final Object m_imageDataLock = new Object(); - private boolean m_freshImage = false; - - private int m_brightness = 50; - private WhiteBalance m_whiteBalance = WhiteBalance.kAutomatic; - private int m_colorLevel = 50; - private ExposureControl m_exposureControl = ExposureControl.kAutomatic; - private int m_exposurePriority = 50; - private int m_maxFPS = 0; - private Resolution m_resolution = Resolution.k640x480; - private int m_compression = 50; - private Rotation m_rotation = Rotation.k0; - private final Object m_parametersLock = new Object(); - private boolean m_parametersDirty = true; - private boolean m_streamDirty = true; - - private boolean m_done = false; - - /** - * AxisCamera constructor. - * - * @param cameraHost The host to find the camera at, typically an IP address - */ - public AxisCamera(String cameraHost) { - m_cameraHost = cameraHost; - - /* - Thread spawned by AxisCamera constructor to receive images from cam. - */ - final Thread captureThread = new Thread(() -> { - int consecutiveErrors = 0; - - // Loop on trying to setup the camera connection. This happens in a - // background - // thread so it shouldn't effect the operation of user programs. - while (!m_done) { - String requestString = - "GET /mjpg/video.mjpg HTTP/1.1\n" + "User-Agent: HTTPStreamClient\n" - + "Connection: Keep-Alive\n" + "Cache-Control: no-cache\n" - + "Authorization: Basic RlJDOkZSQw==\n\n"; - - try { - m_cameraSocket = AxisCamera.this.createCameraSocket(requestString); - AxisCamera.this.readImagesFromCamera(); - consecutiveErrors = 0; - } catch (IOException ex) { - consecutiveErrors++; - - if (consecutiveErrors > 5) { - ex.printStackTrace(); - } - } - - Timer.delay(0.5); - } - }); - captureThread.start(); - } - - /** - * Return true if the latest image from the camera has not been retrieved by calling GetImage() - * yet. - * - * @return true if the image has not been retrieved yet. - */ - public boolean isFreshImage() { - return m_freshImage; - } - - /** - * Get an image from the camera and store it in the provided image. - * - * @param image The imaq image to store the result in. This must be an HSL or RGB image. - * @return true upon success, false on a failure - */ - public boolean getImage(Image image) { - if (m_imageData.limit() == 0) { - return false; - } - - synchronized (m_imageDataLock) { - Priv_ReadJPEGString_C(image, m_imageData.array()); - } - - m_freshImage = false; - - return true; - } - - /** - * Get an image from the camera and store it in the provided image. - * - * @param image The image to store the result in. This must be an HSL or RGB image - * @return true upon success, false on a failure - */ - public boolean getImage(ColorImage image) { - return this.getImage(image.image); - } - - /** - * Instantiate a new image object and fill it with the latest image from the camera. - * - * @return a pointer to an HSLImage object - */ - public HSLImage getImage() throws NIVisionException { - HSLImage image = new HSLImage(); - this.getImage(image); - return image; - } - - /** - * Request a change in the brightness of the camera images. - * - * @param brightness valid values 0 .. 100 - */ - public void writeBrightness(int brightness) { - if (brightness < 0 || brightness > 100) { - throw new IllegalArgumentException("Brightness must be from 0 to 100"); - } - - synchronized (m_parametersLock) { - if (m_brightness != brightness) { - m_brightness = brightness; - m_parametersDirty = true; - } - } - } - - /** - * The brightness. - * - * @return The configured brightness of the camera images - */ - public int getBrightness() { - synchronized (m_parametersLock) { - return m_brightness; - } - } - - /** - * Request a change in the white balance on the camera. - * - * @param whiteBalance Valid values from the WhiteBalance enum. - */ - public void writeWhiteBalance(WhiteBalance whiteBalance) { - synchronized (m_parametersLock) { - if (m_whiteBalance != whiteBalance) { - m_whiteBalance = whiteBalance; - m_parametersDirty = true; - } - } - } - - /** - * The white balance. - * - * @return The configured white balances of the camera images - */ - public WhiteBalance getWhiteBalance() { - synchronized (m_parametersLock) { - return m_whiteBalance; - } - } - - /** - * Request a change in the color level of the camera images. - * - * @param colorLevel valid values are 0 .. 100 - */ - public void writeColorLevel(int colorLevel) { - if (colorLevel < 0 || colorLevel > 100) { - throw new IllegalArgumentException("Color level must be from 0 to 100"); - } - - synchronized (m_parametersLock) { - if (m_colorLevel != colorLevel) { - m_colorLevel = colorLevel; - m_parametersDirty = true; - } - } - } - - /** - * The current color level. - * - * @return The configured color level of the camera images - */ - public int getColorLevel() { - synchronized (m_parametersLock) { - return m_colorLevel; - } - } - - /** - * Request a change in the camera's exposure mode. - * - * @param exposureControl A mode to write in the Exposure enum. - */ - public void writeExposureControl(ExposureControl exposureControl) { - synchronized (m_parametersLock) { - if (m_exposureControl != exposureControl) { - m_exposureControl = exposureControl; - m_parametersDirty = true; - } - } - } - - /** - * The current exposure control. - * - * @return The configured exposure control mode of the camera - */ - public ExposureControl getExposureControl() { - synchronized (m_parametersLock) { - return m_exposureControl; - } - } - - /** - * Request a change in the exposure priority of the camera. - * - * @param exposurePriority Valid values are 0, 50, 100. 0 = Prioritize image quality 50 = None 100 - * = Prioritize frame rate - */ - public void writeExposurePriority(int exposurePriority) { - if (exposurePriority != 0 && exposurePriority != 50 && exposurePriority != 100) { - throw new IllegalArgumentException("Exposure priority must be 0, 50, or 100"); - } - - synchronized (m_parametersLock) { - if (m_exposurePriority != exposurePriority) { - m_exposurePriority = exposurePriority; - m_parametersDirty = true; - } - } - } - - /** - * Gets the exposure priority. - * - * @return The configured exposure priority of the camera - */ - public int getExposurePriority() { - synchronized (m_parametersLock) { - return m_exposurePriority; - } - } - - /** - * Write the maximum frames per second that the camera should send Write 0 to send as many as - * possible. - * - * @param maxFPS The number of frames the camera should send in a second, exposure permitting. - */ - public void writeMaxFPS(int maxFPS) { - synchronized (m_parametersLock) { - if (m_maxFPS != maxFPS) { - m_maxFPS = maxFPS; - m_parametersDirty = true; - m_streamDirty = true; - } - } - } - - /** - * The max frames per second of the camera. - * - * @return The configured maximum FPS of the camera - */ - public int getMaxFPS() { - synchronized (m_parametersLock) { - return m_maxFPS; - } - } - - /** - * Write resolution value to camera. - * - * @param resolution The camera resolution value to write to the camera. - */ - public void writeResolution(Resolution resolution) { - synchronized (m_parametersLock) { - if (m_resolution != resolution) { - m_resolution = resolution; - m_parametersDirty = true; - m_streamDirty = true; - } - } - } - - /** - * Gets the configured resolution (not necessarily the same resolution as the most recent - * image, if it was changed recently). - * - * @return The configured resolution of the camera. - */ - public Resolution getResolution() { - synchronized (m_parametersLock) { - return m_resolution; - } - } - - /** - * Write the compression value to the camera. - * - * @param compression Values between 0 and 100. - */ - public void writeCompression(int compression) { - if (compression < 0 || compression > 100) { - throw new IllegalArgumentException("Compression must be from 0 to 100"); - } - - synchronized (m_parametersLock) { - if (m_compression != compression) { - m_compression = compression; - m_parametersDirty = true; - m_streamDirty = true; - } - } - } - - /** - * Gets the configured compression level of the camera images. - * - * @return The configured compression level of the camera images. - */ - public int getCompression() { - synchronized (m_parametersLock) { - return m_compression; - } - } - - /** - * Write the motation value to the camera. If you mount your camera upside down, use this to - * adjust the image for you. - * - * @param rotation A value from the {@link Rotation} enum - */ - public void writeRotation(Rotation rotation) { - synchronized (m_parametersLock) { - if (m_rotation != rotation) { - m_rotation = rotation; - m_parametersDirty = true; - m_streamDirty = true; - } - } - } - - /** - * Gets the configured rotation mode of the camera. - * - * @return The configured rotation mode of the camera - */ - public Rotation getRotation() { - synchronized (m_parametersLock) { - return m_rotation; - } - } - - /** - * This function actually reads the images from the camera. - */ - private void readImagesFromCamera() throws IOException { - DataInputStream cameraInputStream = new DataInputStream(m_cameraSocket.getInputStream()); - - while (!m_done) { - String line = cameraInputStream.readLine(); - - if (line.startsWith("Content-Length: ")) { - int contentLength = Integer.valueOf(line.substring(16)); - - /* Skip the next blank line */ - cameraInputStream.readLine(); - contentLength -= 4; - - /* The next four bytes are the JPEG magic number */ - byte[] data = new byte[contentLength]; - cameraInputStream.readFully(data); - - synchronized (m_imageDataLock) { - if (m_imageData.capacity() < data.length) { - m_imageData = ByteBuffer.allocate(data.length + kImageBufferAllocationIncrement); - } - - m_imageData.clear(); - m_imageData.limit(contentLength); - m_imageData.put(data); - - m_freshImage = true; - } - - if (this.writeParameters()) { - break; - } - - /* Skip the boundary and Content-Type header */ - cameraInputStream.readLine(); - cameraInputStream.readLine(); - } - } - - m_cameraSocket.close(); - } - - /** - * Send a request to the camera to set all of the parameters. This is called in the capture thread - * between each frame. This strategy avoids making lots of redundant HTTP requests, accounts for - * failed initial requests, and avoids blocking calls in the main thread unless necessary. - * - *

This method does nothing if no parameters have been modified since it last completely - * successfully. - * - * @return true if the stream should be restarted due to a parameter changing. - */ - private boolean writeParameters() { - if (m_parametersDirty) { - String request = "GET /axis-cgi/admin/param.cgi?action=update"; - - synchronized (m_parametersLock) { - request += "&ImageSource.I0.Sensor.Brightness=" + m_brightness; - request += - "&ImageSource.I0.Sensor.WhiteBalance=" + kWhiteBalanceStrings[m_whiteBalance.ordinal()]; - request += "&ImageSource.I0.Sensor.ColorLevel=" + m_colorLevel; - request += - "&ImageSource.I0.Sensor.Exposure=" - + kExposureControlStrings[m_exposureControl.ordinal()]; - request += "&ImageSource.I0.Sensor.ExposurePriority=" + m_exposurePriority; - request += "&Image.I0.Stream.FPS=" + m_maxFPS; - request += "&Image.I0.Appearance.Resolution=" + kResolutionStrings[m_resolution.ordinal()]; - request += "&Image.I0.Appearance.Compression=" + m_compression; - request += "&Image.I0.Appearance.Rotation=" + kRotationStrings[m_rotation.ordinal()]; - } - - request += " HTTP/1.1\n"; - request += "User-Agent: HTTPStreamClient\n"; - request += "Connection: Keep-Alive\n"; - request += "Cache-Control: no-cache\n"; - request += "Authorization: Basic RlJDOkZSQw==\n\n"; - - try { - Socket socket = createCameraSocket(request); - socket.close(); - - m_parametersDirty = false; - - if (m_streamDirty) { - m_streamDirty = false; - return true; - } else { - return false; - } - } catch (IOException | NullPointerException ex) { - return false; - } - - } - - return false; - } - - /** - * Create a socket connected to camera Used to create a connection for reading images and setting - * parameters - * - * @param requestString The initial request string to send upon successful connection. - * @return The created socket - */ - private Socket createCameraSocket(String requestString) throws IOException { - /* Connect to the server */ - Socket socket = new Socket(); - socket.connect(new InetSocketAddress(m_cameraHost, 80), 5000); - - /* Send the HTTP headers */ - OutputStream socketOutputStream = socket.getOutputStream(); - socketOutputStream.write(requestString.getBytes()); - - return socket; - } - - @Override - public String toString() { - return "AxisCamera{" + "FreshImage=" + isFreshImage() + ", Brightness=" + getBrightness() - + ", WhiteBalance=" + getWhiteBalance() + ", ColorLevel=" + getColorLevel() - + ", ExposureControl=" + getExposureControl() + ", ExposurePriority=" - + getExposurePriority() + ", MaxFPS=" + getMaxFPS() + ", Resolution=" + getResolution() - + ", Compression=" + getCompression() + ", Rotation=" + getRotation() + '}'; - } -} diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/USBCamera.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/USBCamera.java deleted file mode 100644 index f40484c6ad..0000000000 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/vision/USBCamera.java +++ /dev/null @@ -1,387 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2016. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.vision; - -import com.ni.vision.NIVision; -import com.ni.vision.VisionException; - -import java.nio.ByteBuffer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import edu.wpi.first.wpilibj.Timer; - -public class USBCamera { - public static final String kDefaultCameraName = "cam0"; - - private static final String ATTR_VIDEO_MODE = "AcquisitionAttributes::VideoMode"; - private static final String ATTR_WB_MODE = "CameraAttributes::WhiteBalance::Mode"; - private static final String ATTR_WB_VALUE = "CameraAttributes::WhiteBalance::Value"; - private static final String ATTR_EX_MODE = "CameraAttributes::Exposure::Mode"; - private static final String ATTR_EX_VALUE = "CameraAttributes::Exposure::Value"; - private static final String ATTR_BR_MODE = "CameraAttributes::Brightness::Mode"; - private static final String ATTR_BR_VALUE = "CameraAttributes::Brightness::Value"; - - public class WhiteBalance { - public static final int kFixedIndoor = 3000; - public static final int kFixedOutdoor1 = 4000; - public static final int kFixedOutdoor2 = 5000; - public static final int kFixedFluorescent1 = 5100; - public static final int kFixedFlourescent2 = 5200; - } - - private Pattern m_reMode = - Pattern - .compile("(?[0-9]+)\\s*x\\s*(?[0-9]+)\\s+(?.*?)" - + "\\s+(?[0-9.]+)\\s*fps"); - - private String m_name = kDefaultCameraName; - private int m_id = -1; - private boolean m_active = false; - private boolean m_useJpeg = true; - private int m_width = 320; - private int m_height = 240; - private int m_fps = 30; - private String m_whiteBalance = "auto"; - private int m_whiteBalanceValue = -1; - private String m_exposure = "auto"; - private int m_exposureValue = -1; - private int m_brightness = 50; - private boolean m_needSettingsUpdate = true; - - public USBCamera() { - openCamera(); - } - - public USBCamera(String name) { - m_name = name; - openCamera(); - } - - /** - * Opens the camera. - */ - public synchronized void openCamera() { - if (m_id != -1) { - return; // Camera is already open - } - for (int i = 0; i < 3; i++) { - try { - m_id = - NIVision.IMAQdxOpenCamera(m_name, - NIVision.IMAQdxCameraControlMode.CameraControlModeController); - } catch (VisionException ex) { - if (i == 2) { - throw ex; - } - Timer.delay(2.0); - continue; - } - break; - } - } - - /** - * Closes the camera. - */ - public synchronized void closeCamera() { - if (m_id == -1) { - return; - } - NIVision.IMAQdxCloseCamera(m_id); - m_id = -1; - } - - /** - * Starts capturing images from the camera. - */ - public synchronized void startCapture() { - if (m_id == -1 || m_active) { - return; - } - NIVision.IMAQdxConfigureGrab(m_id); - NIVision.IMAQdxStartAcquisition(m_id); - m_active = true; - } - - /** - * Stops acquiring new images from the camera. - */ - public synchronized void stopCapture() { - if (m_id == -1 || !m_active) { - return; - } - NIVision.IMAQdxStopAcquisition(m_id); - NIVision.IMAQdxUnconfigureAcquisition(m_id); - m_active = false; - } - - /** - * Updates the settings for the camera. - */ - public synchronized void updateSettings() { - boolean wasActive = m_active; - // Stop acquistion, close and reopen camera - if (wasActive) { - stopCapture(); - } - if (m_id != -1) { - closeCamera(); - } - openCamera(); - - // Video Mode - NIVision.dxEnumerateVideoModesResult enumerated = NIVision.IMAQdxEnumerateVideoModes(m_id); - NIVision.IMAQdxEnumItem foundMode = null; - int foundFps = 1000; - for (NIVision.IMAQdxEnumItem mode : enumerated.videoModeArray) { - Matcher matcher = m_reMode.matcher(mode.Name); - if (!matcher.matches()) { - continue; - } - if (Integer.parseInt(matcher.group("m_width")) != m_width) { - continue; - } - if (Integer.parseInt(matcher.group("m_height")) != m_height) { - continue; - } - double fps = Double.parseDouble(matcher.group("fps")); - if (fps < m_fps) { - continue; - } - if (fps > foundFps) { - continue; - } - String format = matcher.group("format"); - boolean isJpeg = format.equals("jpeg") || format.equals("JPEG"); - if ((m_useJpeg && !isJpeg) || (!m_useJpeg && isJpeg)) { - continue; - } - foundMode = mode; - foundFps = (int) fps; - } - if (foundMode != null) { - System.out.println("found mode " + foundMode.Value + ": " + foundMode.Name); - if (foundMode.Value != enumerated.currentMode) { - NIVision.IMAQdxSetAttributeU32(m_id, ATTR_VIDEO_MODE, foundMode.Value); - } - } - - // White Balance - if ("auto".equals(m_whiteBalance)) { - NIVision.IMAQdxSetAttributeString(m_id, ATTR_WB_MODE, "Auto"); - } else { - NIVision.IMAQdxSetAttributeString(m_id, ATTR_WB_MODE, "Manual"); - if (m_whiteBalanceValue != -1) { - NIVision.IMAQdxSetAttributeI64(m_id, ATTR_WB_VALUE, m_whiteBalanceValue); - } - } - - // Exposure - if ("auto".equals(m_exposure)) { - NIVision.IMAQdxSetAttributeString(m_id, ATTR_EX_MODE, "AutoAperaturePriority"); - } else { - NIVision.IMAQdxSetAttributeString(m_id, ATTR_EX_MODE, "Manual"); - if (m_exposureValue != -1) { - long minv = NIVision.IMAQdxGetAttributeMinimumI64(m_id, ATTR_EX_VALUE); - long maxv = NIVision.IMAQdxGetAttributeMaximumI64(m_id, ATTR_EX_VALUE); - long val = minv + (long) (((double) (maxv - minv)) * (((double) m_exposureValue) / 100.0)); - NIVision.IMAQdxSetAttributeI64(m_id, ATTR_EX_VALUE, val); - } - } - - // Brightness - NIVision.IMAQdxSetAttributeString(m_id, ATTR_BR_MODE, "Manual"); - long minv = NIVision.IMAQdxGetAttributeMinimumI64(m_id, ATTR_BR_VALUE); - long maxv = NIVision.IMAQdxGetAttributeMaximumI64(m_id, ATTR_BR_VALUE); - long val = minv + (long) (((double) (maxv - minv)) * (((double) m_brightness) / 100.0)); - NIVision.IMAQdxSetAttributeI64(m_id, ATTR_BR_VALUE, val); - - // Restart acquisition - if (wasActive) { - startCapture(); - } - } - - /** - * Sets the frames per second that the camera frames should be acquired at. - * - * @param fps The frames per second. - */ - public synchronized void setFPS(int fps) { - if (m_fps != fps) { - m_needSettingsUpdate = true; - m_fps = fps; - } - } - - /** - * Sets the size of the input of the USB camera. - * - * @param width The m_width of the camera input. - * @param height The m_height of the camera input. - */ - public synchronized void setSize(int width, int height) { - if (m_width != width || m_height != height) { - m_needSettingsUpdate = true; - m_width = width; - m_height = height; - } - } - - /** - * Set the m_brightness, as a percentage (0-100). - */ - public synchronized void setBrightness(int brightness) { - if (brightness > 100) { - m_brightness = 100; - } else if (brightness < 0) { - m_brightness = 0; - } else { - m_brightness = brightness; - } - m_needSettingsUpdate = true; - } - - /** - * Get the m_brightness, as a percentage (0-100). - */ - public synchronized int getBrightness() { - return m_brightness; - } - - /** - * Set the white balance to auto. - */ - public synchronized void setWhiteBalanceAuto() { - m_whiteBalance = "auto"; - m_whiteBalanceValue = -1; - m_needSettingsUpdate = true; - } - - /** - * Set the white balance to hold current. - */ - public synchronized void setWhiteBalanceHoldCurrent() { - m_whiteBalance = "manual"; - m_whiteBalanceValue = -1; - m_needSettingsUpdate = true; - } - - /** - * Set the white balance to manual, with specified color temperature. - */ - public synchronized void setWhiteBalanceManual(int value) { - m_whiteBalance = "manual"; - m_whiteBalanceValue = value; - m_needSettingsUpdate = true; - } - - /** - * Set the m_exposure to auto aperature. - */ - public synchronized void setExposureAuto() { - m_exposure = "auto"; - m_exposureValue = -1; - m_needSettingsUpdate = true; - } - - /** - * Set the m_exposure to hold current. - */ - public synchronized void setExposureHoldCurrent() { - m_exposure = "manual"; - m_exposureValue = -1; - m_needSettingsUpdate = true; - } - - /** - * Set the m_exposure to manual, as a percentage (0-100). - */ - public synchronized void setExposureManual(int value) { - m_exposure = "manual"; - if (value > 100) { - m_exposureValue = 100; - } else if (value < 0) { - m_exposureValue = 0; - } else { - m_exposureValue = value; - m_needSettingsUpdate = true; - } - } - - /** - * Gets the image from the camera. - * - * @param image The image to store the data into - */ - public synchronized void getImage(NIVision.Image image) { - if (m_needSettingsUpdate || m_useJpeg) { - m_needSettingsUpdate = false; - m_useJpeg = false; - updateSettings(); - } - - NIVision.IMAQdxGrab(m_id, image, 1); - } - - /** - * Gets the image data from the camera. - * - * @param data Where to put the data from the image - */ - public synchronized void getImageData(ByteBuffer data) { - if (m_needSettingsUpdate || !m_useJpeg) { - m_needSettingsUpdate = false; - m_useJpeg = true; - updateSettings(); - } - - NIVision - .IMAQdxGetImageData(m_id, data, NIVision.IMAQdxBufferNumberMode.BufferNumberModeLast, 0); - data.limit(data.capacity() - 1); - data.limit(getJpegSize(data)); - } - - private static int getJpegSize(ByteBuffer data) { - if (data.get(0) != (byte) 0xff || data.get(1) != (byte) 0xd8) { - throw new VisionException("invalid image"); - } - int pos = 2; - while (true) { - try { - byte byteAtIndex = data.get(pos); - if (byteAtIndex != (byte) 0xff) { - throw new VisionException("invalid image at pos " + pos + " (" + data.get(pos) + ")"); - } - byteAtIndex = data.get(pos + 1); - if (byteAtIndex == (byte) 0x01 - || (byteAtIndex >= (byte) 0xd0 && byteAtIndex <= (byte) 0xd7)) { // various - pos += 2; - } else if (byteAtIndex == (byte) 0xd9) { // EOI - return pos + 2; - } else if (byteAtIndex == (byte) 0xd8) { // SOI - throw new VisionException("invalid image"); - } else if (byteAtIndex == (byte) 0xda) { // SOS - int len = ((data.get(pos + 2) & 0xff) << 8) | (data.get(pos + 3) & 0xff); - pos += len + 2; - // Find next marker. Skip over escaped and RST markers. - while (data.get(pos) != (byte) 0xff || data.get(pos + 1) == (byte) 0x00 - || (data.get(pos + 1) >= (byte) 0xd0 && data.get(pos + 1) <= (byte) 0xd7)) { - pos += 1; - } - } else { // various - int len = ((data.get(pos + 2) & 0xff) << 8) | (data.get(pos + 3) & 0xff); - pos += len + 2; - } - } catch (IndexOutOfBoundsException ex) { - throw new VisionException("invalid image: could not find jpeg end " + ex.getMessage()); - } - } - } -}