Class: OpenCV::Cv::Size2f

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ Size2f

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



4304
4305
4306
4307
4308
4309
4310
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4304

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



4301
4302
4303
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4301

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



4296
4297
4298
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4296

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4214

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

    # wrapper for cv::Size2f::Size2f(const cv::Size2f sz)
    @@cv_size_2f_size_2f2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_size_2f_size_2f2_defaults1[i]
        end
        begin
            return Rbind::cv_size_2f_size_2f2(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::Size2f::Size2f(const cv::Point2f pt)
    @@cv_size_2f_size_2f3_defaults2 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_size_2f_size_2f3_defaults2[i]
        end
        begin
            return Rbind::cv_size_2f_size_2f3(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::Size2f::Size2f(int width, int height)
    @@cv_size_2f_size_2f4_defaults3 ||= [nil, nil]
    if(args.size >= 2 && args.size <= 2)
        args.size.upto(1) do |i|
            args[i] = @@cv_size_2f_size_2f4_defaults3[i]
        end
        begin
            return Rbind::cv_size_2f_size_2f4(*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.



4284
4285
4286
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4284

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



4275
4276
4277
4278
4279
4280
4281
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4275

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



4290
4291
4292
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4290

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

Instance Method Details

#__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)


4315
4316
4317
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4315

def __owner__?
    @__obj_ptr__[:bowner]
end

#areaObject

wrapper for int cv::Size2f::area()



4349
4350
4351
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4349

def area()
    Rbind::cv_size_2f_area( self)
end

#heightObject

wrapper for int height



4339
4340
4341
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4339

def height()
    Rbind::cv_size_2f_get_height( self)
end

#height=(value) ⇒ Object

wrapper for int height



4344
4345
4346
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4344

def height=(value)
    Rbind::cv_size_2f_set_height( self, value)
end

#widthObject

methods wrapper for int width



4329
4330
4331
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4329

def width()
    Rbind::cv_size_2f_get_width( self)
end

#width=(value) ⇒ Object

wrapper for int width



4334
4335
4336
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4334

def width=(value)
    Rbind::cv_size_2f_set_width( self, value)
end