Class: OpenCV::VectorPoint3f

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ VectorPoint3f

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



22582
22583
22584
22585
22586
22587
22588
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22582

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



22579
22580
22581
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22579

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



22574
22575
22576
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22574

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22518

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

    # wrapper for vector_Point3f::vector_Point3f(const vector_Point3f other)
    @@vector_point_3f_vector_point_3f2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@vector_point_3f_vector_point_3f2_defaults1[i]
        end
        begin
            return Rbind::vector_point_3f_vector_point_3f2(*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.



22562
22563
22564
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22562

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



22553
22554
22555
22556
22557
22558
22559
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22553

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



22568
22569
22570
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22568

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

Instance Method Details

#<<(val) ⇒ Object



22609
22610
22611
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22609

def <<(val)
    push_back(val)
end

#[](size) ⇒ Object

wrapper for cv::Point3f vector_Point3f::operator[](size_t size)



22654
22655
22656
22657
22658
22659
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22654

def [](size)
    result = Rbind::vector_point_3f_operator_array( self, size)
    # 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

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


22593
22594
22595
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22593

def __owner__?
    @__obj_ptr__[:bowner]
end

#at(size) ⇒ Object

wrapper for cv::Point3f vector_Point3f::at(size_t size)



22662
22663
22664
22665
22666
22667
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22662

def at(size)
    result = Rbind::vector_point_3f_at( self, size)
    # 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

#backObject

wrapper for cv::Point3f vector_Point3f::back()



22678
22679
22680
22681
22682
22683
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22678

def back()
    result = Rbind::vector_point_3f_back( 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

#capacityObject

wrapper for size_t vector_Point3f::capacity()



22639
22640
22641
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22639

def capacity()
    Rbind::vector_point_3f_capacity( self)
end

#dataObject

wrapper for void * vector_Point3f::data()



22686
22687
22688
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22686

def data()
    Rbind::vector_point_3f_data( self)
end

#each(&block) ⇒ Object



22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22599

def each(&block)
    if block
         s = size
         0.upto(s-1) do |i|
             yield self[i]
         end
    else
        Enumerator.new(self)
    end
end

#emptyObject

wrapper for bool vector_Point3f::empty()



22644
22645
22646
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22644

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

#frontObject

wrapper for cv::Point3f vector_Point3f::front()



22670
22671
22672
22673
22674
22675
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22670

def front()
    result = Rbind::vector_point_3f_front( 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

#pop_backObject

wrapper for void vector_Point3f::pop_back()



22696
22697
22698
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22696

def pop_back()
    Rbind::vector_point_3f_pop_back( self)
end

#push_back(other) ⇒ Object

wrapper for void vector_Point3f::push_back(const cv::Point3f other)



22691
22692
22693
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22691

def push_back(other)
    Rbind::vector_point_3f_push_back( self, other)
end

#reserve(size) ⇒ Object

wrapper for void vector_Point3f::reserve(size_t size)



22649
22650
22651
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22649

def reserve(size)
    Rbind::vector_point_3f_reserve( self, size)
end

#resize(size, val = cv::Point3f) ⇒ Object

methods wrapper for void vector_Point3f::resize(size_t size, const cv::Point3f val=cv::Point3f)



22629
22630
22631
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22629

def resize(size, val = cv::Point3f)
    Rbind::vector_point_3f_resize( self, size, val)
end

#sizeObject

wrapper for size_t vector_Point3f::size()



22634
22635
22636
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22634

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

#swap(other) ⇒ Object

wrapper for void vector_Point3f::swap(vector_Point3f other)



22701
22702
22703
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22701

def swap(other)
    Rbind::vector_point_3f_swap( self, other)
end