mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
WPILib Reorganization
This is a major restructuring of the WPILib repository to simply build procedures and remove the remnants of Maven from everything except the eclipse plugins. Gradle files have been largely simplified or rewritten, taking advantage of splitting up parts of the build into separate build files for ease of reading. The eclipse plugins are now in a separate project, as is ntcore. All dependencies are resolved via Maven dependencies, with the Jenkins-maintained WPILib repo. Project structures have also been simplified: we no longer have separate subprojects inside wpilibc and wpilibj. Where possible, these changes hav been done with git renames, to make sure we still have full history for all repositories. Other unrelated subprojects have also been broken out: OutlineViewer is now a separate project. Change-Id: Ib4e2a6e1a2f66427a14f16612b0e0d69ed661878
This commit is contained in:
27
wpilibj/src/athena/cpp/nivision/dxattr.h
Normal file
27
wpilibj/src/athena/cpp/nivision/dxattr.h
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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);
|
||||
|
||||
5
wpilibj/src/athena/cpp/nivision/dxattr.ini
Normal file
5
wpilibj/src/athena/cpp/nivision/dxattr.ini
Normal file
@@ -0,0 +1,5 @@
|
||||
[IMAQdxGetAttributeString]
|
||||
outparams=value
|
||||
|
||||
[Block Comment]
|
||||
exclude=
|
||||
21
wpilibj/src/athena/cpp/nivision/dxattr_funcs.txt
Normal file
21
wpilibj/src/athena/cpp/nivision/dxattr_funcs.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
IMAQdxGetAttributeU32
|
||||
IMAQdxGetAttributeI64
|
||||
IMAQdxGetAttributeF64
|
||||
IMAQdxGetAttributeString
|
||||
IMAQdxGetAttributeEnum
|
||||
IMAQdxGetAttributeBool
|
||||
IMAQdxGetAttributeMinimumU32
|
||||
IMAQdxGetAttributeMinimumI64
|
||||
IMAQdxGetAttributeMinimumF64
|
||||
IMAQdxGetAttributeMaximumU32
|
||||
IMAQdxGetAttributeMaximumI64
|
||||
IMAQdxGetAttributeMaximumF64
|
||||
IMAQdxGetAttributeIncrementU32
|
||||
IMAQdxGetAttributeIncrementI64
|
||||
IMAQdxGetAttributeIncrementF64
|
||||
IMAQdxSetAttributeU32
|
||||
IMAQdxSetAttributeI64
|
||||
IMAQdxSetAttributeF64
|
||||
IMAQdxSetAttributeString
|
||||
IMAQdxSetAttributeEnum
|
||||
IMAQdxSetAttributeBool
|
||||
1981
wpilibj/src/athena/cpp/nivision/gen_java.py
Normal file
1981
wpilibj/src/athena/cpp/nivision/gen_java.py
Normal file
File diff suppressed because it is too large
Load Diff
114
wpilibj/src/athena/cpp/nivision/gen_struct_sizer.py
Normal file
114
wpilibj/src/athena/cpp/nivision/gen_struct_sizer.py
Normal file
@@ -0,0 +1,114 @@
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
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 <stdio.h>
|
||||
#include <stddef.h>
|
||||
#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 <header.h> <config.ini>")
|
||||
exit(0)
|
||||
|
||||
fname = sys.argv[1]
|
||||
configname = sys.argv[2]
|
||||
|
||||
generate("", configname, fname)
|
||||
42
wpilibj/src/athena/cpp/nivision/generateJNI.sh
Normal file
42
wpilibj/src/athena/cpp/nivision/generateJNI.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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/
|
||||
14
wpilibj/src/athena/cpp/nivision/get_struct_size.py
Normal file
14
wpilibj/src/athena/cpp/nivision/get_struct_size.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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()
|
||||
80
wpilibj/src/athena/cpp/nivision/imaqdx.ini
Normal file
80
wpilibj/src/athena/cpp/nivision/imaqdx.ini
Normal file
@@ -0,0 +1,80 @@
|
||||
[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
|
||||
840
wpilibj/src/athena/cpp/nivision/nivision_2011.ini
Normal file
840
wpilibj/src/athena/cpp/nivision/nivision_2011.ini
Normal file
@@ -0,0 +1,840 @@
|
||||
;
|
||||
; [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
|
||||
226
wpilibj/src/athena/cpp/nivision/nivision_parse.py
Normal file
226
wpilibj/src/athena/cpp/nivision/nivision_parse.py
Normal file
@@ -0,0 +1,226 @@
|
||||
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<name>(IMAQ|ERR)[A-Z0-9_]+)\s+(?P<value>.*)')
|
||||
enum_re = re.compile(r'^typedef\s+enum\s+(?P<name>[A-Za-z0-9]+)_enum\s*{')
|
||||
enum_value_re = re.compile(r'^\s*(?P<name>[A-Za-z0-9_]+)\s*(=\s*(?P<value>-?[0-9A-Fx]+))?\s*,?')
|
||||
struct_re = re.compile(r'^typedef\s+struct\s+(?P<name>[A-Za-z0-9]+)_struct\s*{')
|
||||
union_re = re.compile(r'^typedef\s+union\s+(?P<name>[A-Za-z0-9]+)_union\s*{')
|
||||
func_pointer_re = re.compile(r'\s*(?P<restype>[A-Za-z0-9_*]+)\s*\(\s*[A-Za-z0-9_]*\s*[*]\s*(?P<name>[A-Za-z0-9_]+)\s*\)\s*\((?P<params>[^)]*)\)')
|
||||
static_const_re = re.compile(r'^static\s+const\s+(?P<type>[A-Za-z0-9_]+)\s+(?P<name>[A-Za-z0-9_]+)\s*=\s*(?P<value>[^;]+);')
|
||||
function_re = re.compile(r'^((IMAQ|NI)_FUNC\s+)?(?P<restype>(const\s+)?[A-Za-z0-9_*]+)\s+((IMAQ_STDCALL|NI_FUNC[C]?)\s+)?(?P<name>[A-Za-z0-9_]+)\s*\((?P<params>[^)]*)\);')
|
||||
|
||||
# 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))
|
||||
|
||||
Reference in New Issue
Block a user