Class: OpenCV::Cv::VideoWriter

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

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



13777
13778
13779
13780
13781
13782
13783
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13777

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



13774
13775
13776
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13774

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



13769
13770
13771
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13769

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13713

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

    # wrapper for cv::VideoWriter::VideoWriter(const cv::String filename, int fourcc, double fps, const cv::Size frameSize, bool isColor=true)
    @@cv_video_writer_video_writer2_defaults1 ||= [nil, nil, nil, nil, true]
    if(args.size >= 4 && args.size <= 5)
        args.size.upto(4) do |i|
            args[i] = @@cv_video_writer_video_writer2_defaults1[i]
        end
        begin
            return Rbind::cv_video_writer_video_writer2(*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.



13757
13758
13759
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13757

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



13748
13749
13750
13751
13752
13753
13754
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13748

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



13763
13764
13765
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13763

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)


13788
13789
13790
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13788

def __owner__?
    @__obj_ptr__[:bowner]
end

#is_openedObject

wrapper for bool cv::VideoWriter::isOpened()



13807
13808
13809
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13807

def is_opened()
    Rbind::cv_video_writer_is_opened( self)
end

#open(filename, fourcc, fps, frame_size, is_color = true) ⇒ Object

methods wrapper for bool cv::VideoWriter::open(const cv::String filename, int fourcc, double fps, const cv::Size frameSize, bool isColor=true)



13802
13803
13804
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13802

def open(filename, fourcc, fps, frame_size, is_color = true)
    Rbind::cv_video_writer_open( self, filename, fourcc, fps, frame_size, is_color)
end

#releaseObject

wrapper for void cv::VideoWriter::release()



13812
13813
13814
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13812

def release()
    Rbind::cv_video_writer_release( self)
end

#write(image) ⇒ Object

wrapper for void cv::VideoWriter::write(const cv::Mat image)



13817
13818
13819
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13817

def write(image)
    Rbind::cv_video_writer_write( self, image)
end