Class: OpenCV::Cv::Range

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) ⇒ Range

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



2491
2492
2493
2494
2495
2496
2497
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2491

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



2488
2489
2490
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2488

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



2483
2484
2485
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2483

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2440

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(RangeStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::Range::Range(int start, int end)
    @@cv_range_range_defaults0 ||= [nil, nil]
    if(args.size >= 2 && args.size <= 2)
        args.size.upto(1) do |i|
            args[i] = @@cv_range_range_defaults0[i]
        end
        begin
            return Rbind::cv_range_range(*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.



2471
2472
2473
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2471

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



2462
2463
2464
2465
2466
2467
2468
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2462

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



2477
2478
2479
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2477

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

Instance Method Details

#!=(r) ⇒ Object

wrapper for bool cv::Range::operator!=(const cv::Range r)



2609
2610
2611
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2609

def !=(r)
    Rbind::cv_range_operator_unequal( self, r)
end

#&(r) ⇒ Object

wrapper for cv::Range cv::Range::operator&(const cv::Range r)



2614
2615
2616
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2614

def &(r)
    Rbind::cv_range_operator_and( self, r)
end

#+(delta) ⇒ Object

wrapper for cv::Range cv::Range::operator+(int delta)



2619
2620
2621
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2619

def +(delta)
    Rbind::cv_range_operator_plus( self, delta)
end

#-(delta) ⇒ Object

wrapper for cv::Range cv::Range::operator-(int delta)



2624
2625
2626
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2624

def -(delta)
    Rbind::cv_range_operator_minus( self, delta)
end

#==(r) ⇒ Object

wrapper for bool cv::Range::operator==(const cv::Range r)



2604
2605
2606
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2604

def ==(r)
    Rbind::cv_range_operator_equal( self, r)
end

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


2502
2503
2504
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2502

def __owner__?
    @__obj_ptr__[:bowner]
end

#all(*args) ⇒ Object

wrapper for overloaded method all

Raises:

  • (ArgumentError)


2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2567

def all(*args)
    # wrapper for cv::Range cv::Range::all()
    @@cv_range_all_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_range_all_defaults0[i]
        end
        begin
            result = Rbind::cv_range_all(self,*args)
            # store owner insight the pointer to not get garbage collected
            result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
            return result
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::Range cv::Range::all()
    @@cv_range_all2_defaults1 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_range_all2_defaults1[i]
        end
        begin
            result = Rbind::cv_range_all2(self,*args)
            # store owner insight the pointer to not get garbage collected
            result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
            return result
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#endObject

wrapper for int end



2526
2527
2528
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2526

def end()
    Rbind::cv_range_get_end( self)
end

#end=(value) ⇒ Object

wrapper for int end



2531
2532
2533
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2531

def end=(value)
    Rbind::cv_range_set_end( self, value)
end

#size(*args) ⇒ Object

wrapper for overloaded method size

Raises:

  • (ArgumentError)


2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2536

def size(*args)
    # wrapper for int cv::Range::size()
    @@cv_range_size_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_range_size_defaults0[i]
        end
        begin
            return Rbind::cv_range_size(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for bool cv::Range::size()
    @@cv_range_size2_defaults1 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_range_size2_defaults1[i]
        end
        begin
            return Rbind::cv_range_size2(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#startObject

methods wrapper for int start



2516
2517
2518
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2516

def start()
    Rbind::cv_range_get_start( self)
end

#start=(value) ⇒ Object

wrapper for int start



2521
2522
2523
# File 'lib/ruby/ropencv/ropencv_types.rb', line 2521

def start=(value)
    Rbind::cv_range_set_start( self, value)
end