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(Ptr_FileStorage fs, String name = String())
045    //
046
047    // Unknown type 'Ptr_FileStorage' (I), skipping the function
048
049
050    //
051    // C++:  void cv::Algorithm::read(FileNode fn)
052    //
053
054    // Unknown type 'FileNode' (I), skipping the function
055
056
057    //
058    // C++:  bool cv::Algorithm::empty()
059    //
060
061    /**
062     * Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
063     * @return automatically generated
064     */
065    public boolean empty() {
066        return empty_0(nativeObj);
067    }
068
069
070    //
071    // C++:  void cv::Algorithm::save(String filename)
072    //
073
074    /**
075     * Saves the algorithm to a file.
076     * In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
077     * @param filename automatically generated
078     */
079    public void save(String filename) {
080        save_0(nativeObj, filename);
081    }
082
083
084    //
085    // C++:  String cv::Algorithm::getDefaultName()
086    //
087
088    /**
089     * Returns the algorithm string identifier.
090     * This string is used as top level xml/yml node tag when the object is saved to a file or string.
091     * @return automatically generated
092     */
093    public String getDefaultName() {
094        return getDefaultName_0(nativeObj);
095    }
096
097
098    @Override
099    protected void finalize() throws Throwable {
100        delete(nativeObj);
101    }
102
103
104
105    // C++:  void cv::Algorithm::clear()
106    private static native void clear_0(long nativeObj);
107
108    // C++:  bool cv::Algorithm::empty()
109    private static native boolean empty_0(long nativeObj);
110
111    // C++:  void cv::Algorithm::save(String filename)
112    private static native void save_0(long nativeObj, String filename);
113
114    // C++:  String cv::Algorithm::getDefaultName()
115    private static native String getDefaultName_0(long nativeObj);
116
117    // native support for java finalize()
118    private static native void delete(long nativeObj);
119
120}