Sha256: c53b07ce5a6e7a7a9b331160bd58d934148ca85af6f4fccda1d89125503f5e41

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

require 'artoo/adaptors/adaptor'

module Artoo
  module Adaptors
    # Connect to a opencv device
    # @see device documentation for more information
    class OpencvWindow < Adaptor
      finalizer :finalize
      attr_reader :window

      # Closes connection with device if connected
      # @return [Boolean]
      def finalize
      end

      # Creates a connection with device
      # @return [Boolean]
      def connect
        require 'opencv' unless defined?(::OpenCV) 
        super
      end

      # Closes connection with device
      # @return [Boolean]
      def disconnect
        super
      end

      # Uses method missing to call device actions
      # @see device documentation
      def method_missing(method_name, *arguments, &block)
        device.send(method_name, *arguments, &block)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
artoo-opencv-0.1.0 lib/artoo/adaptors/opencv_window.rb
artoo-opencv-0.0.1 lib/artoo/adaptors/opencv_window.rb