Module: OpenCV::Cv::Vecxi

Included in:
Vec2i, Vec3i, Vec4i, Vec6i
Defined in:
lib/ropencv/ropencv_ruby.rb

Instance Method Summary collapse

Instance Method Details

#[](i) ⇒ Object



166
167
168
169
# File 'lib/ropencv/ropencv_ruby.rb', line 166

def [](i)
    raise "Out of bound #{i}" if i < 0 || i >= self.class::SIZE
    val.get_int(i*FFI.type_size(FFI::Type::INT))
end

#[]=(i, val0) ⇒ Object



170
171
172
173
# File 'lib/ropencv/ropencv_ruby.rb', line 170

def []=(i,val0)
    raise "Out of bound #{i}" if i < 0 || i >= self.class::SIZE
    val.put_int(i*FFI.type_size(FFI::Type::INT),val0)
end

#to_aObject



174
175
176
# File 'lib/ropencv/ropencv_ruby.rb', line 174

def to_a
    val.get_array_of_int(0,self.class::SIZE)
end