Class: OpenCV::Cv::Algorithm

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/ruby/ropencv/ropencv_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ Algorithm

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Algorithm.



7744
7745
7746
7747
7748
7749
7750
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7744

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? AlgorithmStruct
                       ptr
                   else
                       AlgorithmStruct.new(FFI::AutoPointer.new(ptr,AlgorithmStruct.method(:release)))
                   end
end

Instance Attribute Details

#__obj_ptr__Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7741
7742
7743
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7741

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

wrapper for Ptr_Algorithm cv::Algorithm::_create(const cv::String name)



7874
7875
7876
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7874

def self._create(name)
    Rbind::cv_algorithm__create(name)
end

.from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



7736
7737
7738
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7736

def self.from_native(ptr,context)
    rbind_from_native(ptr,context)
end

.get_list(algorithms) ⇒ Object

wrapper for void cv::Algorithm::getList(vector_string algorithms)



7869
7870
7871
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7869

def self.get_list(algorithms)
    Rbind::cv_algorithm_get_list(algorithms)
end

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


7705
7706
7707
7708
7709
7710
7711
7712
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7705

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(AlgorithmStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.rbind_from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7724
7725
7726
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7724

def self.rbind_from_native(ptr,context)
    Algorithm.new(ptr)
end

.rbind_to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7715
7716
7717
7718
7719
7720
7721
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7715

def self.rbind_to_native(obj,context)
    if obj.is_a? Algorithm
        obj.__obj_ptr__
    else
        raise TypeError, "expected kind of #{name}, was #{obj.class}"
    end
end

.to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



7730
7731
7732
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7730

def self.to_native(obj,context)
    rbind_to_native(obj,context)
end

Instance Method Details

#__owner__?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

returns true if the underlying pointer is owner of the real object

Returns:

  • (Boolean)


7755
7756
7757
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7755

def __owner__?
    @__obj_ptr__[:bowner]
end

#get_algorithm(name) ⇒ Object

wrapper for Ptr_Algorithm cv::Algorithm::getAlgorithm(const cv::String name)



7808
7809
7810
7811
7812
7813
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7808

def get_algorithm(name)
    result = Rbind::cv_algorithm_get_algorithm( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_bool(name) ⇒ Object

wrapper for bool cv::Algorithm::getBool(const cv::String name)



7779
7780
7781
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7779

def get_bool(name)
    Rbind::cv_algorithm_get_bool( self, name)
end

#get_double(name) ⇒ Object

wrapper for double cv::Algorithm::getDouble(const cv::String name)



7774
7775
7776
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7774

def get_double(name)
    Rbind::cv_algorithm_get_double( self, name)
end

#get_int(name) ⇒ Object

methods wrapper for int cv::Algorithm::getInt(const cv::String name)



7769
7770
7771
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7769

def get_int(name)
    Rbind::cv_algorithm_get_int( self, name)
end

#get_mat(name) ⇒ Object

wrapper for cv::Mat cv::Algorithm::getMat(const cv::String name)



7792
7793
7794
7795
7796
7797
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7792

def get_mat(name)
    result = Rbind::cv_algorithm_get_mat( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_mat_vector(name) ⇒ Object

wrapper for vector_Mat cv::Algorithm::getMatVector(const cv::String name)



7800
7801
7802
7803
7804
7805
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7800

def get_mat_vector(name)
    result = Rbind::cv_algorithm_get_mat_vector( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_params(names) ⇒ Object

wrapper for void cv::Algorithm::getParams(vector_string names)



7864
7865
7866
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7864

def get_params(names)
    Rbind::cv_algorithm_get_params( self, names)
end

#get_string(name) ⇒ Object

wrapper for cv::String cv::Algorithm::getString(const cv::String name)



7784
7785
7786
7787
7788
7789
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7784

def get_string(name)
    result = Rbind::cv_algorithm_get_string( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#param_help(name) ⇒ Object

wrapper for cv::String cv::Algorithm::paramHelp(const cv::String name)



7851
7852
7853
7854
7855
7856
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7851

def param_help(name)
    result = Rbind::cv_algorithm_param_help( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#param_type(name) ⇒ Object

wrapper for int cv::Algorithm::paramType(const cv::String name)



7859
7860
7861
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7859

def param_type(name)
    Rbind::cv_algorithm_param_type( self, name)
end

#set_algorithm(name, value) ⇒ Object

wrapper for void cv::Algorithm::setAlgorithm(const cv::String name, const Ptr_Algorithm value)



7846
7847
7848
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7846

def set_algorithm(name, value)
    Rbind::cv_algorithm_set_algorithm( self, name, value)
end

#set_bool(name, value) ⇒ Object

wrapper for void cv::Algorithm::setBool(const cv::String name, bool value)



7826
7827
7828
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7826

def set_bool(name, value)
    Rbind::cv_algorithm_set_bool( self, name, value)
end

#set_double(name, value) ⇒ Object

wrapper for void cv::Algorithm::setDouble(const cv::String name, double value)



7821
7822
7823
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7821

def set_double(name, value)
    Rbind::cv_algorithm_set_double( self, name, value)
end

#set_int(name, value) ⇒ Object

wrapper for void cv::Algorithm::setInt(const cv::String name, int value)



7816
7817
7818
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7816

def set_int(name, value)
    Rbind::cv_algorithm_set_int( self, name, value)
end

#set_mat(name, value) ⇒ Object

wrapper for void cv::Algorithm::setMat(const cv::String name, const cv::Mat value)



7836
7837
7838
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7836

def set_mat(name, value)
    Rbind::cv_algorithm_set_mat( self, name, value)
end

#set_mat_vector(name, value) ⇒ Object

wrapper for void cv::Algorithm::setMatVector(const cv::String name, const vector_Mat value)



7841
7842
7843
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7841

def set_mat_vector(name, value)
    Rbind::cv_algorithm_set_mat_vector( self, name, value)
end

#set_string(name, value) ⇒ Object

wrapper for void cv::Algorithm::setString(const cv::String name, const cv::String value)



7831
7832
7833
# File 'lib/ruby/ropencv/ropencv_types.rb', line 7831

def set_string(name, value)
    Rbind::cv_algorithm_set_string( self, name, value)
end