rays-video 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/rays/video.rb ADDED
@@ -0,0 +1,45 @@
1
+ require 'xot/block_util'
2
+ require 'beeps/ext'
3
+ require 'rays/ext'
4
+ require 'rays-video/ext'
5
+
6
+
7
+ module Rays
8
+
9
+
10
+ class Video
11
+
12
+ include Enumerable
13
+
14
+ def initialize(width, height, fps: 0, pixel_density: 1, &block)
15
+ initialize! width, height, fps, pixel_density
16
+ Xot::BlockUtil.instance_eval_or_block_call self, &block if block
17
+ end
18
+
19
+ def insert(index, *images)
20
+ images.each.with_index {|image, i| insert! index + i, image}
21
+ end
22
+
23
+ def append(*images)
24
+ images.each {|image| append! image}
25
+ end
26
+
27
+ def remove(index_or_range)
28
+ case index_or_range
29
+ when Range then raise NotImplementedError
30
+ else remove! index_or_range
31
+ end
32
+ end
33
+
34
+ alias pos= position=
35
+ alias pos position
36
+
37
+ def each(&block)
38
+ return enum_for :each unless block
39
+ each!(&block)
40
+ end
41
+
42
+ end# Video
43
+
44
+
45
+ end# Rays
@@ -0,0 +1 @@
1
+ require 'rays_video_ext'
@@ -0,0 +1,41 @@
1
+ module RaysVideo
2
+
3
+
4
+ module Extension
5
+
6
+ module_function
7
+
8
+ def name(downcase = false)
9
+ super().split('::')[-2].then {|s|
10
+ downcase ? s.gsub(/([a-z])([A-Z])/) {"#{$1}-#{$2}"}.downcase : s
11
+ }
12
+ end
13
+
14
+ def version()
15
+ File.read(root_dir 'VERSION')[/[\d\.]+/]
16
+ end
17
+
18
+ def root_dir(path = '')
19
+ File.expand_path "../../#{path}", __dir__
20
+ end
21
+
22
+ def inc_dir()
23
+ root_dir 'include'
24
+ end
25
+
26
+ def lib_dir()
27
+ root_dir 'lib'
28
+ end
29
+
30
+ def ext_dir()
31
+ root_dir 'ext'
32
+ end
33
+
34
+ def lib_name()
35
+ "#{name true}.dll" if /mswin|ming|cygwin/.match? RUBY_PLATFORM
36
+ end
37
+
38
+ end# Extension
39
+
40
+
41
+ end# RaysVideo
data/lib/rays-video.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'rays-video/extension'
2
+
3
+ require 'rays/video'
@@ -0,0 +1,39 @@
1
+ # -*- mode: ruby -*-
2
+
3
+
4
+ require_relative 'lib/rays-video/extension'
5
+
6
+
7
+ Gem::Specification.new do |s|
8
+ glob = -> *patterns do
9
+ patterns.map {|pat| Dir.glob(pat).to_a}.flatten
10
+ end
11
+
12
+ ext = RaysVideo::Extension
13
+ name = ext.name true
14
+ rdocs = glob.call *%w[README .doc/ext/**/*.cpp]
15
+
16
+ s.name = name
17
+ s.version = ext.version
18
+ s.license = 'MIT'
19
+ s.summary = 'Video support for Rays.'
20
+ s.description = 'Video encoding/decoding with audio support using Rays and Beeps.'
21
+ s.authors = %w[xordog]
22
+ s.email = 'xordog@gmail.com'
23
+ s.homepage = "https://github.com/xord/rays-video"
24
+
25
+ s.platform = Gem::Platform::RUBY
26
+ s.required_ruby_version = '>= 3.0.0'
27
+
28
+ s.add_dependency 'xot', '~> 0.3.13'
29
+ s.add_dependency 'rucy', '~> 0.3.13'
30
+ s.add_dependency 'beeps', '~> 0.3.13'
31
+ s.add_dependency 'rays', '~> 0.3.13'
32
+
33
+ s.files = `git ls-files`.split $/
34
+ s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
35
+ s.test_files = s.files.grep %r{^(test|spec|features)/}
36
+ s.extra_rdoc_files = rdocs.to_a
37
+
38
+ s.extensions << 'Rakefile'
39
+ end