shattered_machine 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28ad50443747414310eb9007d97f618a1cdd855723df9ab2455b482eb1160b1f
4
- data.tar.gz: fba7f95d7a020f6548f6b154c9cb89cd0b4b55c6d8427ce1b319cbd2c9294e18
3
+ metadata.gz: 4ed46bb440747bf2fa4412e5be7f18683a798cc6dc4b854ac32e1085af860a38
4
+ data.tar.gz: 3be17bf1cda0c0172a09fa1a22e2511295aea73c3995403d1220ab79eb8f9519
5
5
  SHA512:
6
- metadata.gz: 73a2d147f7f27be2db8fb92962448c3fbed6d73cb3ce6933a07234f2b3f04938f614211704e9970c585a956b3e490d366664abf120dbc745b5f3c386a6649c34
7
- data.tar.gz: 7ad0e654382ff1a24a495f7e9ca7e963a0c21ae6765c72f94770ca95c3b49a9171d03a1dd6abd3c0ff5add3f7b17fb0e3e7d48c7518e81822eef920041e30409
6
+ metadata.gz: a83e2ee9b4cd2f7922bcaedba4fbcb42b98a63c65b804e493b508503a4ad9e903c3fb1a257826e31bd6cf27f618311597ed69dfd97e81ee63ece94405d123385
7
+ data.tar.gz: 55edbf8daee1ee6c6c83260c6a52df2ce939ec3307ae8380fc172cb99f5d95873adffd906fc40a2b7a094ef3fe12a85750a882edcd3e6b3477f091bc6423fe01
data/CHANGELOG CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.0.4] - 2021-05-28
8
+ ### Added
9
+ - Acknowledgements section in README
10
+
11
+ ### Changed
12
+ - The following Sampler constant are not publically available anymore : FILTERS, SLIM_DIRECTION and BRUSH_DIRECTION
13
+
14
+ ### Fixed
15
+ - By default the Sampler now also run the Brush algorithm
16
+
7
17
  ## [0.0.3] - 2021-05-26
8
18
  ### Changed
9
19
  - Replaces Rusty Engine library with the gem encapsulating those files
data/README.md CHANGED
@@ -52,4 +52,10 @@ To install the needed dependencies you need to install the [Ruby language](https
52
52
  Then run `bundle install` to fetch the needed gems.
53
53
 
54
54
  ### Specs
55
+
55
56
  This project uses [Rspec](https://rspec.info/) for writting specs, to run them simply run `bundle rspec`
57
+
58
+ ## Acknowledgements
59
+
60
+ This gem is relying heavily on the [pnglitch gem](https://github.com/ucnv/pnglitch) and the [rusty engine gem](https://framagit.org/Radoteur/rusty_engine).
61
+ The png image used in the specs has been created with [Ronin](https://100r.co/site/ronin.html) while the jpg one is painting from Karl Wiener.
@@ -6,7 +6,7 @@ require 'shattered_machine/io'
6
6
 
7
7
  # main file for ShatteredMachine gem
8
8
  module ShatteredMachine
9
- VERSION = '0.0.3'
9
+ VERSION = '0.0.4'
10
10
 
11
11
  class << self
12
12
  end
@@ -5,10 +5,7 @@ module ShatteredMachine
5
5
  # A simple weay ro run one, many or all glitch algotirhm on one specific image.
6
6
  # This create a quick overview of the effect of each algo for the given image.
7
7
  class Sampler
8
- FILTERS = %w[none sub up average paeth].freeze
9
- SLIM_DIRECTION = %w[up_to_down down_to_up left_to_right right_to_left].freeze
10
- BRUSH_DIRECTION = %w[vertical vertical_inverted horizontal horizontal_inverted].freeze
11
- ALL_ALGORITHMS = %w[exchange transpose wrong_filter slim brus change_byte defect].freeze
8
+ ALL_ALGORITHMS = %w[brush change_byte defect exchange slim transpose wrong_filter].freeze
12
9
 
13
10
  # @param io [ShatteredMachine::Io] Io containing paths for images to sample
14
11
  # @param options [Hash] options for specifying which
@@ -32,6 +29,10 @@ module ShatteredMachine
32
29
 
33
30
  private
34
31
 
32
+ FILTERS = %w[none sub up average paeth].freeze
33
+ SLIM_DIRECTION = %w[up_to_down down_to_up left_to_right right_to_left].freeze
34
+ BRUSH_DIRECTION = %w[vertical vertical_inverted horizontal horizontal_inverted].freeze
35
+
35
36
  def update_io(output_filename_appendix)
36
37
  @io.output_filename = "#{@base_output_filename}_#{output_filename_appendix}"
37
38
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shattered_machine'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
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/sampler_spec.rb CHANGED
@@ -3,6 +3,13 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  RSpec.describe ShatteredMachine::Sampler do
6
+ describe 'ALL_ALGORITHMS' do
7
+ subject { ShatteredMachine::Sampler::ALL_ALGORITHMS }
8
+ it 'returns all algorithm available in sampler' do
9
+ expect(subject).to eq ['brush', 'change_byte', 'defect', 'exchange', 'slim', 'transpose', 'wrong_filter']
10
+ end
11
+ end
12
+
6
13
  describe '#call' do
7
14
  let(:created_files) do
8
15
  %w[sample_exchange_average.png sample_exchange_up.png sample_slim_up_to_down.png sample_transpose_sub.png
@@ -10,7 +17,8 @@ RSpec.describe ShatteredMachine::Sampler do
10
17
  sample_transpose_up.png sample_wrong_filter_sub.png sample_change_byte.png sample_exchange_paeth.png
11
18
  sample_slim_left_to_right.png sample_transpose_none.png sample_wrong_filter_average.png
12
19
  sample_wrong_filter_up.png sample_defect.png sample_exchange_sub.png sample_slim_right_to_left.png
13
- sample_transpose_paeth.png sample_wrong_filter_none.png]
20
+ sample_transpose_paeth.png sample_wrong_filter_none.png sample_brush_horizontal_inverted.png
21
+ sample_brush_horizontal.png sample_brush_vertical_inverted.png sample_brush_vertical.png]
14
22
  end
15
23
  let(:output_file) { 'spec/images/sample.png' }
16
24
  let(:input_file) { 'spec/images/foo.png' }
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.3
4
+ version: 0.0.4
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-26 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec