2008-08-19 11:01:28 -04:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
window.h -
|
|
|
|
|
|
|
|
$Author: lsxi $
|
|
|
|
|
|
|
|
Copyright (C) 2005-2006 Masakazu Yonekura
|
|
|
|
|
|
|
|
************************************************************/
|
|
|
|
#ifndef RUBY_OPENCV_GUI_H
|
|
|
|
#include "gui.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RUBY_OPENCV_GUI_WINDOW_H
|
|
|
|
#define RUBY_OPENCV_GUI_WINDOW_H
|
|
|
|
|
|
|
|
#include "opencv.h"
|
2011-08-11 13:26:54 -04:00
|
|
|
#define __NAMESPACE_BEGIN_WINDOW namespace cWindow {
|
2008-08-19 11:01:28 -04:00
|
|
|
#define __NAMESPACE_END_WINDOW }
|
|
|
|
|
|
|
|
__NAMESPACE_BEGIN_OPENCV
|
|
|
|
__NAMESPACE_BEGIN_GUI
|
2012-02-04 15:59:10 -05:00
|
|
|
|
|
|
|
typedef struct Window {
|
|
|
|
VALUE name;
|
|
|
|
VALUE image;
|
|
|
|
VALUE trackbars;
|
|
|
|
VALUE blocks;
|
|
|
|
} Window;
|
|
|
|
|
2008-08-19 11:01:28 -04:00
|
|
|
__NAMESPACE_BEGIN_WINDOW
|
|
|
|
|
|
|
|
void define_ruby_class();
|
|
|
|
|
|
|
|
VALUE rb_allocate(VALUE klass);
|
|
|
|
|
2012-02-04 15:59:10 -05:00
|
|
|
void window_mark(void *ptr);
|
|
|
|
void window_free(void *ptr);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_alive_q(VALUE self);
|
2012-02-04 15:59:10 -05:00
|
|
|
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_destroy(VALUE self);
|
|
|
|
VALUE rb_destroy_all(VALUE klass);
|
|
|
|
VALUE rb_resize(int argc, VALUE *argv, VALUE self);
|
|
|
|
VALUE rb_move(int argc, VALUE *argv, VALUE self);
|
2012-02-04 15:59:10 -05:00
|
|
|
VALUE rb_show_image(VALUE self, VALUE img);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_set_trackbar(int argc, VALUE *argv, VALUE self);
|
2011-05-04 15:24:21 -04:00
|
|
|
VALUE rb_set_mouse_callback(int argc, VALUE* argv, VALUE self);
|
2008-08-19 11:01:28 -04:00
|
|
|
|
2012-02-04 15:59:10 -05:00
|
|
|
inline Window*
|
|
|
|
WINDOW(VALUE object) {
|
|
|
|
Window *ptr;
|
|
|
|
Data_Get_Struct(object, Window, ptr);
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const char*
|
|
|
|
GET_WINDOW_NAME(VALUE object) {
|
|
|
|
return StringValueCStr(WINDOW(object)->name);
|
|
|
|
}
|
|
|
|
|
2008-08-19 11:01:28 -04:00
|
|
|
__NAMESPACE_END_WINDOW
|
|
|
|
__NAMESPACE_END_GUI
|
|
|
|
__NAMESPACE_END_OPENCV
|
|
|
|
|
|
|
|
#endif // RUBY_OPENCV_GUI_WINDOW_H
|
|
|
|
|