hornetseye-qt4 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/xvwidget.hh ADDED
@@ -0,0 +1,66 @@
1
+ /* HornetsEye - Computer Vision with Ruby
2
+ Copyright (C) 2006, 2007, 2008, 2009 Jan Wedekind
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
13
+
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ #ifndef HORNETSEYE_XVWIDGET_HH
17
+ #define HORNETSEYE_XVWIDGET_HH
18
+
19
+ #include <QtGui/QWidget>
20
+ #include <X11/Xlib.h>
21
+ #include <X11/Xutil.h>
22
+ #include <X11/extensions/Xv.h>
23
+ #include <X11/extensions/Xvlib.h>
24
+ #include <set>
25
+ #include <map>
26
+ #include "error.hh"
27
+ #include "frame.hh"
28
+ #include "rubyinc.hh"
29
+
30
+ class XvManager
31
+ {
32
+ public:
33
+ XvManager( QWidget *widget );
34
+ void paint(void) throw (Error);
35
+ void grabPort(void) throw (Error);
36
+ void releasePort(void);
37
+ void clear(void);
38
+ void write( FramePtr frame ) throw (Error);
39
+ static VALUE cRubyClass;
40
+ static VALUE rbHornetseye;
41
+ static VALUE registerRubyClass( VALUE module, VALUE cWidget );
42
+ static VALUE wrapRegister( VALUE rbClass, VALUE rbWidget );
43
+ static VALUE wrapUnregister( VALUE rbClass, VALUE rbWidget );
44
+ static VALUE wrapGrabPort( VALUE rbSelf );
45
+ static VALUE wrapReleasePort( VALUE rbSelf );
46
+ static VALUE wrapClear( VALUE rbSelf );
47
+ static VALUE wrapWrite( VALUE rbSelf, VALUE rbFrame );
48
+ static VALUE wrapPaintEvent( VALUE rbSelf, VALUE rbPaintEvent );
49
+ protected:
50
+ static std::set< XvPortID > grabbedPorts;
51
+ static int typecodeToUID( std::string typecode );
52
+ static std::string uidToTypecode( int uid );
53
+ Atom findAtom( Display *display, const char *name ) throw (Error);
54
+ FramePtr alignYV12( FramePtr frame );
55
+ int selectFormat( Display *display, const int preferredUID ) throw (Error);
56
+ QWidget *m_widget;
57
+ XvPortID m_port;
58
+ bool m_requireColourKey;
59
+ int m_colourKey;
60
+ XvImage *m_xvImage;
61
+ };
62
+
63
+ typedef boost::shared_ptr< XvManager > XvManagerPtr;
64
+
65
+ #endif
66
+
@@ -0,0 +1,43 @@
1
+ # hornetseye-qt4 - Graphical output of images for Qt4
2
+ # Copyright (C) 2010 Jan Wedekind
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+ # Namespace of Hornetseye computer vision library
18
+ module Hornetseye
19
+
20
+ class XvWidget < Qt::Widget
21
+
22
+ public
23
+
24
+ alias_method :orig_write,:write
25
+
26
+ def initialize( parent = nil, grab_port_now = true )
27
+ super parent
28
+ XvWidget.register self
29
+ grabPort if grab_port_now
30
+ end
31
+
32
+ def closeEvent( e )
33
+ releasePort
34
+ XvWidget.unregister self
35
+ end
36
+
37
+ def inspect
38
+ 'XvWidget'
39
+ end
40
+ end
41
+
42
+ end
43
+
@@ -0,0 +1,17 @@
1
+ # hornetseye-qt4 - Graphical output of images for Qt4
2
+ # Copyright (C) 2010 Jan Wedekind
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ require 'hornetseye-qt4/xvwidget'
17
+
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hornetseye-qt4
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Jan Wedekind
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-10-15 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: qtruby4
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 2
30
+ - 1
31
+ version: "2.1"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: malloc
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 1
45
+ version: "1.1"
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: multiarray
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ - 9
59
+ version: "0.9"
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: hornetseye-frame
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ segments:
71
+ - 0
72
+ - 6
73
+ version: "0.6"
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: rake
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ type: :development
88
+ version_requirements: *id005
89
+ description: This Ruby extension provides graphical output of images for Qt4.
90
+ email: jan@wedesoft.de
91
+ executables: []
92
+
93
+ extensions:
94
+ - Rakefile
95
+ extra_rdoc_files: []
96
+
97
+ files:
98
+ - Rakefile
99
+ - README.md
100
+ - COPYING
101
+ - .document
102
+ - lib/hornetseye-qt4/xvwidget.rb
103
+ - lib/hornetseye_qt4_ext.rb
104
+ - ext/init.cc
105
+ - ext/xvwidget.cc
106
+ - ext/frame.cc
107
+ - ext/frame.hh
108
+ - ext/rubytools.hh
109
+ - ext/xvwidget.hh
110
+ - ext/rubyinc.hh
111
+ - ext/error.hh
112
+ - ext/rubytools.tcc
113
+ has_rdoc: yard
114
+ homepage: http://wedesoft.github.com/hornetseye-qt4/
115
+ licenses: []
116
+
117
+ post_install_message:
118
+ rdoc_options:
119
+ - --no-private
120
+ require_paths:
121
+ - lib
122
+ - ext
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ segments:
129
+ - 0
130
+ version: "0"
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ requirements: []
140
+
141
+ rubyforge_project: hornetseye
142
+ rubygems_version: 1.3.7
143
+ signing_key:
144
+ specification_version: 3
145
+ summary: Graphical output of images for Qt4
146
+ test_files: []
147
+