// // This file is auto-generated by wpilibj/wpilibJavaJNI/nivision/gen_java.py // Please do not edit! // package com.ni.vision; import java.lang.reflect.*; import java.io.UnsupportedEncodingException; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; 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 0 && realCoords_addr != 0) { ByteBuffer bb = newDirectByteBuffer(realCoords_addr, realCoords_numRealCoords*16); for (int i=0, off=0; i 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numberOfPoints*16); for (int i=0, off=0; i 0 && bestFit_addr != 0) { ByteBuffer bb = newDirectByteBuffer(bestFit_addr, bestFit_numberOfPoints*16); for (int i=0, off=0; i 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 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 0 && pointsReal_addr != 0) { ByteBuffer bb = newDirectByteBuffer(pointsReal_addr, pointsReal_numPointsReal*16); for (int i=0, off=0; i 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 0 && labelOut_addr != 0) { ByteBuffer bb = newDirectByteBuffer(labelOut_addr, labelOut_numLabelOut*8); for (int i=0, off=0; i 0 && roiArray_addr != 0) { ByteBuffer bb = newDirectByteBuffer(roiArray_addr, roiArray_numOfROIs*4); for (int i=0, off=0; i 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 0 && curvePoints_addr != 0) { ByteBuffer bb = newDirectByteBuffer(curvePoints_addr, curvePoints_numCurvePoints*16); for (int i=0, off=0; i 0 && curves_addr != 0) { ByteBuffer bb = newDirectByteBuffer(curves_addr, curves_numCurves*48); for (int i=0, off=0; i 0 && distances_addr != 0) { ByteBuffer bb = newDirectByteBuffer(distances_addr, distances_numDistances*40); for (int i=0, off=0; i 0 && distancesReal_addr != 0) { ByteBuffer bb = newDirectByteBuffer(distancesReal_addr, distancesReal_numDistancesReal*40); for (int i=0, off=0; i 0 && templateSubsection_addr != 0) { ByteBuffer bb = newDirectByteBuffer(templateSubsection_addr, templateSubsection_numTemplateSubsection*16); for (int i=0, off=0; i 0 && targetSubsection_addr != 0) { ByteBuffer bb = newDirectByteBuffer(targetSubsection_addr, targetSubsection_numTargetSubsection*16); for (int i=0, off=0; i 0 && classifiedDistances_addr != 0) { ByteBuffer bb = newDirectByteBuffer(classifiedDistances_addr, classifiedDistances_numClassifiedDistances*56); for (int i=0, off=0; i 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 0 && sourcePoints_addr != 0) { ByteBuffer bb = newDirectByteBuffer(sourcePoints_addr, sourcePoints_numSourcePoints*16); for (int i=0, off=0; i 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 0 && sampleScores_addr != 0) { ByteBuffer bb = newDirectByteBuffer(sampleScores_addr, sampleScores_sampleScoresSize*12); for (int i=0, off=0; i 0 && straightEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(straightEdges_addr, straightEdges_numStraightEdges*88); for (int i=0, off=0; i 0 && characterReport_addr != 0) { ByteBuffer bb = newDirectByteBuffer(characterReport_addr, characterReport_numCharacterReports*44); for (int i=0, off=0; i 0 && edges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(edges_addr, edges_numEdges*56); for (int i=0, off=0; i 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 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*56); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*56); for (int i=0, off=0; i 0 && searchArcs_addr != 0) { ByteBuffer bb = newDirectByteBuffer(searchArcs_addr, searchArcs_numSearchArcs*56); for (int i=0, off=0; i 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*56); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*56); for (int i=0, off=0; i 0 && searchLines_addr != 0) { ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines*36); for (int i=0, off=0; i 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*56); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*56); for (int i=0, off=0; i 0 && searchLines_addr != 0) { ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines*36); for (int i=0, off=0; i 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 0 && searchLines_addr != 0) { ByteBuffer bb = newDirectByteBuffer(searchLines_addr, searchLines_numSearchLines*36); for (int i=0, off=0; i 0 && usedEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(usedEdges_addr, usedEdges_numUsedEdges*56); for (int i=0, off=0; i 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 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 0 && contourPoints_addr != 0) { ByteBuffer bb = newDirectByteBuffer(contourPoints_addr, contourPoints_numContourPoints*8); for (int i=0, off=0; i 0 && featureData_addr != 0) { ByteBuffer bb = newDirectByteBuffer(featureData_addr, featureData_numFeatureData*16); for (int i=0, off=0; i 0 && angleRanges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numAngleRanges*8); for (int i=0, off=0; i 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints*8); for (int i=0, off=0; i 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 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 0 && allScores_addr != 0) { ByteBuffer bb = newDirectByteBuffer(allScores_addr, allScores_allScoresSize*12); for (int i=0, off=0; i 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 0 && angleRanges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numAngleRanges*8); for (int i=0, off=0; i 0 && palette_addr != 0) { ByteBuffer bb = newDirectByteBuffer(palette_addr, palette_numColors*4); for (int i=0, off=0; i 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 0 && characterReport_addr != 0) { ByteBuffer bb = newDirectByteBuffer(characterReport_addr, characterReport_numCharacterReports*48); for (int i=0, off=0; i 0 && edges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(edges_addr, edges_numEdges*8); for (int i=0, off=0; i 0 && segmentInfo_addr != 0) { ByteBuffer bb = newDirectByteBuffer(segmentInfo_addr, segmentInfo_numCharacters*4); for (int i=0, off=0; i 0 && colorsToIgnore_addr != 0) { ByteBuffer bb = newDirectByteBuffer(colorsToIgnore_addr, colorsToIgnore_numColorsToIgnore*12); for (int i=0, off=0; i 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 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 0 && realWorldCoordinates_addr != 0) { ByteBuffer bb = newDirectByteBuffer(realWorldCoordinates_addr, realWorldCoordinates_numCoordinates*8); for (int i=0, off=0; i 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints*8); for (int i=0, off=0; i 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 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*8); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*8); for (int i=0, off=0; i 0 && allEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges*8); for (int i=0, off=0; i 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 0 && palette_addr != 0) { ByteBuffer bb = newDirectByteBuffer(palette_addr, palette_numColors*4); for (int i=0, off=0; i 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints*8); for (int i=0, off=0; i 0 && angleRanges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(angleRanges_addr, angleRanges_numRanges*8); for (int i=0, off=0; i 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints*8); for (int i=0, off=0; i 0 && regions_addr != 0) { ByteBuffer bb = newDirectByteBuffer(regions_addr, regions_regionCount*28); for (int i=0, off=0; i 0 && rakeLines_addr != 0) { ByteBuffer bb = newDirectByteBuffer(rakeLines_addr, rakeLines_numRakeLines*16); for (int i=0, off=0; i 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*8); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*8); for (int i=0, off=0; i 0 && allEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges*8); for (int i=0, off=0; i 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 0 && points_addr != 0) { ByteBuffer bb = newDirectByteBuffer(points_addr, points_numPoints*8); for (int i=0, off=0; i 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 0 && arcCoordPoints_addr != 0) { ByteBuffer bb = newDirectByteBuffer(arcCoordPoints_addr, arcCoordPoints_numOfArcCoordPoints*8); for (int i=0, off=0; i 0 && spokeLines_addr != 0) { ByteBuffer bb = newDirectByteBuffer(spokeLines_addr, spokeLines_numSpokeLines*16); for (int i=0, off=0; i 0 && firstEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(firstEdges_addr, firstEdges_numFirstEdges*8); for (int i=0, off=0; i 0 && lastEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(lastEdges_addr, lastEdges_numLastEdges*8); for (int i=0, off=0; i 0 && allEdges_addr != 0) { ByteBuffer bb = newDirectByteBuffer(allEdges_addr, allEdges_numLinesWithEdges*8); for (int i=0, off=0; i 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 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCircles*16); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numEdgePairs*32); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numExtremes*24); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numEdges*8); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_size*4); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numSegments*24); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numPoints*8); for (int i=0, off=0; i 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 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 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*40); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCurves*48); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned*24); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned*40); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned*40); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatchesReturned*64); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numFeatures*16); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numFeatures*16); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*52); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*380); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*380); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numCandidatesOut*52); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*116); for (int i=0, off=0; i 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*52); for (int i=0, off=0; i 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 0 && array_addr != 0) { ByteBuffer bb = newDirectByteBuffer(array_addr, array_numMatches*52); for (int i=0, off=0; i