rapngasm 3.1.3 → 3.1.4pre
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.
- checksums.yaml +4 -4
- data/.gitignore +11 -0
- data/.rubocop.yml +14 -0
- data/Gemfile +11 -0
- data/Guardfile +12 -0
- data/README.md +37 -0
- data/Rakefile +4 -0
- data/rapngasm.gemspec +18 -0
- data/spec/rapngasm_spec.rb +90 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/apngasm.png +0 -0
- data/spec/support/test1.png +0 -0
- data/spec/support/test2.png +0 -0
- metadata +19 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba65067eac4d1ee22f66fb37fb88a8f8b020def7
|
4
|
+
data.tar.gz: 3eb0a2bd90e4b7c33a2816c00fb2ca824c77417d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b428af8011ea50c5f151228dad0534e74eb32d3eb892ea2fd38aba1dfd3346266df6dabf58b4ebb0bf5f779a96043a2e03b8ce0fa048061f640a8feea90ab6f4
|
7
|
+
data.tar.gz: a220a5a608d2ff460903c40fbd54c26a59d5fd5038effff6ca4ec501e5c6be8061bfdaa67a2b701238723953349c4733ad7537f7633e45afe1d4be9577e34f15
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
guard :rubocop do
|
2
|
+
watch(%r{.+\.rb$})
|
3
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
4
|
+
end
|
5
|
+
|
6
|
+
guard :rspec do
|
7
|
+
watch(%r{^spec/.+_spec\.rb$})
|
8
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
9
|
+
watch('spec/spec_helper.rb') { "spec" }
|
10
|
+
|
11
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
12
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
rapngasm [](http://badge.fury.io/rb/rapngasm)
|
2
|
+
========
|
3
|
+
Ruby interface for apngasm
|
4
|
+
|
5
|
+
Requirements
|
6
|
+
------------
|
7
|
+
rapngasm requires libapngasm. Install instructions can be found in the "Installing" section [here](https://github.com/apngasm/apngasm).
|
8
|
+
|
9
|
+
Building
|
10
|
+
--------
|
11
|
+
```
|
12
|
+
rake compile
|
13
|
+
```
|
14
|
+
|
15
|
+
Specs!
|
16
|
+
------
|
17
|
+
```
|
18
|
+
rspec
|
19
|
+
```
|
20
|
+
|
21
|
+
License
|
22
|
+
-------
|
23
|
+
libpng
|
24
|
+
|
25
|
+
Support
|
26
|
+
-------
|
27
|
+
File a github issue
|
28
|
+
|
29
|
+
Expediated Support
|
30
|
+
------------------
|
31
|
+
PayPal to corporate@genshin.org
|
32
|
+
|
33
|
+
Copyright
|
34
|
+
---------
|
35
|
+
Genshin Souzou Kabushiki Kaisha
|
36
|
+
apngasm is copyright Max Stepin & Genshin Souzou K.K.
|
37
|
+
|
data/Rakefile
ADDED
data/rapngasm.gemspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'rapngasm'
|
3
|
+
s.version = '3.1.4pre'
|
4
|
+
s.license = 'libpng/zlib'
|
5
|
+
s.summary = 'apngasm for Ruby'
|
6
|
+
s.description = 'Ruby native extension for the apngasm APNG Assembler.'
|
7
|
+
s.authors = ['Rei Kagetsuki', 'Rika Yoshida']
|
8
|
+
s.email = 'zero@genshin.org'
|
9
|
+
s.homepage = 'http://www.github.com/apngasm/rapngasm'
|
10
|
+
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
|
13
|
+
s.extensions = ['ext/rapngasm/extconf.rb']
|
14
|
+
s.require_paths = ['lib', 'ext']
|
15
|
+
|
16
|
+
s.add_development_dependency 'rake-compiler', '~> 0.9', '~> 0.9.2'
|
17
|
+
s.add_development_dependency 'rice', '~> 1.6', '~> 1.6.2'
|
18
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'rapngasm'
|
2
|
+
|
3
|
+
describe 'APNGAsm' do
|
4
|
+
let(:apngasm) do
|
5
|
+
APNGAsm.new
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:apngframe) do
|
9
|
+
APNGFrame.new
|
10
|
+
end
|
11
|
+
|
12
|
+
describe 'APNGAsm.new' do
|
13
|
+
it 'creates an apngasm object' do
|
14
|
+
expect(apngasm).to be_an_instance_of(APNGAsm)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'APNGFrame.new' do
|
19
|
+
it 'creates an APNG Frame object' do
|
20
|
+
expect(apngframe).to be_an_instance_of(APNGFrame)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '.version' do
|
25
|
+
it 'outputs the native APNGAsm library version' do
|
26
|
+
expect(apngasm.version).to be
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '.add_frame' do
|
31
|
+
it 'add an APNGFrame object into apngasm' do
|
32
|
+
expect(apngasm.add_frame(apngframe)).to eq(1)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.add_frame_file' do
|
37
|
+
it 'add an APNGFrame object into apngasm' do
|
38
|
+
expect(apngasm.add_frame_file('./spec/support/test1.png', 100, 1000)).to eq(1)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '.add_frame_rgb' do
|
43
|
+
it 'add an APNGFrame object made from rgb data into apngasm' do
|
44
|
+
size = 64
|
45
|
+
rgb = []
|
46
|
+
((size * size) - 1).times do
|
47
|
+
rgb << [Random.rand(256), Random.rand(256), Random.rand(256)]
|
48
|
+
end
|
49
|
+
|
50
|
+
frame_count = apngasm.add_frame_rgb(rgb, size, size)
|
51
|
+
expect(frame_count).to eq(1)
|
52
|
+
apngasm.assemble('./spec/support/rgb.png')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '.add_frame_rgba' do
|
57
|
+
it 'add an APNGFrame object made from rgba data into apngasm' do
|
58
|
+
size = 64
|
59
|
+
rgba = []
|
60
|
+
((size * size) - 1).times do
|
61
|
+
rgba << [Random.rand(256), Random.rand(256), Random.rand(256),
|
62
|
+
Random.rand(256)]
|
63
|
+
end
|
64
|
+
|
65
|
+
frame_count = apngasm.add_frame_rgba(rgba, size, size)
|
66
|
+
expect(frame_count).to eq(1)
|
67
|
+
apngasm.assemble('./spec/support/rgba.png')
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '.assemble' do
|
72
|
+
it 'creates an animated PNG file from frames' do
|
73
|
+
apngasm.add_frame_file('./spec/support/test1.png', 100, 1000)
|
74
|
+
apngasm.add_frame_file('./spec/support/test2.png', 100, 1000)
|
75
|
+
Dir.mkdir('./spec/out') unless Dir.exist?('./spec/out')
|
76
|
+
apngasm.assemble('./spec/out/apngasm_anim.png')
|
77
|
+
expect(File.exist?('./spec/out/apngasm_anim.png')).to eq(true)
|
78
|
+
FileUtils.rm_rf('./spec/out')
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe '.disassemble' do
|
83
|
+
it 'disassemble the frames of an anmated PNG file into PNGs' do
|
84
|
+
Dir.mkdir('./spec/out') unless Dir.exist?('./spec/out')
|
85
|
+
apngframes = apngasm.disassemble('./spec/out/apngasm_anim.png')
|
86
|
+
expect(apngframes).to be_an_instance_of(Array)
|
87
|
+
FileUtils.rm_rf('./spec/out')
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
data/spec/spec_helper.rb
ADDED
File without changes
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapngasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.4pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei Kagetsuki
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.9.2
|
24
|
-
type: :
|
24
|
+
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 1.6.2
|
44
|
-
type: :
|
44
|
+
type: :development
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
@@ -58,9 +58,21 @@ extensions:
|
|
58
58
|
- ext/rapngasm/extconf.rb
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
+
- ".gitignore"
|
62
|
+
- ".rubocop.yml"
|
63
|
+
- Gemfile
|
64
|
+
- Guardfile
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
61
67
|
- ext/rapngasm/apngasm_ruby.h
|
62
68
|
- ext/rapngasm/extconf.rb
|
63
69
|
- ext/rapngasm/rapngasm.cpp
|
70
|
+
- rapngasm.gemspec
|
71
|
+
- spec/rapngasm_spec.rb
|
72
|
+
- spec/spec_helper.rb
|
73
|
+
- spec/support/apngasm.png
|
74
|
+
- spec/support/test1.png
|
75
|
+
- spec/support/test2.png
|
64
76
|
homepage: http://www.github.com/apngasm/rapngasm
|
65
77
|
licenses:
|
66
78
|
- libpng/zlib
|
@@ -69,6 +81,7 @@ post_install_message:
|
|
69
81
|
rdoc_options: []
|
70
82
|
require_paths:
|
71
83
|
- lib
|
84
|
+
- ext
|
72
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
86
|
requirements:
|
74
87
|
- - ">="
|
@@ -76,9 +89,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
89
|
version: '0'
|
77
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
91
|
requirements:
|
79
|
-
- - "
|
92
|
+
- - ">"
|
80
93
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
94
|
+
version: 1.3.1
|
82
95
|
requirements: []
|
83
96
|
rubyforge_project:
|
84
97
|
rubygems_version: 2.2.2
|