hornetseye-frame 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,7 +14,7 @@ Installation
14
14
  ------------
15
15
  *hornetseye-alsa* requires the software scaling library. If you are running Debian or (K)ubuntu, you can install it like this:
16
16
 
17
- $ sudo aptitude install libswscale-dev
17
+ $ sudo aptitude install libswscale-dev libboost-dev
18
18
 
19
19
  To install this Ruby extension, use the following command:
20
20
 
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'rbconfig'
8
8
  require 'tempfile'
9
9
 
10
10
  PKG_NAME = 'hornetseye-frame'
11
- PKG_VERSION = '0.10.0'
11
+ PKG_VERSION = '0.11.0'
12
12
  CFG = RbConfig::CONFIG
13
13
  CXX = ENV[ 'CXX' ] || 'g++'
14
14
  RB_FILES = FileList[ 'lib/**/*.rb' ]
@@ -154,7 +154,7 @@ begin
154
154
  s.extra_rdoc_files = []
155
155
  s.rdoc_options = %w{--no-private}
156
156
  s.add_dependency %<malloc>, [ '~> 1.1' ]
157
- s.add_dependency %<multiarray>, [ '~> 0.15' ]
157
+ s.add_dependency %<multiarray>, [ '~> 0.23' ]
158
158
  s.add_development_dependency %q{rake}
159
159
  end
160
160
  GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
@@ -176,7 +176,7 @@ begin
176
176
  s.extra_rdoc_files = []
177
177
  s.rdoc_options = %w{--no-private}
178
178
  s.add_dependency %<malloc>, [ '~> 1.1' ]
179
- s.add_dependency %<multiarray>, [ '~> 0.15' ]
179
+ s.add_dependency %<multiarray>, [ '~> 0.23' ]
180
180
  end
181
181
  GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
182
182
  desc "Build the gem file #{GEM_SOURCE}"
@@ -21,21 +21,17 @@ module Hornetseye
21
21
 
22
22
  class << self
23
23
 
24
- attr_accessor :typecode, :width, :height
24
+ attr_accessor :typecode
25
25
 
26
26
  def inspect
27
27
  to_s
28
28
  end
29
29
 
30
30
  def to_s
31
- "Frame(#{typecode},#{@width},#{@height})"
31
+ "Frame(#{typecode})"
32
32
  end
33
33
 
34
- def shape
35
- [ @width, @height ]
36
- end
37
-
38
- def storage_size
34
+ def storage_size(width, height)
39
35
  case typecode
40
36
  when BGR
41
37
  width * height * 3
@@ -69,8 +65,7 @@ module Hornetseye
69
65
  def ==( other )
70
66
  if other.is_a? Class
71
67
  if other < Frame_
72
- [ other.typecode, other.width, other.height ] ==
73
- [ typecode, width, height ]
68
+ other.typecode == typecode
74
69
  else
75
70
  false
76
71
  end
@@ -80,7 +75,7 @@ module Hornetseye
80
75
  end
81
76
 
82
77
  def hash
83
- [ :Frame_, typecode, width, height ].hash
78
+ [:Frame_, typecode].hash
84
79
  end
85
80
 
86
81
  def eql?( other )
@@ -89,14 +84,19 @@ module Hornetseye
89
84
 
90
85
  end
91
86
 
87
+ attr_reader :width
88
+
89
+ attr_reader :height
90
+
92
91
  attr_reader :memory
93
92
 
94
- def initialize( value = nil )
95
- @memory = value || Malloc.new( self.class.storage_size )
93
+ def initialize(width, height, options = {})
94
+ @width, @height = width, height
95
+ @memory = options[:memory] || Malloc.new(self.class.storage_size(width, height))
96
96
  end
97
97
 
98
98
  def inspect
99
- "#{self.class.inspect}(#{ "0x%08x" % @memory.object_id })"
99
+ "#{self.class.inspect}(#{@width},#{@height},#{ "0x%08x" % @memory.object_id })"
100
100
  end
101
101
 
102
102
  def dup
@@ -108,15 +108,7 @@ module Hornetseye
108
108
  end
109
109
 
110
110
  def shape
111
- self.class.shape
112
- end
113
-
114
- def width
115
- self.class.width
116
- end
117
-
118
- def height
119
- self.class.height
111
+ [@width, @height]
120
112
  end
121
113
 
122
114
  def memorise
@@ -124,7 +116,7 @@ module Hornetseye
124
116
  end
125
117
 
126
118
  def storage_size
127
- self.class.storage_size
119
+ self.class.storage_size @width, @height
128
120
  end
129
121
 
130
122
  def rgb?
@@ -150,15 +142,13 @@ module Hornetseye
150
142
 
151
143
  end
152
144
 
153
- def Frame( typecode, width, height )
145
+ def Frame(typecode)
154
146
  if typecode.is_a? FourCC
155
147
  retval = Class.new Frame_
156
148
  retval.typecode = typecode
157
- retval.width = width
158
- retval.height = height
159
149
  retval
160
150
  else
161
- Hornetseye::MultiArray typecode, width, height
151
+ Hornetseye::MultiArray typecode, 2
162
152
  end
163
153
  end
164
154
 
@@ -168,16 +158,16 @@ module Hornetseye
168
158
 
169
159
  class << self
170
160
 
171
- def new( typecode, width, height )
172
- Hornetseye::Frame( typecode, width, height ).new
161
+ def new(typecode, width, height)
162
+ Hornetseye::Frame(typecode).new width, height
173
163
  end
174
164
 
175
- def import( typecode, width, height, memory )
176
- Hornetseye::Frame( typecode, width, height ).new memory
165
+ def import(typecode, width, height, memory)
166
+ Hornetseye::Frame(typecode).new width, height, :memory => memory
177
167
  end
178
168
 
179
- def storage_size( typecode, width, height )
180
- Hornetseye::Frame( typecode, width, height ).storage_size
169
+ def storage_size(typecode, width, height)
170
+ Hornetseye::Frame(typecode).storage_size width, height
181
171
  end
182
172
 
183
173
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 10
7
+ - 11
8
8
  - 0
9
- version: 0.10.0
9
+ version: 0.11.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan Wedekind
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-06 00:00:00 +01:00
17
+ date: 2011-06-29 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -41,8 +41,8 @@ dependencies:
41
41
  - !ruby/object:Gem::Version
42
42
  segments:
43
43
  - 0
44
- - 15
45
- version: "0.15"
44
+ - 23
45
+ version: "0.23"
46
46
  type: :runtime
47
47
  version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency