shattered_machine 0.0.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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.yardoc/checksums +14 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +8 -0
- data/LICENSE +9 -0
- data/README.md +51 -0
- data/doc/ShatteredMachine.html +135 -0
- data/doc/ShatteredMachine/Brush.html +375 -0
- data/doc/ShatteredMachine/ChangeByte.html +367 -0
- data/doc/ShatteredMachine/Converter.html +327 -0
- data/doc/ShatteredMachine/Defect.html +369 -0
- data/doc/ShatteredMachine/Exchange.html +373 -0
- data/doc/ShatteredMachine/Glitcher.html +365 -0
- data/doc/ShatteredMachine/Io.html +569 -0
- data/doc/ShatteredMachine/Io/Paths.html +310 -0
- data/doc/ShatteredMachine/PixelSorter.html +381 -0
- data/doc/ShatteredMachine/RustyEngine.html +111 -0
- data/doc/ShatteredMachine/Sampler.html +361 -0
- data/doc/ShatteredMachine/Slim.html +389 -0
- data/doc/ShatteredMachine/Transpose.html +369 -0
- data/doc/ShatteredMachine/WrongFilter.html +367 -0
- data/doc/_index.html +288 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +123 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +275 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/rusty_engine/librusty_engine.dll +0 -0
- data/lib/rusty_engine/librusty_engine.dylib +0 -0
- data/lib/rusty_engine/librusty_engine.so +0 -0
- data/lib/rusty_engine/rusty_engine.rb +39 -0
- data/lib/shattered_machine.rb +11 -0
- data/lib/shattered_machine/brush.rb +28 -0
- data/lib/shattered_machine/change_byte.rb +41 -0
- data/lib/shattered_machine/converter.rb +20 -0
- data/lib/shattered_machine/defect.rb +38 -0
- data/lib/shattered_machine/exchange.rb +59 -0
- data/lib/shattered_machine/glitcher.rb +35 -0
- data/lib/shattered_machine/io.rb +74 -0
- data/lib/shattered_machine/pixel_sorter.rb +50 -0
- data/lib/shattered_machine/sampler.rb +100 -0
- data/lib/shattered_machine/slim.rb +55 -0
- data/lib/shattered_machine/transpose.rb +50 -0
- data/lib/shattered_machine/wrong_filter.rb +39 -0
- data/shattered_machine.gemspec +16 -0
- data/spec/brush_spec.rb +28 -0
- data/spec/change_byte_spec.rb +26 -0
- data/spec/converter_spec.rb +24 -0
- data/spec/defect_spec.rb +26 -0
- data/spec/exchange_spec.rb +26 -0
- data/spec/glitcher_spec.rb +26 -0
- data/spec/images/bar.PNG +0 -0
- data/spec/images/bar.jpeg +0 -0
- data/spec/images/foo.jpg +0 -0
- data/spec/images/foo.png +0 -0
- data/spec/images/fuzz.JPG +0 -0
- data/spec/images/pouet.JPEG +0 -0
- data/spec/io_spec.rb +74 -0
- data/spec/lib/rusty_engine_spec.rb +20 -0
- data/spec/pixel_sorter_spec.rb +26 -0
- data/spec/sampler_spec.rb +37 -0
- data/spec/slim_spec.rb +26 -0
- data/spec/spec_helper.rb +61 -0
- data/spec/transpose_spec.rb +26 -0
- data/spec/wrong_filter_spec.rb +26 -0
- metadata +147 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9dfe9b876f9e7becbce16bfd223a2e4fabede7d81b0b1ab9f1a6dbfed77931ec
|
4
|
+
data.tar.gz: ab812b93fc168c2fb8baf1624c8d40ff6f765ae5e850a7419d93a3dc6e64f38a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: abd2a55f1217e645cb88f9f5c81e9ae6fdcbf39016225d9b54ceabdbfe5f2a6d5d967ec500b14b1ba81b4b0d1a2f6a514b3d578ffa3b6110ff42d6cb6fcc583c
|
7
|
+
data.tar.gz: 108b1a08f80418a52f9c6df0f7cbf27fd7b0f76e1643c6f5f3ae0fd5ec0eb023e668593e0feff9955cff9da5d85b58722cc3ee5b112d68992582f3e723722e3c
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.yardoc/checksums
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
lib/shattered_machine.rb 5501f4ff757917169b063b04806ee16c0aa5ab2c
|
2
|
+
lib/shattered_machine/io.rb 02fface2a883b962a3c27ffba497af8aad184993
|
3
|
+
lib/shattered_machine/slim.rb 071024bd045684c8fcaa81499e924156f4b4df78
|
4
|
+
lib/shattered_machine/brush.rb d0c27748daffefd4b40ecee2feff395d1dd3a1da
|
5
|
+
lib/shattered_machine/defect.rb b2402bad054d51847fd3b83d597014e8e97a2fe8
|
6
|
+
lib/rusty_engine/rusty_engine.rb 17b075a2fc7fe87c63721eab953059b26ce01210
|
7
|
+
lib/shattered_machine/sampler.rb 7bf247a9ef6b34836cd45920f66122a786095a9e
|
8
|
+
lib/shattered_machine/exchange.rb fad77d3d75ee0652ec0ba2166f2ace56ef533bd3
|
9
|
+
lib/shattered_machine/glitcher.rb 071744286d68720fe47d7dfae2e033fdcff1cf69
|
10
|
+
lib/shattered_machine/converter.rb da5eeda73917386592612d0834a7c4d4467d5df2
|
11
|
+
lib/shattered_machine/transpose.rb 48a77c39cca754c222dd7719b4febc110da63c7a
|
12
|
+
lib/shattered_machine/change_byte.rb 445fc0f28fe02eaf83e711e1d616862128a86be4
|
13
|
+
lib/shattered_machine/pixel_sorter.rb 383dcd25a9f9253ce15b1849ae849ea94144757c
|
14
|
+
lib/shattered_machine/wrong_filter.rb 22131fb22b4bcda10b1251f3266801770e71861f
|
data/.yardoc/complete
ADDED
File without changes
|
Binary file
|
Binary file
|
data/.yardoc/proxy_types
ADDED
Binary file
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright © 2021 Flo Girardo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Shattered Machine
|
2
|
+
|
3
|
+
The Shattered Machine is a gem that aim to create glitched png images easily.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
- Converter : Convert a single jpg images or a directory full of jpg image into png
|
8
|
+
- Seven algorithms : Seven different alogirithm with their own settings giving you lots of freedom to mess with your images
|
9
|
+
- Sampler : Giving you a quick overview of all algorithms effect on your image
|
10
|
+
- Folder glitching : Glitch easily all png images contained in a folder
|
11
|
+
|
12
|
+
## Usage/Examples
|
13
|
+
### Glitcher
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'shattered_machine'
|
17
|
+
|
18
|
+
io = ShatteredMachine::Io.new( 'input_image.png', 'output_folder', 'output_filename')
|
19
|
+
ShatteredMachine::Glitcher.new('Slim', io).call
|
20
|
+
```
|
21
|
+
|
22
|
+
### Sampler
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'shattered_machine'
|
26
|
+
|
27
|
+
io = ShatteredMachine::Io.new( 'input_image.png', 'output_folder', 'output_filename')
|
28
|
+
ShatteredMachine::Sampler.new(io).call
|
29
|
+
```
|
30
|
+
|
31
|
+
### Converter
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
require 'shattered_machine'
|
35
|
+
|
36
|
+
io = ShatteredMachine::Io.new( 'input_image.jpg', 'output_folder', 'output_filename')
|
37
|
+
ShatteredMachine::Converter.new(io).call
|
38
|
+
```
|
39
|
+
|
40
|
+
## Development
|
41
|
+
The Shattered Machine using two main libraries for glitching :
|
42
|
+
- [pnglitch](https://github.com/ucnv/pnglitch)
|
43
|
+
- [rusty engine](https://framagit.org/Radoteur/rusty_engine)
|
44
|
+
|
45
|
+
The rusty engine is written in rust and a compiled version for Windows, Mac os and Linux is already included in the gem.
|
46
|
+
To install the needed dependencies you need to install the [Ruby language](https://www.ruby-lang.org/en/) and [Bundler](https://bundler.io/).
|
47
|
+
|
48
|
+
Then run `bundle install` to fetch the needed gems.
|
49
|
+
|
50
|
+
### Specs
|
51
|
+
This project uses [Rspec](https://rspec.info/) for writting specs, to run them simply run `bundle rspec`
|
@@ -0,0 +1,135 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: ShatteredMachine
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ShatteredMachine";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (S)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">ShatteredMachine</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: ShatteredMachine
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/shattered_machine.rb<span class="defines">,<br />
|
82
|
+
lib/shattered_machine/io.rb,<br /> lib/shattered_machine/slim.rb,<br /> lib/shattered_machine/brush.rb,<br /> lib/shattered_machine/defect.rb,<br /> lib/rusty_engine/rusty_engine.rb,<br /> lib/shattered_machine/sampler.rb,<br /> lib/shattered_machine/exchange.rb,<br /> lib/shattered_machine/glitcher.rb,<br /> lib/shattered_machine/converter.rb,<br /> lib/shattered_machine/transpose.rb,<br /> lib/shattered_machine/change_byte.rb,<br /> lib/shattered_machine/pixel_sorter.rb,<br /> lib/shattered_machine/wrong_filter.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Defined Under Namespace</h2>
|
89
|
+
<p class="children">
|
90
|
+
|
91
|
+
|
92
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ShatteredMachine/RustyEngine.html" title="ShatteredMachine::RustyEngine (module)">RustyEngine</a></span>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ShatteredMachine/Brush.html" title="ShatteredMachine::Brush (class)">Brush</a></span>, <span class='object_link'><a href="ShatteredMachine/ChangeByte.html" title="ShatteredMachine::ChangeByte (class)">ChangeByte</a></span>, <span class='object_link'><a href="ShatteredMachine/Converter.html" title="ShatteredMachine::Converter (class)">Converter</a></span>, <span class='object_link'><a href="ShatteredMachine/Defect.html" title="ShatteredMachine::Defect (class)">Defect</a></span>, <span class='object_link'><a href="ShatteredMachine/Exchange.html" title="ShatteredMachine::Exchange (class)">Exchange</a></span>, <span class='object_link'><a href="ShatteredMachine/Glitcher.html" title="ShatteredMachine::Glitcher (class)">Glitcher</a></span>, <span class='object_link'><a href="ShatteredMachine/Io.html" title="ShatteredMachine::Io (class)">Io</a></span>, <span class='object_link'><a href="ShatteredMachine/PixelSorter.html" title="ShatteredMachine::PixelSorter (class)">PixelSorter</a></span>, <span class='object_link'><a href="ShatteredMachine/Sampler.html" title="ShatteredMachine::Sampler (class)">Sampler</a></span>, <span class='object_link'><a href="ShatteredMachine/Slim.html" title="ShatteredMachine::Slim (class)">Slim</a></span>, <span class='object_link'><a href="ShatteredMachine/Transpose.html" title="ShatteredMachine::Transpose (class)">Transpose</a></span>, <span class='object_link'><a href="ShatteredMachine/WrongFilter.html" title="ShatteredMachine::WrongFilter (class)">WrongFilter</a></span>
|
97
|
+
|
98
|
+
|
99
|
+
</p>
|
100
|
+
|
101
|
+
|
102
|
+
<h2>
|
103
|
+
Constant Summary
|
104
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
105
|
+
</h2>
|
106
|
+
|
107
|
+
<dl class="constants">
|
108
|
+
|
109
|
+
<dt id="VERSION-constant" class="">VERSION =
|
110
|
+
|
111
|
+
</dt>
|
112
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.1</span><span class='tstring_end'>'</span></span></pre></dd>
|
113
|
+
|
114
|
+
</dl>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div id="footer">
|
128
|
+
Generated on Sun May 23 13:30:10 2021 by
|
129
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
|
+
0.9.26 (ruby-2.6.6).
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
</body>
|
135
|
+
</html>
|
@@ -0,0 +1,375 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: ShatteredMachine::Brush
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ShatteredMachine::Brush";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (B)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../ShatteredMachine.html" title="ShatteredMachine (module)">ShatteredMachine</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Brush</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: ShatteredMachine::Brush
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">ShatteredMachine::Brush</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/shattered_machine/brush.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Brush pixels of a given png image. The logic for the brush come from the Rusty Engine.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>
|
122
|
+
Instance Method Summary
|
123
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
124
|
+
</h2>
|
125
|
+
|
126
|
+
<ul class="summary">
|
127
|
+
|
128
|
+
<li class="public ">
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(input_image, output_image) ⇒ boolean </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Status of brush.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) ⇒ Brush </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
<span class="note title constructor">constructor</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>A new instance of Brush.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
</ul>
|
179
|
+
|
180
|
+
|
181
|
+
<div id="constructor_details" class="method_details_list">
|
182
|
+
<h2>Constructor Details</h2>
|
183
|
+
|
184
|
+
<div class="method_details first">
|
185
|
+
<h3 class="signature first" id="initialize-instance_method">
|
186
|
+
|
187
|
+
#<strong>initialize</strong>(options = {}) ⇒ <tt><span class='object_link'><a href="" title="ShatteredMachine::Brush (class)">Brush</a></span></tt>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</h3><div class="docstring">
|
194
|
+
<div class="discussion">
|
195
|
+
|
196
|
+
<p>Returns a new instance of Brush.</p>
|
197
|
+
|
198
|
+
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
<div class="tags">
|
202
|
+
<p class="tag_title">Parameters:</p>
|
203
|
+
<ul class="param">
|
204
|
+
|
205
|
+
<li>
|
206
|
+
|
207
|
+
<span class='name'>options</span>
|
208
|
+
|
209
|
+
|
210
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
211
|
+
|
212
|
+
|
213
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
214
|
+
|
215
|
+
|
216
|
+
—
|
217
|
+
<div class='inline'>
|
218
|
+
<p>options for brush algorithm</p>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
</li>
|
222
|
+
|
223
|
+
</ul>
|
224
|
+
|
225
|
+
|
226
|
+
</div><table class="source_code">
|
227
|
+
<tr>
|
228
|
+
<td>
|
229
|
+
<pre class="lines">
|
230
|
+
|
231
|
+
|
232
|
+
10
|
233
|
+
11
|
234
|
+
12
|
235
|
+
13
|
236
|
+
14
|
237
|
+
15</pre>
|
238
|
+
</td>
|
239
|
+
<td>
|
240
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/brush.rb', line 10</span>
|
241
|
+
|
242
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
243
|
+
<span class='ivar'>@direction</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:direction</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:horizontal_inverted</span>
|
244
|
+
<span class='ivar'>@probability</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:probability</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>18</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
245
|
+
<span class='ivar'>@min_pixels</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:min_pixels</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
246
|
+
<span class='ivar'>@max_pixels</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:max_pixels</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>10</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
247
|
+
<span class='kw'>end</span></pre>
|
248
|
+
</td>
|
249
|
+
</tr>
|
250
|
+
</table>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
<div id="instance_method_details" class="method_details_list">
|
257
|
+
<h2>Instance Method Details</h2>
|
258
|
+
|
259
|
+
|
260
|
+
<div class="method_details first">
|
261
|
+
<h3 class="signature first" id="call-instance_method">
|
262
|
+
|
263
|
+
#<strong>call</strong>(input_image, output_image) ⇒ <tt>boolean</tt>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
</h3><div class="docstring">
|
270
|
+
<div class="discussion">
|
271
|
+
|
272
|
+
<p>Returns status of brush.</p>
|
273
|
+
|
274
|
+
|
275
|
+
</div>
|
276
|
+
</div>
|
277
|
+
<div class="tags">
|
278
|
+
<p class="tag_title">Parameters:</p>
|
279
|
+
<ul class="param">
|
280
|
+
|
281
|
+
<li>
|
282
|
+
|
283
|
+
<span class='name'>input_image</span>
|
284
|
+
|
285
|
+
|
286
|
+
<span class='type'>(<tt>string</tt>)</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
—
|
291
|
+
<div class='inline'>
|
292
|
+
<p>path for image</p>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</li>
|
296
|
+
|
297
|
+
<li>
|
298
|
+
|
299
|
+
<span class='name'>output_image</span>
|
300
|
+
|
301
|
+
|
302
|
+
<span class='type'>(<tt>string</tt>)</span>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
—
|
307
|
+
<div class='inline'>
|
308
|
+
<p>path for output brushed image</p>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</li>
|
312
|
+
|
313
|
+
</ul>
|
314
|
+
|
315
|
+
<p class="tag_title">Returns:</p>
|
316
|
+
<ul class="return">
|
317
|
+
|
318
|
+
<li>
|
319
|
+
|
320
|
+
|
321
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
—
|
326
|
+
<div class='inline'>
|
327
|
+
<p>status of brush</p>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</li>
|
331
|
+
|
332
|
+
</ul>
|
333
|
+
|
334
|
+
</div><table class="source_code">
|
335
|
+
<tr>
|
336
|
+
<td>
|
337
|
+
<pre class="lines">
|
338
|
+
|
339
|
+
|
340
|
+
20
|
341
|
+
21
|
342
|
+
22
|
343
|
+
23
|
344
|
+
24
|
345
|
+
25
|
346
|
+
26</pre>
|
347
|
+
</td>
|
348
|
+
<td>
|
349
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/brush.rb', line 20</span>
|
350
|
+
|
351
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='comma'>,</span> <span class='id identifier rubyid_output_image'>output_image</span><span class='rparen'>)</span>
|
352
|
+
<span class='id identifier rubyid_ruby_to_rust_directions'>ruby_to_rust_directions</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>horizontal:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>vertical:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>2</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
353
|
+
<span class='label'>horizontal_inverted:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>3</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
354
|
+
<span class='label'>vertical_inverted:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>4</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
355
|
+
<span class='const'><span class='object_link'><a href="RustyEngine.html" title="ShatteredMachine::RustyEngine (module)">RustyEngine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_brush'>brush</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='comma'>,</span> <span class='id identifier rubyid_output_image'>output_image</span><span class='comma'>,</span> <span class='ivar'>@probability</span><span class='comma'>,</span> <span class='ivar'>@min_pixels</span><span class='comma'>,</span>
|
356
|
+
<span class='ivar'>@max_pixels</span><span class='comma'>,</span> <span class='id identifier rubyid_ruby_to_rust_directions'>ruby_to_rust_directions</span><span class='lbracket'>[</span><span class='ivar'>@direction</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
357
|
+
<span class='kw'>end</span></pre>
|
358
|
+
</td>
|
359
|
+
</tr>
|
360
|
+
</table>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
</div>
|
366
|
+
|
367
|
+
<div id="footer">
|
368
|
+
Generated on Sun May 23 13:30:11 2021 by
|
369
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
370
|
+
0.9.26 (ruby-2.6.6).
|
371
|
+
</div>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
</body>
|
375
|
+
</html>
|