Sha256: 0e2fba2eacf09081fefd5655c598a588746ce164714f733a3a2a659102bf8cc4

Contents?: true

Size: 585 Bytes

Versions: 6

Compression:

Stored size: 585 Bytes

Contents

#include "gui.h"

static VALUE GuiModule;

namespace Spyglass {
  namespace GUI {
    void define_ruby_module() {
      GuiModule = rb_define_module_under(Spyglass::get_ruby_module(), "GUI");

      // Module methods
      rb_define_singleton_method(GuiModule, "wait_key", RUBY_METHOD_FUNC(rb_wait_key), 1);
    }

    VALUE get_ruby_module() {
      return GuiModule;
    }

    static VALUE rb_wait_key(VALUE klass, VALUE timeout) {
      Check_Type(timeout, T_FIXNUM);

      int msecs = FIX2INT(timeout);
      int key = cv::waitKey(msecs);

      return INT2FIX(key);
    }
  }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spyglass-0.0.5.1 ext/spyglass/gui.cc
spyglass-0.0.5 ext/spyglass/gui.cc
spyglass-0.0.4.1 ext/spyglass/gui.cc
spyglass-0.0.4 ext/spyglass/gui.cc
spyglass-0.0.3 ext/spyglass/gui.cc
spyglass-0.0.2 ext/spyglass/gui.cc