shattered_machine 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG +9 -0
- data/Gemfile +1 -0
- data/README.md +8 -4
- data/lib/shattered_machine.rb +1 -1
- data/lib/shattered_machine/brush.rb +1 -1
- data/lib/shattered_machine/converter.rb +1 -1
- data/lib/shattered_machine/pixel_sorter.rb +1 -1
- data/lib/shattered_machine/slim.rb +1 -1
- data/shattered_machine.gemspec +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +3 -13
- data/.yardoc/checksums +0 -14
- 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/doc/ShatteredMachine/RustyEngine.html +0 -122
- 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 +0 -43
- data/spec/lib/rusty_engine_spec.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ad50443747414310eb9007d97f618a1cdd855723df9ab2455b482eb1160b1f
|
4
|
+
data.tar.gz: fba7f95d7a020f6548f6b154c9cb89cd0b4b55c6d8427ce1b319cbd2c9294e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a2d147f7f27be2db8fb92962448c3fbed6d73cb3ce6933a07234f2b3f04938f614211704e9970c585a956b3e490d366664abf120dbc745b5f3c386a6649c34
|
7
|
+
data.tar.gz: 7ad0e654382ff1a24a495f7e9ca7e963a0c21ae6765c72f94770ca95c3b49a9171d03a1dd6abd3c0ff5add3f7b17fb0e3e7d48c7518e81822eef920041e30409
|
data/.gitignore
CHANGED
data/CHANGELOG
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [0.0.3] - 2021-05-26
|
8
|
+
### Changed
|
9
|
+
- Replaces Rusty Engine library with the gem encapsulating those files
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Shattered Machine
|
2
2
|
|
3
|
-
The Shattered Machine is a gem that aim to create glitched png images easily.
|
3
|
+
The Shattered Machine is a gem that aim to create glitched png images easily.
|
4
4
|
|
5
|
+
* [Rubygems page](https://rubygems.org/gems/shattered_machine)
|
6
|
+
* [Documentation](https://www.rubydoc.info/gems/shattered_machine)
|
5
7
|
## Features
|
6
8
|
|
7
9
|
- Converter : Convert a single jpg images or a directory full of jpg image into png
|
@@ -15,7 +17,7 @@ The Shattered Machine is a gem that aim to create glitched png images easily.
|
|
15
17
|
```ruby
|
16
18
|
require 'shattered_machine'
|
17
19
|
|
18
|
-
io = ShatteredMachine::Io.new(
|
20
|
+
io = ShatteredMachine::Io.new('input_image.png', 'output_folder', 'output_filename')
|
19
21
|
ShatteredMachine::Glitcher.new('Slim', io).call
|
20
22
|
```
|
21
23
|
|
@@ -24,7 +26,7 @@ ShatteredMachine::Glitcher.new('Slim', io).call
|
|
24
26
|
```ruby
|
25
27
|
require 'shattered_machine'
|
26
28
|
|
27
|
-
io = ShatteredMachine::Io.new(
|
29
|
+
io = ShatteredMachine::Io.new('input_image.png', 'output_folder', 'output_filename')
|
28
30
|
ShatteredMachine::Sampler.new(io).call
|
29
31
|
```
|
30
32
|
|
@@ -33,11 +35,13 @@ ShatteredMachine::Sampler.new(io).call
|
|
33
35
|
```ruby
|
34
36
|
require 'shattered_machine'
|
35
37
|
|
36
|
-
io = ShatteredMachine::Io.new(
|
38
|
+
io = ShatteredMachine::Io.new('input_image.jpg', 'output_folder', 'output_filename')
|
37
39
|
ShatteredMachine::Converter.new(io).call
|
38
40
|
```
|
39
41
|
|
40
42
|
## Development
|
43
|
+
### Install locally
|
44
|
+
|
41
45
|
The Shattered Machine using two main libraries for glitching :
|
42
46
|
- [pnglitch](https://github.com/ucnv/pnglitch)
|
43
47
|
- [rusty engine](https://framagit.org/Radoteur/rusty_engine)
|
data/lib/shattered_machine.rb
CHANGED
data/shattered_machine.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'shattered_machine'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.summary = 'Shattered Machine core engine'
|
5
5
|
s.description = 'Shattered Machine is an easy way to glitch PNG images using different algorithms'
|
6
6
|
s.authors = ['Flo Girardo']
|
data/spec/spec_helper.rb
CHANGED
@@ -12,7 +12,6 @@ RSpec.configure do |config|
|
|
12
12
|
config.shared_context_metadata_behavior = :apply_to_host_groups
|
13
13
|
|
14
14
|
$LOAD_PATH.unshift File.expand_path('..', __dir__)
|
15
|
-
require 'lib/rusty_engine/rusty_engine'
|
16
15
|
require 'lib/shattered_machine/converter'
|
17
16
|
require 'lib/shattered_machine/brush'
|
18
17
|
require 'lib/shattered_machine/change_byte'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shattered_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flo Girardo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -47,11 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
49
|
- ".rspec"
|
50
|
-
-
|
51
|
-
- ".yardoc/complete"
|
52
|
-
- ".yardoc/object_types"
|
53
|
-
- ".yardoc/objects/root.dat"
|
54
|
-
- ".yardoc/proxy_types"
|
50
|
+
- CHANGELOG
|
55
51
|
- Gemfile
|
56
52
|
- LICENSE
|
57
53
|
- README.md
|
@@ -65,7 +61,6 @@ files:
|
|
65
61
|
- doc/ShatteredMachine/Io.html
|
66
62
|
- doc/ShatteredMachine/Io/Paths.html
|
67
63
|
- doc/ShatteredMachine/PixelSorter.html
|
68
|
-
- doc/ShatteredMachine/RustyEngine.html
|
69
64
|
- doc/ShatteredMachine/Sampler.html
|
70
65
|
- doc/ShatteredMachine/Slim.html
|
71
66
|
- doc/ShatteredMachine/Transpose.html
|
@@ -83,10 +78,6 @@ files:
|
|
83
78
|
- doc/js/jquery.js
|
84
79
|
- doc/method_list.html
|
85
80
|
- doc/top-level-namespace.html
|
86
|
-
- lib/rusty_engine/librusty_engine.dll
|
87
|
-
- lib/rusty_engine/librusty_engine.dylib
|
88
|
-
- lib/rusty_engine/librusty_engine.so
|
89
|
-
- lib/rusty_engine/rusty_engine.rb
|
90
81
|
- lib/shattered_machine.rb
|
91
82
|
- lib/shattered_machine/brush.rb
|
92
83
|
- lib/shattered_machine/change_byte.rb
|
@@ -114,7 +105,6 @@ files:
|
|
114
105
|
- spec/images/fuzz.JPG
|
115
106
|
- spec/images/pouet.JPEG
|
116
107
|
- spec/io_spec.rb
|
117
|
-
- spec/lib/rusty_engine_spec.rb
|
118
108
|
- spec/pixel_sorter_spec.rb
|
119
109
|
- spec/sampler_spec.rb
|
120
110
|
- spec/slim_spec.rb
|
data/.yardoc/checksums
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
lib/shattered_machine.rb e5d8db3b105d5d0409ff7211617ea36044986a0a
|
2
|
-
lib/shattered_machine/io.rb 02fface2a883b962a3c27ffba497af8aad184993
|
3
|
-
lib/shattered_machine/slim.rb 1f0def79e7f6631d6b9b239d5d11f512d761815f
|
4
|
-
lib/shattered_machine/brush.rb d0c27748daffefd4b40ecee2feff395d1dd3a1da
|
5
|
-
lib/shattered_machine/defect.rb b2402bad054d51847fd3b83d597014e8e97a2fe8
|
6
|
-
lib/rusty_engine/rusty_engine.rb 530c6563814f0c230f14606e96468962d2ae88c3
|
7
|
-
lib/shattered_machine/sampler.rb 51823b7678fd9da8868a2c6e847727b2d51d24b3
|
8
|
-
lib/shattered_machine/exchange.rb d230bc77bb9dfc34ea89e55892a6a33ec028d4b6
|
9
|
-
lib/shattered_machine/glitcher.rb 071744286d68720fe47d7dfae2e033fdcff1cf69
|
10
|
-
lib/shattered_machine/converter.rb da5eeda73917386592612d0834a7c4d4467d5df2
|
11
|
-
lib/shattered_machine/transpose.rb 412ae07a4bf92dd8ba7383bce7558b85ad369e6a
|
12
|
-
lib/shattered_machine/change_byte.rb 445fc0f28fe02eaf83e711e1d616862128a86be4
|
13
|
-
lib/shattered_machine/pixel_sorter.rb 8670ff9c56a769797654ebd41f358ce48cd72962
|
14
|
-
lib/shattered_machine/wrong_filter.rb a71a6b72cd152d3106e266e4736369cff7fdb6b1
|
data/.yardoc/complete
DELETED
File without changes
|
data/.yardoc/object_types
DELETED
Binary file
|
data/.yardoc/objects/root.dat
DELETED
Binary file
|
data/.yardoc/proxy_types
DELETED
Binary file
|
@@ -1,122 +0,0 @@
|
|
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::RustyEngine
|
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::RustyEngine";
|
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 (R)</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">RustyEngine</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::RustyEngine
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<dl>
|
73
|
-
<dt>Extended by:</dt>
|
74
|
-
<dd>FFI::Library</dd>
|
75
|
-
</dl>
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
<dl>
|
85
|
-
<dt>Defined in:</dt>
|
86
|
-
<dd>lib/rusty_engine/rusty_engine.rb</dd>
|
87
|
-
</dl>
|
88
|
-
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<h2>Overview</h2><div class="docstring">
|
92
|
-
<div class="discussion">
|
93
|
-
|
94
|
-
<p>Add the following functions from the <a href="https://framagit.org/Radoteur/rusty_engine" target="_parent" title="Optional Rusty Engine">Optional Rusty Engine</a> using FFI : convert, brush, slim, sort.</p>
|
95
|
-
|
96
|
-
|
97
|
-
</div>
|
98
|
-
</div>
|
99
|
-
<div class="tags">
|
100
|
-
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
</div>
|
113
|
-
|
114
|
-
<div id="footer">
|
115
|
-
Generated on Sun May 23 18:36:58 2021 by
|
116
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
117
|
-
0.9.26 (ruby-2.6.6).
|
118
|
-
</div>
|
119
|
-
|
120
|
-
</div>
|
121
|
-
</body>
|
122
|
-
</html>
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'ffi'
|
4
|
-
|
5
|
-
module ShatteredMachine
|
6
|
-
# Add the following functions from the {https://framagit.org/Radoteur/rusty_engine Optional Rusty Engine} using FFI :
|
7
|
-
# convert, brush, slim, sort.
|
8
|
-
module RustyEngine
|
9
|
-
extend FFI::Library
|
10
|
-
lib_name = "librusty_engine.#{FFI::Platform::LIBSUFFIX}"
|
11
|
-
ffi_lib File.expand_path(lib_name, __dir__)
|
12
|
-
|
13
|
-
# Params : input output
|
14
|
-
attach_function :convert, %i[string string], :void, { blocking: true }
|
15
|
-
|
16
|
-
# Params : input output proba min max direction
|
17
|
-
# Directions : 1 -> horizontal
|
18
|
-
# 2 -> vertical
|
19
|
-
# 3 -> horizontal_inverted
|
20
|
-
# 4 -> vertical_inverted
|
21
|
-
attach_function :brush, %i[string string string string string string], :void, { blocking: true }
|
22
|
-
|
23
|
-
# Params : input, output, proba, probability_area, direction, colors, color_with_proba
|
24
|
-
# Directions : 1 -> up_to_down
|
25
|
-
# 2 -> down_to_up
|
26
|
-
# 3 -> left_to_right
|
27
|
-
# 4 -> right_to_left
|
28
|
-
attach_function :slim, %i[string string string string string string string], :void, { blocking: true }
|
29
|
-
|
30
|
-
# Params : input, output, direction, smart_sorting, detection_type, min, max, multiple_range, min_2, max_2,
|
31
|
-
# sorting_by
|
32
|
-
# directions : 0 -> up_to_down
|
33
|
-
# 1 -> down_to_up
|
34
|
-
# 2 -> left_to_right
|
35
|
-
# 3 -> right_to_left
|
36
|
-
# detection_type : 0 -> hues
|
37
|
-
# 1 -> colors
|
38
|
-
# sorting_by : 0 -> hue
|
39
|
-
# 1 -> saturation
|
40
|
-
attach_function :sort, %i[string string string string string string string string string string string],
|
41
|
-
:void, { blocking: true }
|
42
|
-
end
|
43
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe ShatteredMachine::RustyEngine do
|
6
|
-
describe '.convert' do
|
7
|
-
let(:converted_file) { 'spec/images/converted.png' }
|
8
|
-
subject { ShatteredMachine::RustyEngine.convert('spec/images/foo.jpg', converted_file) }
|
9
|
-
|
10
|
-
after do
|
11
|
-
File.delete(converted_file) if File.exist?(converted_file)
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'convert image' do
|
15
|
-
subject
|
16
|
-
expect(File.exist?(converted_file)).to be true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|