Class: OpenCV::Std::Vector::Uchar

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)


37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
37303
37304
37305
37306
37307
37308
37309
37310
37311
37312
37313
37314
37315
37316
37317
37318
37319
37320
37321
37322
37323
37324
# File 'lib/ropencv/ropencv_types.rb', line 37290

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::UcharStruct)
        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<uchar>::vector<uchar>()
    @@std_vector_uchar_vector_uchar_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@std_vector_uchar_vector_uchar_defaults0[i]
        end
        begin
                return Rbind::std_vector_uchar_vector_uchar(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for std::vector<uchar>::vector<uchar>(std::vector<uchar> other)
    @@std_vector_uchar_vector_uchar2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@std_vector_uchar_vector_uchar2_defaults1[i]
        end
        begin
                return Rbind::std_vector_uchar_vector_uchar2(*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



37282
37283
37284
# File 'lib/ropencv/ropencv_types.rb', line 37282

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

Instance Method Details

#<<(val) ⇒ Object



37531
37532
37533
37534
# File 'lib/ropencv/ropencv_types.rb', line 37531

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

#[](idx) ⇒ Uchar

Note:

method wrapper for uchar std::vector

Maruku could not parse this XML/HTML: 
<uchar>::operator[](size_t size)

Parameters:

  • size (Size_T)

Returns:



37447
37448
37449
37450
37451
# File 'lib/ropencv/ropencv_types.rb', line 37447

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

#at(size) ⇒ Uchar

Note:

method wrapper for uchar std::vector

Maruku could not parse this XML/HTML: 
<uchar>::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



37456
37457
37458
37459
37460
# File 'lib/ropencv/ropencv_types.rb', line 37456

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

#backUchar

Note:

method wrapper for uchar std::vector

Maruku could not parse this XML/HTML: 
<uchar>::back()

Returns:



37471
37472
37473
37474
# File 'lib/ropencv/ropencv_types.rb', line 37471

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

#capacitySize_T

Note:

method wrapper for size_t std::vector

Maruku could not parse this XML/HTML: 
<uchar>::capacity()

Returns:

  • (Size_T)


37424
37425
37426
37427
# File 'lib/ropencv/ropencv_types.rb', line 37424

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

#clearVoid

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::clear()

Returns:

  • (Void)


37417
37418
37419
37420
# File 'lib/ropencv/ropencv_types.rb', line 37417

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

#dataVoid

Note:

method wrapper for void* std::vector

Maruku could not parse this XML/HTML: 
<uchar>::data()

Returns:

  • (Void)


37478
37479
37480
37481
# File 'lib/ropencv/ropencv_types.rb', line 37478

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

#delete_if(&block) ⇒ Object



37535
37536
37537
37538
37539
37540
37541
37542
# File 'lib/ropencv/ropencv_types.rb', line 37535

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



37521
37522
37523
37524
37525
37526
37527
37528
37529
37530
# File 'lib/ropencv/ropencv_types.rb', line 37521

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

Maruku could not parse this XML/HTML: 
<uchar>::empty()

Returns:

  • (Bool)


37431
37432
37433
37434
# File 'lib/ropencv/ropencv_types.rb', line 37431

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

#frontUchar

Note:

method wrapper for uchar std::vector

Maruku could not parse this XML/HTML: 
<uchar>::front()

Returns:



37464
37465
37466
37467
# File 'lib/ropencv/ropencv_types.rb', line 37464

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

#get_elementUchar

Note:

method wrapper for uchar std::vector

Maruku could not parse this XML/HTML: 
<uchar>::operator[](size_t size)

Parameters:

  • size (Size_T)

Returns:



37510
37511
37512
37513
37514
# File 'lib/ropencv/ropencv_types.rb', line 37510

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

#pop_backVoid

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::pop_back()

Returns:

  • (Void)


37493
37494
37495
37496
# File 'lib/ropencv/ropencv_types.rb', line 37493

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

#push_back(other) ⇒ Void

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::push_back(uchar other)

Parameters:

Returns:

  • (Void)


37486
37487
37488
37489
# File 'lib/ropencv/ropencv_types.rb', line 37486

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

#reserve(size) ⇒ Void

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


37439
37440
37441
37442
# File 'lib/ropencv/ropencv_types.rb', line 37439

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

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

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::resize(size_t size, uchar val = uchar())

methods

Parameters:

  • size (Size_T)
  • val (Uchar) (defaults to: Uchar())

Returns:

  • (Void)


37403
37404
37405
37406
# File 'lib/ropencv/ropencv_types.rb', line 37403

def resize(size, val = Uchar())
    __validate_pointer__
    Rbind::std_vector_uchar_resize( self, size, val)
end

#sizeSize_T

Note:

method wrapper for size_t std::vector

Maruku could not parse this XML/HTML: 
<uchar>::size()

Returns:

  • (Size_T)


37410
37411
37412
37413
# File 'lib/ropencv/ropencv_types.rb', line 37410

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

#swap(other) ⇒ Void

Note:

method wrapper for void std::vector

Maruku could not parse this XML/HTML: 
<uchar>::swap(std::vector<uchar> other)

Parameters:

Returns:

  • (Void)


37501
37502
37503
37504
# File 'lib/ropencv/ropencv_types.rb', line 37501

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

#to_sObject

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



37390
37391
37392
# File 'lib/ropencv/ropencv_types.rb', line 37390

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

#validate_index(idx) ⇒ Object



37516
37517
37518
37519
37520
# File 'lib/ropencv/ropencv_types.rb', line 37516

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