papirus 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ea7eafaea2155d636ec9e6b712ce6310679a57e
4
- data.tar.gz: 967ca7fb5503b8079e098b98f43c76e77c6d8477
3
+ metadata.gz: a3383785799a1d57bc50f8521650c4a6367eee8d
4
+ data.tar.gz: 2a72256c267feefdd72fcd4bff71d6dccf70f59f
5
5
  SHA512:
6
- metadata.gz: 3f99ad2bcf1bd57e4fb8504e411718654d65c456f996eb72a8540d795e6983ad437902ae869e866983880d6ae870a6b81b3c5e7ff10e251f7481adf4c90a0d4a
7
- data.tar.gz: e97870beae1b628636cba2630a0b3f0a4b2a5b5f0b6596a42ec2804c9f90223980d605a475b969e7c448c4e04cc9e94153038be8ca9f5c1565d487e42e45d91c
6
+ metadata.gz: f2ef93f982daa6ccde5d204a86205198d0ac68802e3a5bad0422e4b966fe91fee83a2b896fd4fe6da93a139293fc9cebf5f4b104b41bd40f946729e05964f390
7
+ data.tar.gz: 576b13337d8dbccb574e295908725ca0ccd66ac9b274f774e709a095a689887e0a31c868a4fc57df1702178d60e3a4b2231903f2a0816a26b36f0ac1af4e9852
data/README.md CHANGED
@@ -34,15 +34,20 @@ display = PaPiRus::Display.new()
34
34
 
35
35
  # Playing with RMagic
36
36
 
37
- ```
38
- require 'rmakgick'
39
- img = Magick::Image::read('mischa.jpg')[0]
40
- display.show(img.resize_to_fit(display.width, display.height).quantize(2, Magick::GRAYColorspace).to_blob()
37
+ ```ruby
38
+ require 'rmagick'
39
+
40
+ img = Magick::Image::read('/path/to/img/file.(png|jpg/etc')[0]
41
+ # we have to translate it to a 2 bit grayscale as that is what our PaPiRus understands
42
+ display.show(img.resize_to_fit(display.width, display.height).quantize(2, Magick::GRAYColorspace).to_blob())
41
43
  ```
42
44
 
43
45
  # Playing with Chunky_PNG
44
- ```
45
- require_relative "lib/chunky" # add's to_bit_stream function to chucky
46
+ ```ruby
47
+ git clone https://github.com/mmolhoek/papirus
48
+ irb
49
+ require 'papirus'
50
+ require_relative 'lib/chunky' # add's to_bit_stream function to chucky
46
51
 
47
52
  #lets get a clean png of the size of the display to play with using chunky_png
48
53
  image = ChunkyPNG::Image.new(display.width, display.height, ChunkyPNG::Color::WHITE)
@@ -52,7 +57,7 @@ image.circle(display.width/2, display.height/2, display.height/2-2)
52
57
 
53
58
  have a look at [chunky_png](https://github.com/wvanbergen/chunky_png/wiki) for more examples
54
59
 
55
- ```
60
+ ```ruby
56
61
  #and last we dump the image as bitsteam to the display
57
62
  display.show(image.to_bit_stream)
58
63
 
@@ -91,7 +96,7 @@ Partial update:
91
96
 
92
97
  ## Load an image from a png file
93
98
 
94
- ```
99
+ ```ruby
95
100
  image = ChunkyPNG::Image.from_file('/some/png/file/path.png')
96
101
  display.show(encode_png_pixels_to_scanline_grayscale_1bit(pixels))
97
102
  ```
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: papirus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mischa Molhoek
@@ -94,8 +94,8 @@ files:
94
94
  - LICENSE.txt
95
95
  - README.md
96
96
  - README.rdoc
97
- - lib/chunky.rb
98
97
  - lib/papirus.rb
98
+ - lib/papirus/chunky.rb
99
99
  homepage: http://github.com/mmolhoek/papirus
100
100
  licenses:
101
101
  - MIT