rapngasm 3.1.4 → 3.1.5.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rapngasm/rapngasm.cpp +12 -2
- metadata +5 -18
- data/.gitignore +0 -11
- data/.rubocop.yml +0 -14
- data/Gemfile +0 -11
- data/Guardfile +0 -12
- data/README.md +0 -37
- data/Rakefile +0 -4
- data/rapngasm.gemspec +0 -18
- data/spec/rapngasm_spec.rb +0 -90
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 991c32a9ebfa5ebfc778f7b6e315fbe3c4868d7b
|
4
|
+
data.tar.gz: 6b321c8c37df49455432d717aff108df8bd6932c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e915286e70c7e37fdc6ea2762425c2d3c9d60a673b0cf00db0073981a7a817bdf80386dde9a308e95910b226ca07bfed659bab00122aa9258128915e72807699
|
7
|
+
data.tar.gz: bf0dd34dbdc8907d7a7d14741ff13efa3e90ed5d4032541fdef004e8beac2fe8bb3b0f24b03c8f71f450dad6ff6429ea97b2756ae8631f6e22a8e4b3c0483dfc
|
data/ext/rapngasm/rapngasm.cpp
CHANGED
@@ -57,6 +57,16 @@ rgba* from_ruby< rgba* > (Object o)
|
|
57
57
|
return rgbaArray;
|
58
58
|
}
|
59
59
|
|
60
|
+
template<>
|
61
|
+
const std::string& from_ruby< const std::string& > (Object o)
|
62
|
+
{
|
63
|
+
static std::string tmp;
|
64
|
+
String str(o);
|
65
|
+
tmp.clear();
|
66
|
+
tmp.append(str.c_str());
|
67
|
+
return tmp;
|
68
|
+
}
|
69
|
+
|
60
70
|
//size_t APNGAsm::wrap_add_frame_rgb(Object pixels, unsigned int width, unsigned int height, Object trns_color = NULL, unsigned delayNum = DEFAULT_FRAME_NUMERATOR, unsigned delayDen = DEFAULT_FRAME_DENOMINATOR) {
|
61
71
|
// return this.addFrame(from_ruby<rgb*>(pixels), width, height, from_ruby<rgb*>(trns_color), delayNum, delayDen);
|
62
72
|
//}
|
@@ -81,8 +91,8 @@ void Init_rapngasm()
|
|
81
91
|
|
82
92
|
typedef size_t (APNGAsm::*add_frame_object)(const APNGFrame&);
|
83
93
|
typedef size_t (APNGAsm::*add_frame_file)(const std::string&, unsigned, unsigned);
|
84
|
-
|
85
|
-
|
94
|
+
typedef size_t (APNGAsm::*add_frame_rgb)(rgb*, unsigned int, unsigned int, rgb*, unsigned, unsigned);
|
95
|
+
typedef size_t (APNGAsm::*add_frame_rgba)(rgba*, unsigned int, unsigned int, unsigned, unsigned);
|
86
96
|
define_class<APNGAsm>("APNGAsm")
|
87
97
|
.define_constructor(Constructor<APNGAsm>())
|
88
98
|
.define_method("assemble", &APNGAsm::assemble)
|
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.5.pre
|
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-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -58,21 +58,9 @@ 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
|
67
61
|
- ext/rapngasm/apngasm_ruby.h
|
68
62
|
- ext/rapngasm/extconf.rb
|
69
63
|
- 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
|
76
64
|
homepage: http://www.github.com/apngasm/rapngasm
|
77
65
|
licenses:
|
78
66
|
- libpng/zlib
|
@@ -89,14 +77,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
77
|
version: '0'
|
90
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
79
|
requirements:
|
92
|
-
- - "
|
80
|
+
- - ">"
|
93
81
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
82
|
+
version: 1.3.1
|
95
83
|
requirements: []
|
96
84
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.4.2
|
98
86
|
signing_key:
|
99
87
|
specification_version: 4
|
100
88
|
summary: apngasm for Ruby
|
101
89
|
test_files: []
|
102
|
-
has_rdoc:
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/Gemfile
DELETED
data/Guardfile
DELETED
@@ -1,12 +0,0 @@
|
|
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
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
rapngasm [![Gem Version](https://badge.fury.io/rb/rapngasm.svg)](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
DELETED
data/rapngasm.gemspec
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = 'rapngasm'
|
3
|
-
s.version = '3.1.4'
|
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
|
data/spec/rapngasm_spec.rb
DELETED
@@ -1,90 +0,0 @@
|
|
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
DELETED
File without changes
|
data/spec/support/apngasm.png
DELETED
Binary file
|
data/spec/support/test1.png
DELETED
Binary file
|
data/spec/support/test2.png
DELETED
Binary file
|