Class: OpenCV::Std::Vector::Uint32_T

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.vectorObject .vectorObject

Overloads:

Raises:

  • (ArgumentError)


87789
87790
87791
87792
87793
87794
87795
87796
87797
87798
87799
87800
87801
87802
87803
87804
87805
87806
87807
87808
87809
87810
87811
87812
87813
87814
87815
87816
87817
87818
87819
87820
87821
87822
87823
# File 'lib/ropencv/ropencv_types.rb', line 87789

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Uint32_TStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # overloaded method wrapper for std::vector<uint32_t>::vector<uint32_t>()
    @@std_vector_uint32t_vector_uint32t_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@std_vector_uint32t_vector_uint32t_defaults0[i]
        end
        begin
                return Rbind::std_vector_uint32t_vector_uint32t(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for std::vector<uint32_t>::vector<uint32_t>(std::vector<uint32_t> other)
    @@std_vector_uint32t_vector_uint32t_2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@std_vector_uint32t_vector_uint32t_2_defaults1[i]
        end
        begin
                return Rbind::std_vector_uint32t_vector_uint32t_2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

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

.nullObject

returns a null pointer to the object



87781
87782
87783
# File 'lib/ropencv/ropencv_types.rb', line 87781

def self.null
    new(Vector::Uint32_TStruct.new)
end

Instance Method Details

#<<(val) ⇒ Object



88030
88031
88032
88033
# File 'lib/ropencv/ropencv_types.rb', line 88030

def <<(val)
    push_back(val)
    self
end

#[](idx) ⇒ Fixnum

Note:

method wrapper for uint32_t std::vector::operator

Parameters:

  • size (Size_T)

Returns:



87946
87947
87948
87949
87950
# File 'lib/ropencv/ropencv_types.rb', line 87946

def [](size)
validate_index(size)
    __validate_pointer__
    Rbind::std_vector_uint32t_operator_array( self, size)
end

#at(size) ⇒ Fixnum

Note:

method wrapper for uint32_t std::vector::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



87955
87956
87957
87958
87959
# File 'lib/ropencv/ropencv_types.rb', line 87955

def at(size)
validate_index(size)
    __validate_pointer__
    Rbind::std_vector_uint32t_at( self, size)
end

#backFixnum

Note:

method wrapper for uint32_t std::vector::back()

Returns:



87970
87971
87972
87973
# File 'lib/ropencv/ropencv_types.rb', line 87970

def back()
    __validate_pointer__
    Rbind::std_vector_uint32t_back( self)
end

#capacitySize_T

Note:

method wrapper for size_t std::vector::capacity()

Returns:

  • (Size_T)


87923
87924
87925
87926
# File 'lib/ropencv/ropencv_types.rb', line 87923

def capacity()
    __validate_pointer__
    Rbind::std_vector_uint32t_capacity( self)
end

#clearVoid

Note:

method wrapper for void std::vector::clear()

Returns:

  • (Void)


87916
87917
87918
87919
# File 'lib/ropencv/ropencv_types.rb', line 87916

def clear()
    __validate_pointer__
    Rbind::std_vector_uint32t_clear( self)
end

#dataVoid

Note:

method wrapper for void* std::vector::data()

Returns:

  • (Void)


87977
87978
87979
87980
# File 'lib/ropencv/ropencv_types.rb', line 87977

def data()
    __validate_pointer__
    Rbind::std_vector_uint32t_data( self)
end

#delete_if(&block) ⇒ Object



88034
88035
88036
88037
88038
88039
88040
88041
# File 'lib/ropencv/ropencv_types.rb', line 88034

def delete_if(&block)
    v = self.class.new
    each do |i|
         v << i if !yield(i)
    end
    v.swap(self)
    self
end

#each(&block) ⇒ Object



88020
88021
88022
88023
88024
88025
88026
88027
88028
88029
# File 'lib/ropencv/ropencv_types.rb', line 88020

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

#emptyBool

Note:

method wrapper for bool std::vector::empty()

Returns:

  • (Bool)


87930
87931
87932
87933
# File 'lib/ropencv/ropencv_types.rb', line 87930

def empty()
    __validate_pointer__
    Rbind::std_vector_uint32t_empty( self)
end

#frontFixnum

Note:

method wrapper for uint32_t std::vector::front()

Returns:



87963
87964
87965
87966
# File 'lib/ropencv/ropencv_types.rb', line 87963

def front()
    __validate_pointer__
    Rbind::std_vector_uint32t_front( self)
end

#get_elementFixnum

Note:

method wrapper for uint32_t std::vector::operator

Parameters:

  • size (Size_T)

Returns:



88009
88010
88011
88012
88013
# File 'lib/ropencv/ropencv_types.rb', line 88009

def [](size)
validate_index(size)
    __validate_pointer__
    Rbind::std_vector_uint32t_operator_array( self, size)
end

#pop_backVoid

Note:

method wrapper for void std::vector::pop_back()

Returns:

  • (Void)


87992
87993
87994
87995
# File 'lib/ropencv/ropencv_types.rb', line 87992

def pop_back()
    __validate_pointer__
    Rbind::std_vector_uint32t_pop_back( self)
end

#push_back(other) ⇒ Void

Note:

method wrapper for void std::vector::push_back(uint32_t other)

Parameters:

Returns:

  • (Void)


87985
87986
87987
87988
# File 'lib/ropencv/ropencv_types.rb', line 87985

def push_back(other)
    __validate_pointer__
    Rbind::std_vector_uint32t_push_back( self, other)
end

#reserve(size) ⇒ Void

Note:

method wrapper for void std::vector::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


87938
87939
87940
87941
# File 'lib/ropencv/ropencv_types.rb', line 87938

def reserve(size)
    __validate_pointer__
    Rbind::std_vector_uint32t_reserve( self, size)
end

#resize(size, val = Uint32_T()) ⇒ Void

Note:

method wrapper for void std::vector::resize(size_t size, uint32_t val = uint32_t())

methods

Parameters:

  • size (Size_T)
  • val (Fixnum) (defaults to: Uint32_T())

Returns:

  • (Void)


87902
87903
87904
87905
# File 'lib/ropencv/ropencv_types.rb', line 87902

def resize(size, val = Uint32_T())
    __validate_pointer__
    Rbind::std_vector_uint32t_resize( self, size, val)
end

#sizeSize_T

Note:

method wrapper for size_t std::vector::size()

Returns:

  • (Size_T)


87909
87910
87911
87912
# File 'lib/ropencv/ropencv_types.rb', line 87909

def size()
    __validate_pointer__
    Rbind::std_vector_uint32t_size( self)
end

#swap(other) ⇒ Void

Note:

method wrapper for void std::vector::swap(std::vector other)

Parameters:

Returns:

  • (Void)


88000
88001
88002
88003
# File 'lib/ropencv/ropencv_types.rb', line 88000

def swap(other)
    __validate_pointer__
    Rbind::std_vector_uint32t_swap( self, other)
end

#to_sObject

converts Vector::Uint32_T into a string by crawling through all its attributes



87889
87890
87891
# File 'lib/ropencv/ropencv_types.rb', line 87889

def to_s
    "#<std::vector<uint32_t> >"
end

#validate_index(idx) ⇒ Object



88015
88016
88017
88018
88019
# File 'lib/ropencv/ropencv_types.rb', line 88015

def validate_index(idx)
    if idx < 0 || idx >= size
        raise RangeError,"#{idx} is out of range [0..#{size-1}]"
    end
end