mc_dot_art_maker 0.4.0 → 0.4.1
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/lib/mc_dot_art_maker/block_list.rb +3 -3
- data/lib/mc_dot_art_maker/maker.rb +5 -4
- data/mc_dot_art_maker.gemspec +3 -1
- data/test/images/tmp/normal_conversion_schematic.schematic +0 -0
- data/test/test_block_list.rb +7 -7
- data/test/test_dither_method.rb +1 -1
- data/test/test_dot.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe8bba8b3c0dd213bbc1373c7855a5e3e5d525ce
|
4
|
+
data.tar.gz: 1e9ef111cc8d79258a25cc2b3150b2008ab8fc69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b156b06c04153393b1538c8c333914112df2a3e27519d03a6a308212ae238b35054f276384ef44dea3900bad695cc09b8022deb0f91ed6e923dec4cc9008f733
|
7
|
+
data.tar.gz: 07e1adbf5b2a86e918f281528f0a188e53f9ce04de02349a4a6de90d7c90b7f6fddd96dc2dc24577aa17a1ebfeca5e460614695efa87cf595e271760be2c4f12
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module MCDotArtMaker
|
2
2
|
class BlockList
|
3
3
|
include Enumerable
|
4
|
-
include Singleton
|
5
|
-
def initialize
|
6
|
-
@loader = MCDotArtMaker::TextureLoader.new
|
4
|
+
# include Singleton
|
5
|
+
def initialize(jar_path = nil)
|
6
|
+
@loader = MCDotArtMaker::TextureLoader.new(jar_path)
|
7
7
|
@blocks = []
|
8
8
|
|
9
9
|
# できるだけ多くのブロックを使ったバージョン
|
@@ -4,7 +4,7 @@ module MCDotArtMaker
|
|
4
4
|
class Maker
|
5
5
|
attr_reader :width, :height, :dots, :image
|
6
6
|
|
7
|
-
def initialize(filename_or_image,dither_method
|
7
|
+
def initialize(filename_or_image,dither_method: RiemersmaDitherMethod, jar_path: nil)
|
8
8
|
@image =
|
9
9
|
case filename_or_image
|
10
10
|
when String
|
@@ -16,9 +16,10 @@ module MCDotArtMaker
|
|
16
16
|
|
17
17
|
@schematic_helper = MCDotArtMaker::SchematicHelper.new
|
18
18
|
@schematic_helper.read(File.expand_path('../seed.schematic', __FILE__))
|
19
|
-
@block_list = MCDotArtMaker::BlockList.instance
|
19
|
+
# @block_list = MCDotArtMaker::BlockList.instance
|
20
|
+
@block_list = MCDotArtMaker::BlockList.new(jar_path)
|
20
21
|
|
21
|
-
@calculation_count = 0
|
22
|
+
@calculation_count = 0
|
22
23
|
@is_locked = false
|
23
24
|
|
24
25
|
MCDotArtMaker::Dot.set_color_palette(@block_list)
|
@@ -32,7 +33,7 @@ module MCDotArtMaker
|
|
32
33
|
def manipulate
|
33
34
|
check_not_locked
|
34
35
|
image = yield @image
|
35
|
-
raise(ArgumentError,"Should return Magick::Image object") unless image.class == Magick::Image
|
36
|
+
raise(ArgumentError, "Should return Magick::Image object") unless image.class == Magick::Image
|
36
37
|
@image = image
|
37
38
|
end
|
38
39
|
|
data/mc_dot_art_maker.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mc_dot_art_maker'
|
3
|
-
s.version = '0.4.
|
3
|
+
s.version = '0.4.1'
|
4
4
|
s.licenses = ['MIT']
|
5
5
|
s.summary = 'Dot Art Maker for Minecraft'
|
6
6
|
s.description = 'Converting images to mosaic arts using Minecraft textures and .schematic files.'
|
@@ -8,6 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.files = `git ls-files -z`.split("\x0")
|
9
9
|
s.homepage = 'https://github.com/Kumassy/MCDotArtMaker'
|
10
10
|
|
11
|
+
s.required_ruby_version = '>= 2.1.0'
|
12
|
+
|
11
13
|
s.add_development_dependency 'bindata'
|
12
14
|
s.add_development_dependency 'color-rgb'
|
13
15
|
s.add_development_dependency 'nbt_utils'
|
Binary file
|
data/test/test_block_list.rb
CHANGED
@@ -3,15 +3,15 @@ require 'test/unit'
|
|
3
3
|
|
4
4
|
class BlockListTest < Test::Unit::TestCase
|
5
5
|
def setup
|
6
|
-
@block_list = MCDotArtMaker::BlockList.
|
6
|
+
@block_list = MCDotArtMaker::BlockList.new
|
7
7
|
end
|
8
8
|
|
9
|
-
def test_singleton
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
9
|
+
# def test_singleton
|
10
|
+
# assert_raise(NoMethodError){
|
11
|
+
# MCDotArtMaker::BlockList.new
|
12
|
+
# }
|
13
|
+
# assert_equal(MCDotArtMaker::BlockList,@block_list.class)
|
14
|
+
# end
|
15
15
|
|
16
16
|
def test_block_list
|
17
17
|
assert_equal(58, @block_list.size)
|
data/test/test_dither_method.rb
CHANGED
@@ -15,7 +15,7 @@ class BlockPaletteTest < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
def setup
|
17
17
|
METHODS.each do |m|
|
18
|
-
maker = MCDotArtMaker::Maker.new("test/images/src/test_image.jpg",m)
|
18
|
+
maker = MCDotArtMaker::Maker.new("test/images/src/test_image.jpg",dither_method: m)
|
19
19
|
maker.texture_image.write "test/images/tmp/dither_methods_#{m}.png"
|
20
20
|
end
|
21
21
|
end
|
data/test/test_dot.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mc_dot_art_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kumassy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
172
|
requirements:
|
173
173
|
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version:
|
175
|
+
version: 2.1.0
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ">="
|