Module: OpenCV::Cv::Vecxf

Included in:
Vec2f, Vec3f, Vec4f, Vec6f
Defined in:
lib/ropencv/ropencv_ruby.rb

Instance Method Summary collapse

Instance Method Details

#[](i) ⇒ Object



152
153
154
155
# File 'lib/ropencv/ropencv_ruby.rb', line 152

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

#[]=(i, val0) ⇒ Object



156
157
158
159
# File 'lib/ropencv/ropencv_ruby.rb', line 156

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

#to_aObject



160
161
162
# File 'lib/ropencv/ropencv_ruby.rb', line 160

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