001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.core;
005
006
007
008// C++: class Algorithm
009/**
010 * This is a base class for all more or less complex algorithms in OpenCV
011 *
012 * especially for classes of algorithms, for which there can be multiple implementations. The examples
013 * are stereo correspondence (for which there are algorithms like block matching, semi-global block
014 * matching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians
015 * models, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck
016 * etc.).
017 *
018 * Here is example of SimpleBlobDetector use in your application via Algorithm interface:
019 * SNIPPET: snippets/core_various.cpp Algorithm
020 */
021public class Algorithm {
022
023    protected final long nativeObj;
024    protected Algorithm(long addr) { nativeObj = addr; }
025
026    public long getNativeObjAddr() { return nativeObj; }
027
028    // internal usage only
029    public static Algorithm __fromPtr__(long addr) { return new Algorithm(addr); }
030
031    //
032    // C++:  void cv::Algorithm::clear()
033    //
034
035    /**
036     * Clears the algorithm state
037     */
038    public void clear() {
039        clear_0(nativeObj);
040    }
041
042
043    //
044    // C++:  void cv::Algorithm::write(FileStorage fs)
045    //
046
047    // Unknown type 'FileStorage' (I), skipping the function
048
049
050    //
051    // C++:  void cv::Algorithm::write(FileStorage fs, String name)
052    //
053
054    // Unknown type 'FileStorage' (I), skipping the function
055
056
057    //
058    // C++:  void cv::Algorithm::read(FileNode fn)
059    //
060
061    // Unknown type 'FileNode' (I), skipping the function
062
063
064    //
065    // C++:  bool cv::Algorithm::empty()
066    //
067
068    /**
069     * Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
070     * @return automatically generated
071     */
072    public boolean empty() {
073        return empty_0(nativeObj);
074    }
075
076
077    //
078    // C++:  void cv::Algorithm::save(String filename)
079    //
080
081    /**
082     * Saves the algorithm to a file.
083     * In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
084     * @param filename automatically generated
085     */
086    public void save(String filename) {
087        save_0(nativeObj, filename);
088    }
089
090
091    //
092    // C++:  String cv::Algorithm::getDefaultName()
093    //
094
095    /**
096     * Returns the algorithm string identifier.
097     * This string is used as top level xml/yml node tag when the object is saved to a file or string.
098     * @return automatically generated
099     */
100    public String getDefaultName() {
101        return getDefaultName_0(nativeObj);
102    }
103
104
105    @Override
106    protected void finalize() throws Throwable {
107        delete(nativeObj);
108    }
109
110
111
112    // C++:  void cv::Algorithm::clear()
113    private static native void clear_0(long nativeObj);
114
115    // C++:  bool cv::Algorithm::empty()
116    private static native boolean empty_0(long nativeObj);
117
118    // C++:  void cv::Algorithm::save(String filename)
119    private static native void save_0(long nativeObj, String filename);
120
121    // C++:  String cv::Algorithm::getDefaultName()
122    private static native String getDefaultName_0(long nativeObj);
123
124    // native support for java finalize()
125    private static native void delete(long nativeObj);
126
127}