Class: OpenCV::VectorVectorPoint

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) ⇒ VectorVectorPoint

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



18102
18103
18104
18105
18106
18107
18108
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18102

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



18099
18100
18101
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18099

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



18094
18095
18096
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18094

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18038

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

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



18082
18083
18084
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18082

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



18073
18074
18075
18076
18077
18078
18079
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18073

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



18088
18089
18090
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18088

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

Instance Method Details

#<<(val) ⇒ Object



18129
18130
18131
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18129

def <<(val)
    push_back(val)
end

#[](size) ⇒ Object

wrapper for vector_Point vector_vector_Point::operator[](size_t size)



18174
18175
18176
18177
18178
18179
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18174

def [](size)
    result = Rbind::vector_vector_point_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)


18113
18114
18115
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18113

def __owner__?
    @__obj_ptr__[:bowner]
end

#at(size) ⇒ Object

wrapper for vector_Point vector_vector_Point::at(size_t size)



18182
18183
18184
18185
18186
18187
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18182

def at(size)
    result = Rbind::vector_vector_point_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 vector_Point vector_vector_Point::back()



18198
18199
18200
18201
18202
18203
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18198

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



18159
18160
18161
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18159

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

#dataObject

wrapper for void * vector_vector_Point::data()



18206
18207
18208
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18206

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

#each(&block) ⇒ Object



18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18119

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_vector_Point::empty()



18164
18165
18166
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18164

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

#frontObject

wrapper for vector_Point vector_vector_Point::front()



18190
18191
18192
18193
18194
18195
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18190

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



18216
18217
18218
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18216

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

#push_back(other) ⇒ Object

wrapper for void vector_vector_Point::push_back(const vector_Point other)



18211
18212
18213
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18211

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

#reserve(size) ⇒ Object

wrapper for void vector_vector_Point::reserve(size_t size)



18169
18170
18171
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18169

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

#resize(size, val = vector_Point) ⇒ Object

methods wrapper for void vector_vector_Point::resize(size_t size, const vector_Point val=vector_Point)



18149
18150
18151
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18149

def resize(size, val = vector_Point)
    Rbind::vector_vector_point_resize( self, size, val)
end

#sizeObject

wrapper for size_t vector_vector_Point::size()



18154
18155
18156
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18154

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

#swap(other) ⇒ Object

wrapper for void vector_vector_Point::swap(vector_vector_Point other)



18221
18222
18223
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18221

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