Class: OpenCV::Cv::FileNode

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

Constants collapse

NONE =
0
INT =
1
REAL =
2
FLOAT =
REAL
STR =
3
STRING =
STR
REF =
4
SEQ =
5
MAP =
6
TYPE_MASK =
7
FLOW =
8
USER =
16
EMPTY =
32
NAMED =
64

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ FileNode

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 FileNode.



4588
4589
4590
4591
4592
4593
4594
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4588

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? FileNodeStruct
                       ptr
                   else
                       FileNodeStruct.new(FFI::AutoPointer.new(ptr,FileNodeStruct.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.



4585
4586
4587
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4585

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

.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



4580
4581
4582
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4580

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4537

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(FileNodeStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::FileNode::FileNode()
    @@cv_file_node_file_node_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_file_node_file_node_defaults0[i]
        end
        begin
            return Rbind::cv_file_node_file_node(*args)
        rescue TypeError => e
            @error = e
        end
    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.



4568
4569
4570
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4568

def self.rbind_from_native(ptr,context)
    FileNode.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.



4559
4560
4561
4562
4563
4564
4565
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4559

def self.rbind_to_native(obj,context)
    if obj.is_a? FileNode
        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



4574
4575
4576
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4574

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

Instance Method Details

#[](*args) ⇒ Object

methods wrapper for overloaded method []

Raises:

  • (ArgumentError)


4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4627

def [](*args)
    # wrapper for cv::FileNode cv::FileNode::operator[](c_string nodename)
    @@cv_file_node_operator_array_defaults0 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_file_node_operator_array_defaults0[i]
        end
        begin
            result = Rbind::cv_file_node_operator_array(self,*args)
            # store owner insight the pointer to not get garbage collected
            result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
            return result
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::FileNode cv::FileNode::operator[](int i)
    @@cv_file_node_operator_array2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_file_node_operator_array2_defaults1[i]
        end
        begin
            result = Rbind::cv_file_node_operator_array2(self,*args)
            # store owner insight the pointer to not get garbage collected
            result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
            return result
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#__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)


4599
4600
4601
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4599

def __owner__?
    @__obj_ptr__[:bowner]
end

#emptyObject

wrapper for bool cv::FileNode::empty()



4669
4670
4671
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4669

def empty()
    Rbind::cv_file_node_empty( self)
end

#is_intObject

wrapper for bool cv::FileNode::isInt()



4689
4690
4691
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4689

def is_int()
    Rbind::cv_file_node_is_int( self)
end

#is_mapObject

wrapper for bool cv::FileNode::isMap()



4684
4685
4686
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4684

def is_map()
    Rbind::cv_file_node_is_map( self)
end

#is_namedObject

wrapper for bool cv::FileNode::isNamed()



4704
4705
4706
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4704

def is_named()
    Rbind::cv_file_node_is_named( self)
end

#is_noneObject

wrapper for bool cv::FileNode::isNone()



4674
4675
4676
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4674

def is_none()
    Rbind::cv_file_node_is_none( self)
end

#is_realObject

wrapper for bool cv::FileNode::isReal()



4694
4695
4696
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4694

def is_real()
    Rbind::cv_file_node_is_real( self)
end

#is_seqObject

wrapper for bool cv::FileNode::isSeq()



4679
4680
4681
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4679

def is_seq()
    Rbind::cv_file_node_is_seq( self)
end

#is_stringObject

wrapper for bool cv::FileNode::isString()



4699
4700
4701
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4699

def is_string()
    Rbind::cv_file_node_is_string( self)
end

#nameObject

wrapper for cv::String cv::FileNode::name()



4709
4710
4711
4712
4713
4714
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4709

def name()
    result = Rbind::cv_file_node_name( self)
    # 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

#sizeObject

wrapper for size_t cv::FileNode::size()



4717
4718
4719
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4717

def size()
    Rbind::cv_file_node_size( self)
end

#typeObject

wrapper for int cv::FileNode::type()



4664
4665
4666
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4664

def type()
    Rbind::cv_file_node_type( self)
end